summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json17
-rw-r--r--php-cs-fixer-autoload.patch16
-rw-r--r--php-cs-fixer-autoload.php13
-rw-r--r--php-cs-fixer.spec80
4 files changed, 88 insertions, 38 deletions
diff --git a/composer.json b/composer.json
index fa6da1d..1df3181 100644
--- a/composer.json
+++ b/composer.json
@@ -15,12 +15,14 @@
],
"require": {
"php": "^5.3.6 || >=7.0 <7.2",
+ "doctrine/annotations": "^1.2",
"ext-tokenizer": "*",
"sebastian/diff": "^1.1",
- "symfony/console": "^2.3 || ^3.0",
+ "symfony/console": "^2.4 || ^3.0",
"symfony/event-dispatcher": "^2.1 || ^3.0",
"symfony/filesystem": "^2.4 || ^3.0",
"symfony/finder": "^2.2 || ^3.0",
+ "symfony/options-resolver": "^2.6 || ^3.0",
"symfony/polyfill-php54": "^1.0",
"symfony/polyfill-php55": "^1.3",
"symfony/polyfill-php70": "^1.0",
@@ -33,15 +35,15 @@
"justinrainbow/json-schema": "^5.0",
"phpunit/phpunit": "^4.5 || ^5.0",
"satooshi/php-coveralls": "^1.0",
- "symfony/phpunit-bridge": "^3.2"
+ "symfony/phpunit-bridge": "^3.2.2"
},
"suggest": {
- "ext-mbstring": "For handling non-UTF8 characters in cache singature.",
+ "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."
},
"conflict": {
- "hhvm": "<3.9"
+ "hhvm": "<3.18"
},
"config": {
"sort-packages": true
@@ -52,5 +54,10 @@
"autoload-dev": {
"psr-4": { "PhpCsFixer\\Tests\\": "tests/" }
},
- "bin": ["php-cs-fixer"]
+ "bin": ["php-cs-fixer"],
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.2-dev"
+ }
+ }
}
diff --git a/php-cs-fixer-autoload.patch b/php-cs-fixer-autoload.patch
index 0717c97..b3202a2 100644
--- a/php-cs-fixer-autoload.patch
+++ b/php-cs-fixer-autoload.patch
@@ -1,7 +1,7 @@
diff -up ./php-cs-fixer.rpm ./php-cs-fixer
---- ./php-cs-fixer.rpm 2017-02-09 09:20:40.000000000 +0100
-+++ ./php-cs-fixer 2017-02-09 09:22:43.400071075 +0100
-@@ -32,12 +32,7 @@ set_error_handler(function ($severity, $
+--- ./php-cs-fixer.rpm 2017-04-01 08:35:52.000000000 +0200
++++ ./php-cs-fixer 2017-04-01 08:48:58.016723873 +0200
+@@ -42,12 +42,7 @@ set_error_handler(function ($severity, $
}
});
@@ -15,13 +15,13 @@ diff -up ./php-cs-fixer.rpm ./php-cs-fixer
use PhpCsFixer\Console\Application;
-diff -up ./tests/ProjectCodeTest.php.rpm ./tests/ProjectCodeTest.php
---- ./tests/ProjectCodeTest.php.rpm 2017-02-09 09:44:35.627516496 +0100
-+++ ./tests/ProjectCodeTest.php 2017-02-09 09:44:39.935537666 +0100
-@@ -234,6 +234,7 @@ final class ProjectCodeTest extends \PHP
+diff -up ./tests/AutoReview/ProjectCodeTest.php.rpm ./tests/AutoReview/ProjectCodeTest.php
+--- ./tests/AutoReview/ProjectCodeTest.php.rpm 2017-04-01 08:50:31.217299123 +0200
++++ ./tests/AutoReview/ProjectCodeTest.php 2017-04-01 08:51:10.127539283 +0200
+@@ -314,6 +314,7 @@ final class ProjectCodeTest extends \PHP
->files()
->name('*.php')
- ->in(__DIR__.'/../src')
+ ->in(__DIR__.'/../../src')
+ ->notName('autoload.php')
->exclude(array(
'Resources',
diff --git a/php-cs-fixer-autoload.php b/php-cs-fixer-autoload.php
deleted file mode 100644
index 8f11222..0000000
--- a/php-cs-fixer-autoload.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-/* Autoloader for friendsofphp/php-cs-fixer and its dependencies */
-
-require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
-
-\Fedora\Autoloader\Autoload::addPsr4('PhpCsFixer\\', __DIR__);
-
-\Fedora\Autoloader\Dependencies::required(array(
- '/usr/share/php/Symfony/Component/autoload.php',
- '/usr/share/php/SebastianBergmann/Diff/autoload.php',
- '/usr/share/php/Symfony/Polyfill/autoload.php',
-));
-
diff --git a/php-cs-fixer.spec b/php-cs-fixer.spec
index 942a630..4e3a8b2 100644
--- a/php-cs-fixer.spec
+++ b/php-cs-fixer.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit d30ca69f8bed931b5c630407f0a98306e33c2c39
+%global gh_commit d6f17423412d33df6b69c9aaf12037b91703533b
%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.1.3
+Version: 2.2.0
Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist}
Summary: A tool to automatically fix PHP code style
@@ -25,7 +25,6 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
# git snapshot to get upstream test suite
Source0: %{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
-Source2: %{name}-autoload.php
# Use our autoloader
Patch0: %{name}-autoload.patch
@@ -35,14 +34,27 @@ BuildArch: noarch
# For tests
BuildRequires: php(language) >= 5.4
BuildRequires: php-tokenizer
-BuildRequires: php-composer(symfony/console) >= 2.3
+BuildRequires: php-composer(doctrine/annotations) < 2
+BuildRequires: php-composer(doctrine/annotations) >= 1.2
+BuildRequires: php-composer(symfony/console) < 4
+BuildRequires: php-composer(symfony/console) >= 2.4
+BuildRequires: php-composer(symfony/event-dispatcher) < 4
BuildRequires: php-composer(symfony/event-dispatcher) >= 2.1
+BuildRequires: php-composer(symfony/filesystem) < 4
BuildRequires: php-composer(symfony/filesystem) >= 2.4
+BuildRequires: php-composer(symfony/finder) < 4
BuildRequires: php-composer(symfony/finder) >= 2.4
+BuildRequires: php-composer(symfony/options-resolver) < 4
+BuildRequires: php-composer(symfony/options-resolver) >= 2.6
+BuildRequires: php-composer(symfony/polyfill-php55) < 4
BuildRequires: php-composer(symfony/polyfill-php55) >= 1.3
+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) >= 2.3
+BuildRequires: php-composer(symfony/stopwatch) < 4
BuildRequires: php-composer(symfony/stopwatch) >= 2.5
+BuildRequires: php-composer(sebastian/diff) < 2
BuildRequires: php-composer(sebastian/diff) >= 1.1
BuildRequires: php-mbstring
BuildRequires: php-xml
@@ -59,7 +71,9 @@ BuildRequires: php-xml
# "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
+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)
@@ -69,12 +83,14 @@ BuildRequires: php-composer(fedora/autoloader)
# From composer.json, "require": {
# "php": "^5.3.6 || >=7.0 <7.2",
+# "doctrine/annotations": "^1.2",
# "ext-tokenizer": "*",
# "sebastian/diff": "^1.1",
-# "symfony/console": "^2.3 || ^3.0",
+# "symfony/console": "^2.4 || ^3.0",
# "symfony/event-dispatcher": "^2.1 || ^3.0",
# "symfony/filesystem": "^2.4 || ^3.0",
# "symfony/finder": "^2.2 || ^3.0",
+# "symfony/options-resolver": "^2.6 || ^3.0",
# "symfony/polyfill-php54": "^1.0",
# "symfony/polyfill-php55": "^1.3",
# "symfony/polyfill-php70": "^1.0",
@@ -84,17 +100,30 @@ BuildRequires: php-composer(fedora/autoloader)
# use 5.4 to avoid polyfill
Requires: php(language) >= 5.4
Requires: php-tokenizer
+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.1
-Requires: php-composer(symfony/console) >= 2.3
+Requires: php-composer(symfony/console) < 4
+Requires: php-composer(symfony/console) >= 2.4
+Requires: php-composer(symfony/event-dispatcher) < 4
Requires: php-composer(symfony/event-dispatcher) >= 2.1
+Requires: php-composer(symfony/filesystem) < 4
Requires: php-composer(symfony/filesystem) >= 2.4
+Requires: php-composer(symfony/finder) < 4
Requires: php-composer(symfony/finder) >= 2.4
+Requires: php-composer(symfony/options-resolver) < 4
+Requires: php-composer(symfony/options-resolver) >= 2.6
+Requires: php-composer(symfony/polyfill-php55) < 2
Requires: php-composer(symfony/polyfill-php55) >= 1.3
+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) >= 2.3
+Requires: php-composer(symfony/stopwatch) < 4
Requires: php-composer(symfony/stopwatch) >= 2.5
# From composer.json, "suggest": {
-# "ext-mbstring": "For handling non-UTF8 characters in cache singature.",
+# "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
@@ -127,7 +156,22 @@ 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
-cp %{SOURCE2} src/autoload.php
+cat << 'EOF' | tee src/autoload.php
+<?php
+/* Autoloader for %{name} and its dependencies */
+
+require_once '%{php_home}/Fedora/Autoloader/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('PhpCsFixer\\', __DIR__);
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Doctrine/Common/Annotations/autoload.php',
+ [
+ '%{php_home}/Symfony3/Component/autoload.php',
+ '%{php_home}/Symfony/Component/autoload.php',
+ ],
+ '%{php_home}/SebastianBergmann/Diff/autoload.php',
+ '%{php_home}/Symfony/Polyfill/autoload.php',
+]);
+EOF
%build
@@ -148,10 +192,15 @@ install -Dpm755 %{name} %{buildroot}%{_bindir}/%{name}
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
-require_once '%{php_home}/GeckoPackages/PHPUnit/autoload.php';
-require_once '%{php_home}/Symfony/Bridge/PhpUnit/autoload.php';
-require_once '%{php_home}/JsonSchema5/autoload.php';
-require_once '%{buildroot}%{php_home}/PhpCsFixer/autoload.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',
+ ],
+ '%{php_home}/JsonSchema5/autoload.php',
+ '%{buildroot}%{php_home}/PhpCsFixer/autoload.php',
+]);
\Fedora\Autoloader\Autoload::addPsr4('PhpCsFixer\\Tests\\', dirname(__DIR__) . '/tests');
EOF
@@ -192,6 +241,13 @@ exit $ret
%changelog
+* Sat Apr 1 2017 Remi Collet <remi@remirepo.net> - 2.2.0-1
+- Update to 2.2.0
+- add dependency on doctrine/annotations
+- add dependency on symfony/options-resolver
+- raise dependency on symfony 2.6
+- fix autoloader to allow Symfony 3
+
* Fri Mar 31 2017 Remi Collet <remi@remirepo.net> - 2.1.3-1
- Update to 2.1.3
- add dependency on php-mbstring