diff --git a/.gitignore b/.gitignore index f018da2..ef9da0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,19 @@ clog -/php-cs-fixer-2.2.*.tgz -/php-cs-fixer-2.3.1-d5257f7.tgz +/php-cs-fixer-2.2.3-8f33cf3.tgz +/php-cs-fixer-2.2.4-5191e01.tgz +/php-cs-fixer-2.2.5-27c2cd9.tgz +/php-cs-fixer-2.2.6-c1cc52c.tgz +/php-cs-fixer-2.2.7-b6202cc.tgz +/php-cs-fixer-2.2.8-aca23e7.tgz +/php-cs-fixer-2.2.9-eace538.tgz +/php-cs-fixer-2.2.10-b0e0f1d.tgz +/php-cs-fixer-2.2.11-11937d6.tgz +/php-cs-fixer-2.2.12-362ad63.tgz +/php-cs-fixer-2.2.13-669e232.tgz +/php-cs-fixer-2.2.14-dcf6443.tgz +/php-cs-fixer-2.2.16-f67918e.tgz +/php-cs-fixer-2.2.17-12f95d2.tgz +/php-cs-fixer-2.2.18-44f73c3.tgz +/php-cs-fixer-2.2.19-2de0ac9.tgz +/php-cs-fixer-2.2.20-f1631f0.tgz +/php-cs-fixer-diff-1.3.0-78bb099.tgz diff --git a/php-cs-fixer-autoload.patch b/php-cs-fixer-autoload.patch index eaf2d30..3f49bd0 100644 --- a/php-cs-fixer-autoload.patch +++ b/php-cs-fixer-autoload.patch @@ -1,28 +1,56 @@ diff -up ./php-cs-fixer.rpm ./php-cs-fixer ---- ./php-cs-fixer.rpm 2017-05-09 07:05:56.000000000 +0200 -+++ ./php-cs-fixer 2017-05-09 07:15:40.115301425 +0200 -@@ -42,12 +42,7 @@ set_error_handler(function ($severity, $ +--- ./php-cs-fixer.rpm 2018-06-04 06:51:21.280620624 +0200 ++++ ./php-cs-fixer 2018-06-04 06:52:49.363239929 +0200 +@@ -41,25 +41,7 @@ set_error_handler(function ($severity, $ } }); --// installed via composer? --if (file_exists($a = __DIR__.'/../../autoload.php')) { -- require_once $a; --} else { -- require_once __DIR__.'/vendor/autoload.php'; +-$require = true; +-if (class_exists('Phar')) { +- // Maybe this file is used as phar-stub? Let's try! +- try { +- Phar::mapPhar('php-cs-fixer.phar'); +- require_once 'phar://php-cs-fixer.phar/vendor/autoload.php'; +- $require = false; +- } catch (PharException $e) { +- } -} +-if ($require) { +- // OK, it's not, let give Composer autoloader a try! +- if (file_exists($a = __DIR__.'/../../autoload.php')) { +- require_once $a; +- } else { +- require_once __DIR__.'/vendor/autoload.php'; +- } +-} +-unset($require); +require_once '/usr/share/php/PhpCsFixer/autoload.php'; + use Composer\XdebugHandler\XdebugHandler; use PhpCsFixer\Console\Application; +diff -up ./src/Console/Command/HelpCommand.php.rpm ./src/Console/Command/HelpCommand.php +--- ./src/Console/Command/HelpCommand.php.rpm 2018-06-04 06:44:11.000000000 +0200 ++++ ./src/Console/Command/HelpCommand.php 2018-06-04 06:51:21.280620624 +0200 +@@ -358,6 +358,8 @@ EOF + { + static $version = null; ++ return Application::VERSION; ++ + if (null !== $version) { + return $version; + } diff -up ./tests/AutoReview/ProjectCodeTest.php.rpm ./tests/AutoReview/ProjectCodeTest.php ---- ./tests/AutoReview/ProjectCodeTest.php.rpm 2017-05-09 07:15:40.116301430 +0200 -+++ ./tests/AutoReview/ProjectCodeTest.php 2017-05-09 07:17:15.735775739 +0200 -@@ -314,6 +314,7 @@ final class ProjectCodeTest extends \PHP +--- ./tests/AutoReview/ProjectCodeTest.php.rpm 2018-06-04 06:44:11.000000000 +0200 ++++ ./tests/AutoReview/ProjectCodeTest.php 2018-06-04 06:51:21.280620624 +0200 +@@ -422,8 +422,10 @@ final class ProjectCodeTest extends Test ->files() ->name('*.php') ->in(__DIR__.'/../../src') + ->notName('autoload.php') - ->exclude([ + ->exclude(array( 'Resources', - ]) ++ 'tests', + )) + ; + diff --git a/php-cs-fixer.spec b/php-cs-fixer.spec index c8b7bf0..8dc6dba 100644 --- a/php-cs-fixer.spec +++ b/php-cs-fixer.spec @@ -1,12 +1,12 @@ # remirepo/fedora spec file for php-cs-fixer # -# Copyright (c) 2016-2017 Remi Collet +# Copyright (c) 2016-2018 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # -%global gh_commit d5257f7433bb490299c4f300d95598fd911a8ab0 +%global gh_commit f1631f0747ad2a9dd3de8d7873b71f6573f8d0c2 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) #global gh_date 20150717 %global gh_owner FriendsOfPHP @@ -15,11 +15,10 @@ %global with_tests 0%{!?_without_tests:1} Name: php-cs-fixer -Version: 2.3.1 +Version: 2.2.20 Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist} Summary: A tool to automatically fix PHP code style -Group: Development/Tools License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} # git snapshot to get upstream test suite @@ -34,24 +33,25 @@ BuildArch: noarch # For tests BuildRequires: php(language) >= 5.4 BuildRequires: php-tokenizer +BuildRequires: php-composer(composer/semver) < 2 +BuildRequires: php-composer(composer/semver) >= 1.4 +BuildRequires: php-composer(composer/xdebug-handler) < 2 +BuildRequires: php-composer(composer/xdebug-handler) >= 1.0 BuildRequires: php-composer(doctrine/annotations) < 2 BuildRequires: php-composer(doctrine/annotations) >= 1.2 -BuildRequires: php-composer(symfony/console) < 4 -BuildRequires: php-composer(symfony/console) >= 3.0 -BuildRequires: php-composer(symfony/event-dispatcher) < 4 -BuildRequires: php-composer(symfony/event-dispatcher) >= 3.0 -BuildRequires: php-composer(symfony/filesystem) < 4 -BuildRequires: php-composer(symfony/filesystem) >= 3.0 -BuildRequires: php-composer(symfony/finder) < 4 -BuildRequires: php-composer(symfony/finder) >= 3.0 -BuildRequires: php-composer(symfony/options-resolver) < 4 -BuildRequires: php-composer(symfony/options-resolver) >= 3.0 -BuildRequires: php-composer(symfony/polyfill-php70) < 4 -BuildRequires: php-composer(symfony/polyfill-php70) >= 1.3 -BuildRequires: php-composer(symfony/process) < 4 -BuildRequires: php-composer(symfony/process) >= 3.0 -BuildRequires: php-composer(symfony/stopwatch) < 4 -BuildRequires: php-composer(symfony/stopwatch) >= 3.0 +BuildRequires: php-symfony-console +BuildRequires: php-symfony-event-dispatcher +BuildRequires: php-symfony-filesystem +BuildRequires: php-symfony-finder +BuildRequires: php-symfony-options-resolver +BuildRequires: php-composer(symfony/polyfill-php55) < 2 +BuildRequires: php-composer(symfony/polyfill-php55) >= 1.4 +BuildRequires: php-composer(symfony/polyfill-php70) < 2 +BuildRequires: php-composer(symfony/polyfill-php70) >= 1.4 +BuildRequires: php-composer(symfony/polyfill-php72) < 2 +BuildRequires: php-composer(symfony/polyfill-php72) >= 1.4 +BuildRequires: php-symfony-process +BuildRequires: php-symfony-stopwatch BuildRequires: php-composer(sebastian/diff) < 2 BuildRequires: php-composer(sebastian/diff) >= 1.4 BuildRequires: php-mbstring @@ -63,80 +63,83 @@ BuildRequires: php-pcre BuildRequires: php-phar BuildRequires: php-spl BuildRequires: php-xml -# Missing dependency for Console -BuildRequires: php-composer(symfony/debug) < 4 -BuildRequires: php-composer(symfony/debug) >= 3.0 # From composer.json, "require-dev": { -# "gecko-packages/gecko-php-unit": "^2.0", +# NOTICE: listener disabled +# "johnkary/phpunit-speedtrap": "^1.0.1 || ^2.0 || ^3.0", # "justinrainbow/json-schema": "^5.0", -# "phpunit/phpunit": "^4.5 || ^5.0", -# "satooshi/php-coveralls": "^1.0", -# "symfony/phpunit-bridge": "^3.2" -BuildRequires: php-composer(gecko-packages/gecko-php-unit) < 3 -BuildRequires: php-composer(gecko-packages/gecko-php-unit) >= 2.0 +# "keradus/cli-executor": "^1.1", +# "mikey179/vfsStream": "^1.6", +# "satooshi/php-coveralls": "^1.0.2", +# "phpunit/phpunit": "^4.8.35 || ^5.4.3", +# "symfony/phpunit-bridge": "^3.2 || ^4.0" BuildRequires: php-composer(justinrainbow/json-schema) < 6 BuildRequires: php-composer(justinrainbow/json-schema) >= 5 -BuildRequires: php-composer(phpunit/phpunit) >= 4.5 -BuildRequires: php-composer(symfony/phpunit-bridge) -# Autoloader -BuildRequires: php-composer(fedora/autoloader) +#BuildRequires: php-composer(keradus/cli-executor) < 2 +#BuildRequires: php-composer(keradus/cli-executor) >= 1 +BuildRequires: php-composer(mikey179/vfsStream) < 2 +BuildRequires: php-composer(mikey179/vfsStream) >= 1.6 +BuildRequires: php-composer(phpunit/phpunit) >= 4.8.35 +BuildRequires: php-symfony-phpunit-bridge %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer.json, "require": { -# "php": "^5.6 || >=7.0 <7.2", -# "doctrine/annotations": "^1.2", +# "php": "^5.3.6 || >=7.0 <7.3", +# "ext-json": "*", # "ext-tokenizer": "*", +# "composer/semver": "^1.4", +# "composer/xdebug-handler": "^1.0", +# "doctrine/annotations": "^1.2", # "sebastian/diff": "^1.4", -# "symfony/console": "^3.0", -# "symfony/event-dispatcher": "^3.0", -# "symfony/filesystem": "^3.0", -# "symfony/finder": "^3.0", -# "symfony/options-resolver": "^3.0", +# "symfony/console": "^2.4 || ^3.0", +# "symfony/event-dispatcher": "^2.1 || ^3.0 || ^4.0", +# "symfony/filesystem": "^2.4 || ^3.0 || ^4.0", +# "symfony/finder": "^2.2 || ^3.0 || ^4.0", +# "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0", # "symfony/polyfill-php54": "^1.0", # "symfony/polyfill-php55": "^1.3", # "symfony/polyfill-php70": "^1.0", -# "symfony/polyfill-xml": "^1.3", -# "symfony/process": "^3.0", -# "symfony/stopwatch": "^3.0" -Requires: php(language) >= 5.6 +# "symfony/polyfill-php72": "^1.4", +# "symfony/process": "^2.3 || ^3.0 || ^4.0", +# "symfony/stopwatch": "^2.5 || ^3.0 || ^4.0" +# use 5.4 to avoid polyfill +Requires: php(language) >= 5.4 +Requires: php-json Requires: php-tokenizer +Requires: php-composer(composer/semver) < 2 +Requires: php-composer(composer/semver) >= 1.4 +Requires: php-composer(composer/xdebug-handler) < 2 +Requires: php-composer(composer/xdebug-handler) >= 1.0 Requires: php-composer(doctrine/annotations) < 2 Requires: php-composer(doctrine/annotations) >= 1.2 Requires: php-composer(sebastian/diff) < 2 Requires: php-composer(sebastian/diff) >= 1.4 -Requires: php-composer(symfony/console) < 4 -Requires: php-composer(symfony/console) >= 3.0 -Requires: php-composer(symfony/event-dispatcher) < 4 -Requires: php-composer(symfony/event-dispatcher) >= 3.0 -Requires: php-composer(symfony/filesystem) < 4 -Requires: php-composer(symfony/filesystem) >= 3.0 -Requires: php-composer(symfony/finder) < 4 -Requires: php-composer(symfony/finder) >= 3.0 -Requires: php-composer(symfony/options-resolver) < 4 -Requires: php-composer(symfony/options-resolver) >= 3.0 +Requires: php-symfony-console +Requires: php-symfony-event-dispatcher +Requires: php-symfony-filesystem +Requires: php-symfony-finder +Requires: php-symfony-options-resolver +Requires: php-composer(symfony/polyfill-php55) < 2 +Requires: php-composer(symfony/polyfill-php55) >= 1.4 Requires: php-composer(symfony/polyfill-php70) < 2 -Requires: php-composer(symfony/polyfill-php70) >= 1.0 -Requires: php-composer(symfony/process) < 4 -Requires: php-composer(symfony/process) >= 3.0 -Requires: php-composer(symfony/stopwatch) < 4 -Requires: php-composer(symfony/stopwatch) >= 3.0 -# Missing dependency for Console -Requires: php-composer(symfony/debug) < 4 -Requires: php-composer(symfony/debug) >= 3.0 +Requires: php-composer(symfony/polyfill-php70) >= 1.4 +Requires: php-composer(symfony/polyfill-php72) < 2 +Requires: php-composer(symfony/polyfill-php72) >= 1.4 +Requires: php-symfony-process +Requires: php-symfony-stopwatch # From composer.json, "suggest": { # "ext-mbstring": "For handling non-UTF8 characters in cache signature.", -# "ext-xml": "For better performance.", # "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." Requires: php-mbstring -Requires: php-xml -# From phpcompatinfo report for version 2.0.0 +# From phpcompatinfo report for version 2.2.5 Requires: php-cli Requires: php-reflection Requires: php-dom -Requires: php-json Requires: php-pcre Requires: php-phar Requires: php-spl +Requires: php-xml # Autoloader Requires: php-composer(fedora/autoloader) @@ -157,21 +160,37 @@ projects. This tool does not only detect them, but also fixes them for you. %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p1 -b .rpm -cat << 'EOF' | tee src/autoload.php -phpunit.xml + +# Redirect to buildroot +sed -e 's:%{php_home}:%{buildroot}%{php_home}:' -i %{name} + +# see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/.travis.yml +VERID=$(php -r 'echo PHP_VERSION_ID;') +if [ $VERID -lt 50600 ]; then + export SKIP_LINT_TEST_CASES=1 +fi +if [ $VERID -lt 50500 ]; then + rm tests/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixerTest.php + rm tests/AutoReview/ProjectCodeTest.php +fi + +%{_bindir}/phpunit \ + -d memory_limit=2G \ + --filter '^((?!(testToJsonThrowsExceptionOnInvalid)).)*$' \ + --verbose %else : Test suite disabled %endif @@ -230,10 +267,59 @@ exit $ret %changelog -* Tue May 9 2017 Remi Collet - 2.3.1-1 -- Update to 2.3.1 -- raise dependency on PHP 5.6 -- raise dependency on Symfony 3 +* Mon Jun 4 2018 Remi Collet - 2.2.20-1 +- update to 2.2.20 +- add dependency on composer/xdebug-handler + +* Wed Mar 21 2018 Remi Collet - 2.2.19-1 +- update to 2.2.19 + +* Thu Mar 8 2018 Remi Collet - 2.2.18-1 +- update to 2.2.18 + +* Fri Feb 23 2018 Remi Collet - 2.2.17-1 +- Update to 2.2.17 +- drop dependency on gecko-packages/gecko-php-unit + +* Tue Feb 6 2018 Remi Collet - 2.2.16-1 +- Update to 2.2.16 + +* Thu Jan 11 2018 Remi Collet - 2.2.14-1 +- Update to 2.2.14 + +* Wed Dec 13 2017 Remi Collet - 2.2.13-1 +- Update to 2.2.13 + +* Mon Nov 27 2017 Remi Collet - 2.2.12-1 +- Update to 2.2.12 + +* Mon Nov 20 2017 Remi Collet - 2.2.11-1 +- Update to 2.2.11 + +* Fri Nov 10 2017 Remi Collet - 2.2.10-1 +- Update to 2.2.10 + +* Fri Nov 3 2017 Remi Collet - 2.2.9-1 +- Update to 2.2.9 + +* Mon Oct 2 2017 Remi Collet - 2.2.8-1 +- Update to 2.2.8 + +* Tue Sep 12 2017 Remi Collet - 2.2.7-1 +- Update to 2.2.7 +- add dependency on composer/semver + +* Wed Aug 23 2017 Remi Collet - 2.2.6-1 +- Update to 2.2.6 + +* Thu Aug 3 2017 Remi Collet - 2.2.5-1 +- add dependency on symfony/polyfill-php72 +- Update to 2.2.5 + +* Thu May 25 2017 Remi Collet - 2.2.4-1 +- Update to 2.2.4 +- add dependency on gecko-packages/gecko-php-unit +- only Symfony 2 * Wed Apr 26 2017 Remi Collet - 2.2.3-1 - Update to 2.2.3 diff --git a/sources b/sources index 4b38019..349eca1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-cs-fixer-2.3.1-d5257f7.tgz) = 0047785c228df0a0ae713e21293b9dc1aec174b035cbf65f2fc00a1a358d1127a85f67428570399677620bd8d7de2e7de05333be17c63d3ff4d2ce35d27ffec0 +SHA512 (php-cs-fixer-2.2.20-f1631f0.tgz) = 645f5f5f0f183b46180f51311e19286c99ce133434494e53702841a9d8a318c3b00986fdf27d9eac30510389e17b4431c05a8238ed0a8478548f4baee39e8afd