From a0aba8ff8629ed1e86f146cb2576fb31fa50c548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Draho=C5=A1?= Date: Sat, 8 Oct 2016 08:45:53 +0200 Subject: [PATCH 1/4] Support Symfony3 components --- composer.json | 11 ++++++----- composer.lock | 22 ++++++++++++---------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index b424a180..9af6857a 100644 --- a/composer.json +++ b/composer.json @@ -18,14 +18,15 @@ "bin": ["phpqa"], "require": { "php": ">=5.4", + "henrikbjorn/lurker": "dev-master", "codegyre/robo": "*", "phpmd/phpmd" : "*", "phploc/phploc": "*", - "symfony/dependency-injection": "~2.8", - "symfony/filesystem": "~2.8", - "symfony/process": "~2.8", - "symfony/finder": "~2.8", - "symfony/yaml": "~2.8", + "symfony/dependency-injection": ">=2.8", + "symfony/filesystem": ">=2.8", + "symfony/process": ">=2.8", + "symfony/finder": ">=2.8", + "symfony/yaml": ">=2.8", "pdepend/pdepend": "*", "sebastian/phpcpd": "*", "squizlabs/php_codesniffer": "*", diff --git a/composer.lock b/composer.lock index d50fc31b..4965229c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "62f9707067ef6e5eb8e08d8d3bbc5bb5", - "content-hash": "d23899e9277813bce793d91987c03d97", + "hash": "4f109bd4ee79898a48b2f75fab86284d", + "content-hash": "bbab948633ba13e4e7758fbd5d8068cb", "packages": [ { "name": "codegyre/robo", @@ -64,22 +64,22 @@ }, { "name": "henrikbjorn/lurker", - "version": "1.1.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/flint/Lurker.git", - "reference": "ab45f9cefe600065cc3137a238217598d3a1d062" + "reference": "712d3ef19bef161daa2ba0e0237c6b875587a089" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/flint/Lurker/zipball/ab45f9cefe600065cc3137a238217598d3a1d062", - "reference": "ab45f9cefe600065cc3137a238217598d3a1d062", + "url": "https://api.github.com/repos/flint/Lurker/zipball/712d3ef19bef161daa2ba0e0237c6b875587a089", + "reference": "712d3ef19bef161daa2ba0e0237c6b875587a089", "shasum": "" }, "require": { "php": ">=5.3.3", - "symfony/config": "~2.2", - "symfony/event-dispatcher": "~2.2" + "symfony/config": "^2.2|^3.0", + "symfony/event-dispatcher": "^2.2|^3.0" }, "suggest": { "ext-inotify": ">=0.1.6" @@ -119,7 +119,7 @@ "resource", "watching" ], - "time": "2015-10-27 09:19:19" + "time": "2016-03-16 15:22:20" }, { "name": "hoa/compiler", @@ -2706,7 +2706,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "henrikbjorn/lurker": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { From d797e02481fa4dfc7013a05040a12dd7b45a7f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Draho=C5=A1?= Date: Sat, 8 Oct 2016 09:11:53 +0200 Subject: [PATCH 2/4] Test phpqa with Symfony3 components on php 7.1 --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3abfce66..cab5494a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,13 @@ php: - 5.5 - 5.6 - 7.0 + - 7.1 - hhvm install: - if [ -n "$GITHUB_OAUTH_TOKEN" ]; then composer config github-oauth.github.com ${GITHUB_OAUTH_TOKEN}; fi; - composer install --no-interaction + # test app with symfony3 components in latest php + - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then composer update && composer require sebastian/phpcpd:dev-master; fi script: - vendor/phpunit/phpunit/phpunit - bin/ci.sh From add427c5954435462238aa86adb0a9b087970ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Draho=C5=A1?= Date: Sat, 8 Oct 2016 09:29:01 +0200 Subject: [PATCH 3/4] Fix counting errors in php 7.1 https://travis-ci.org/EdgedesignCZ/phpqa/jobs/166004108#L637 [ErrorException] A non-numeric value encountered Exception trace: () at /home/travis/build/EdgedesignCZ/phpqa/src/Task/TableSummary.php:34 --- src/Task/TableSummary.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Task/TableSummary.php b/src/Task/TableSummary.php index 0230cf2e..e1b6674b 100644 --- a/src/Task/TableSummary.php +++ b/src/Task/TableSummary.php @@ -31,7 +31,7 @@ public function __invoke(array $usedTools) $failedTools = []; foreach ($usedTools as $tool) { list($isOk, $errorsCount) = $tool->analyzeResult(); - $totalErrors += $errorsCount; + $totalErrors += (int) $errorsCount; $table->addRow(array( "{$tool}", $tool->getAllowedErrorsCount(), From 5dcd78c825d098407231b0611f2bd56f97ebfbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Draho=C5=A1?= Date: Sat, 8 Oct 2016 09:45:08 +0200 Subject: [PATCH 4/4] Readme - symfony3, circle.ci integration (copying artifacts, global installation) --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index b02c8a4e..044529ba 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,23 @@ But I wouldn't recommend it. In my experience *one* QA tool which analyzes *N* projects is better than *N* projects with *N* analyzers. It's up to you how many repositories you want to update when new version is released. +##### Symfony3 components + +Do you have problems with dependencies +([symfony components](https://github.com/EdgedesignCZ/phpqa/issues/22), [phpcpd](https://github.com/EdgedesignCZ/phpqa/issues/19), ...)? +Check if you can [install phpqa globally](#circleci---artifacts--global-installation). +Or install dev-master versions of `sebastian/phpcpd` and `henrikbjorn/lurker`: + +``` +{ + "require-dev": { + "edgedesign/phpqa": "dev-master", + "henrikbjorn/lurker": "dev-master", + "sebastian/phpcpd": "dev-master" + } +} +``` + ### Docker ```bash @@ -272,6 +289,28 @@ public function ciPhpqa() phpqa --verbose --report --analyzedDir ./ --buildDir ./var/CI --ignoredDirs=bin,log,temp,var,vendor,www ``` +## Circle.ci - artifacts + global installation + +``` +machine: + php: + version: 7.0.4 + +dependencies: + cache_directories: + - ~/.composer/cache + post: + - 'git clone https://github.com/EdgedesignCZ/phpqa.git ./qa && cd qa && composer install --no-dev' + +test: + override: + - vendor/bin/phpunit --testdox-html ./var/tests/testdox.html --testdox-text ./var/tests/testdox.txt --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml + - qa/phpqa --report --verbose --buildDir var/QA --ignoredDirs vendor --tools=phpcs:0,phpmd:0,phpcpd:0,phploc,pdepend,phpmetrics + post: + - cp -r ./var/QA $CIRCLE_ARTIFACTS + - cp -r ./var/tests $CIRCLE_ARTIFACTS +``` + ## Contributing Contributions from others would be very much appreciated! Send