summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json12
-rw-r--r--php-cs-fixer-autoload.patch22
-rw-r--r--php-cs-fixer.spec44
3 files changed, 55 insertions, 23 deletions
diff --git a/composer.json b/composer.json
index 1e489a0..314ef9f 100644
--- a/composer.json
+++ b/composer.json
@@ -15,25 +15,27 @@
],
"require": {
"php": "^5.6 || >=7.0 <7.2",
- "doctrine/annotations": "^1.2",
+ "ext-json": "*",
"ext-tokenizer": "*",
+ "doctrine/annotations": "^1.2",
+ "gecko-packages/gecko-php-unit": "^2.0",
"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/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"
},
"require-dev": {
- "gecko-packages/gecko-php-unit": "^2.0",
+ "johnkary/phpunit-speedtrap": "^1.1",
"justinrainbow/json-schema": "^5.0",
- "phpunit/phpunit": "^4.5 || ^5.0",
+ "mi-schi/phpmd-extension": "^4.2",
+ "phpmd/phpmd": "^2.4.3",
+ "phpunit/phpunit": "^4.8.35 || ^5.4.3",
"satooshi/php-coveralls": "^1.0",
"symfony/phpunit-bridge": "^3.2.2"
},
diff --git a/php-cs-fixer-autoload.patch b/php-cs-fixer-autoload.patch
index eaf2d30..a2e31fd 100644
--- a/php-cs-fixer-autoload.patch
+++ b/php-cs-fixer-autoload.patch
@@ -1,6 +1,6 @@
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
+--- ./php-cs-fixer.rpm 2017-05-25 08:40:58.000000000 +0200
++++ ./php-cs-fixer 2017-05-25 08:44:03.319555699 +0200
@@ -42,12 +42,7 @@ set_error_handler(function ($severity, $
}
});
@@ -15,10 +15,22 @@ diff -up ./php-cs-fixer.rpm ./php-cs-fixer
use PhpCsFixer\Console\Application;
+diff -up ./src/Console/Command/HelpCommand.php.rpm ./src/Console/Command/HelpCommand.php
+--- ./src/Console/Command/HelpCommand.php.rpm 2017-05-25 08:45:34.935117875 +0200
++++ ./src/Console/Command/HelpCommand.php 2017-05-25 08:45:44.276175193 +0200
+@@ -338,6 +338,8 @@ EOF
+ return $version;
+ }
+
++ return Application::VERSION;
++
+ $currentMajor = (int) Application::VERSION;
+ $changelogFile = __DIR__.'/../../../CHANGELOG.md';
+ $changelog = @file_get_contents($changelogFile);
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 2017-05-25 08:40:58.000000000 +0200
++++ ./tests/AutoReview/ProjectCodeTest.php 2017-05-25 08:44:03.319555699 +0200
+@@ -316,6 +316,7 @@ final class ProjectCodeTest extends Test
->files()
->name('*.php')
->in(__DIR__.'/../../src')
diff --git a/php-cs-fixer.spec b/php-cs-fixer.spec
index c3b7d56..3a69da2 100644
--- a/php-cs-fixer.spec
+++ b/php-cs-fixer.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit d5257f7433bb490299c4f300d95598fd911a8ab0
+%global gh_commit 597745f744bcce1aed59dfd1bb4603de2a06cda9
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20150717
%global gh_owner FriendsOfPHP
@@ -15,7 +15,7 @@
%global with_tests 0%{!?_without_tests:1}
Name: php-cs-fixer
-Version: 2.3.1
+Version: 2.3.2
Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist}
Summary: A tool to automatically fix PHP code style
@@ -36,6 +36,8 @@ BuildRequires: php(language) >= 5.4
BuildRequires: php-tokenizer
BuildRequires: php-composer(doctrine/annotations) < 2
BuildRequires: php-composer(doctrine/annotations) >= 1.2
+BuildRequires: php-composer(gecko-packages/gecko-php-unit) < 3
+BuildRequires: php-composer(gecko-packages/gecko-php-unit) >= 2.0
BuildRequires: php-composer(symfony/console) < 4
BuildRequires: php-composer(symfony/console) >= 3.0
BuildRequires: php-composer(symfony/event-dispatcher) < 4
@@ -46,7 +48,7 @@ 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) < 2
BuildRequires: php-composer(symfony/polyfill-php70) >= 1.3
BuildRequires: php-composer(symfony/process) < 4
BuildRequires: php-composer(symfony/process) >= 3.0
@@ -67,13 +69,15 @@ BuildRequires: php-xml
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 during test suite
+# "johnkary/phpunit-speedtrap": "^1.1",
# "justinrainbow/json-schema": "^5.0",
-# "phpunit/phpunit": "^4.5 || ^5.0",
+# NOTICE: phpmd not used
+# "mi-schi/phpmd-extension": "^4.2",
+# "phpmd/phpmd": "^2.4.3",
+# "phpunit/phpunit": "^4.8.35 || ^5.4.3",
# "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
BuildRequires: php-composer(justinrainbow/json-schema) < 6
BuildRequires: php-composer(justinrainbow/json-schema) >= 5
BuildRequires: php-composer(phpunit/phpunit) >= 4.5
@@ -84,24 +88,27 @@ BuildRequires: php-composer(fedora/autoloader)
# From composer.json, "require": {
# "php": "^5.6 || >=7.0 <7.2",
-# "doctrine/annotations": "^1.2",
+# "ext-json": "*",
# "ext-tokenizer": "*",
+# "doctrine/annotations": "^1.2",
+# "gecko-packages/gecko-php-unit": "^2.0",
# "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/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
+Requires: php-json
Requires: php-tokenizer
Requires: php-composer(doctrine/annotations) < 2
Requires: php-composer(doctrine/annotations) >= 1.2
+Requires: php-composer(gecko-packages/gecko-php-unit) < 3
+Requires: php-composer(gecko-packages/gecko-php-unit) >= 2.0
Requires: php-composer(sebastian/diff) < 2
Requires: php-composer(sebastian/diff) >= 1.4
Requires: php-composer(symfony/console) < 4
@@ -133,7 +140,6 @@ Requires: php-xml
Requires: php-cli
Requires: php-reflection
Requires: php-dom
-Requires: php-json
Requires: php-pcre
Requires: php-phar
Requires: php-spl
@@ -156,6 +162,7 @@ projects. This tool does not only detect them, but also fixes them for you.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p1 -b .rpm
+find src -name \*rpm -delete -print
cat << 'EOF' | tee src/autoload.php
<?php
@@ -164,6 +171,7 @@ cat << 'EOF' | tee src/autoload.php
require_once '%{php_home}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('PhpCsFixer\\', __DIR__);
\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/GeckoPackages/PHPUnit/autoload.php',
'%{php_home}/Doctrine/Common/Annotations/autoload.php',
'%{php_home}/Symfony3/Component/Console/autoload.php',
'%{php_home}/Symfony3/Component/EventDispatcher/autoload.php',
@@ -197,7 +205,6 @@ mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
\Fedora\Autoloader\Dependencies::required([
- '%{php_home}/GeckoPackages/PHPUnit/autoload.php',
[
'%{php_home}/Symfony3/Bridge/PhpUnit/autoload.php',
'%{php_home}/Symfony/Bridge/PhpUnit/autoload.php',
@@ -208,8 +215,15 @@ cat << 'EOF' | tee vendor/autoload.php
\Fedora\Autoloader\Autoload::addPsr4('PhpCsFixer\\Tests\\', dirname(__DIR__) . '/tests');
EOF
+# Fix integration test
+sed -e "/README.rst/s:__DIR__.*':'$PWD/README.rst':" \
+ -i tests/Console/Command/ReadmeCommandTest.php
+
+# Disable listener
+sed -e 's/listeners/nolistener/' phpunit.xml.dist >phpunit.xml
+
ret=0
-for cmd in php php56 php70 php71; do
+for cmd in php php56 php70 php71 php72; do
if which $cmd; then
$cmd %{_bindir}/phpunit --verbose || ret=1
fi
@@ -230,6 +244,10 @@ exit $ret
%changelog
+* Thu May 25 2017 Remi Collet <remi@remirepo.net> - 2.3.2-1
+- Update to 2.3.2
+- add dependency on gecko-packages/gecko-php-unit
+
* Tue May 9 2017 Remi Collet <remi@remirepo.net> - 2.3.1-1
- Update to 2.3.1
- raise dependency on PHP 5.6