Upgrade to PHP-CS-Fixer 2.1

This commit is contained in:
Adrien Crivelli 2017-02-25 17:38:18 +09:00
parent f7e1aa3c41
commit 13472e8247
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
2 changed files with 175 additions and 76 deletions

View File

@ -34,6 +34,7 @@ return PhpCsFixer\Config::create()
'hash_to_slash_comment' => true,
'header_comment' => false, // We don't use common header in all our files
'heredoc_to_nowdoc' => false, // Not sure about this one
'is_null' => false, // Risky
'include' => true,
'indentation_type' => true,
'line_ending' => true,
@ -46,6 +47,7 @@ return PhpCsFixer\Config::create()
'method_separation' => true,
'modernize_types_casting' => true,
'native_function_casing' => true,
'native_function_invocation'=> false, // This is risky and seems to be micro-optimization that make code uglier so not worth it, at least for now
'new_with_braces' => true,
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
@ -88,7 +90,7 @@ return PhpCsFixer\Config::create()
'php_unit_construct' => true,
'php_unit_dedicate_assert' => true,
'php_unit_fqcn_annotation' => true,
'php_unit_strict' => false, // We sometime actually need assertEquals 'phpdoc_align' => false, // Waste of time
'php_unit_strict' => false, // We sometime actually need assertEquals
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_align' => false, // Waste of time
'phpdoc_annotation_without_dot' => true,
@ -98,7 +100,9 @@ return PhpCsFixer\Config::create()
'phpdoc_no_alias_tag' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
@ -132,6 +136,7 @@ return PhpCsFixer\Config::create()
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_operator_spaces' => true,
'ternary_to_null_coalescing' => false, // Cannot use that with PHP 5.6
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,

244
composer.lock generated
View File

@ -125,16 +125,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v2.0.0",
"version": "v2.1.0",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
"reference": "f3baf72eb2f58bf275b372540f5b47d25aed910f"
"reference": "2c69f4d424f85062fe40f7689797d6d32c76b711"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/f3baf72eb2f58bf275b372540f5b47d25aed910f",
"reference": "f3baf72eb2f58bf275b372540f5b47d25aed910f",
"url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/2c69f4d424f85062fe40f7689797d6d32c76b711",
"reference": "2c69f4d424f85062fe40f7689797d6d32c76b711",
"shasum": ""
},
"require": {
@ -146,6 +146,7 @@
"symfony/filesystem": "^2.4 || ^3.0",
"symfony/finder": "^2.2 || ^3.0",
"symfony/polyfill-php54": "^1.0",
"symfony/polyfill-php55": "^1.3",
"symfony/process": "^2.3 || ^3.0",
"symfony/stopwatch": "^2.5 || ^3.0"
},
@ -161,11 +162,6 @@
"php-cs-fixer"
],
"type": "application",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"PhpCsFixer\\": "src/"
@ -186,7 +182,49 @@
}
],
"description": "A tool to automatically fix PHP code style",
"time": "2016-12-01T06:18:06+00:00"
"time": "2017-02-10T15:37:50+00:00"
},
{
"name": "ircmaxell/password-compat",
"version": "v1.0.4",
"source": {
"type": "git",
"url": "https://github.com/ircmaxell/password_compat.git",
"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c",
"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c",
"shasum": ""
},
"require-dev": {
"phpunit/phpunit": "4.*"
},
"type": "library",
"autoload": {
"files": [
"lib/password.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Anthony Ferrara",
"email": "ircmaxell@php.net",
"homepage": "http://blog.ircmaxell.com"
}
],
"description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash",
"homepage": "https://github.com/ircmaxell/password_compat",
"keywords": [
"hashing",
"password"
],
"time": "2014-11-20T16:49:30+00:00"
},
{
"name": "mpdf/mpdf",
@ -241,16 +279,16 @@
},
{
"name": "myclabs/deep-copy",
"version": "1.5.5",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108"
"reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/399c1f9781e222f6eb6cc238796f5200d1b7f108",
"reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe",
"reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe",
"shasum": ""
},
"require": {
@ -279,7 +317,7 @@
"object",
"object graph"
],
"time": "2016-10-31T17:19:45+00:00"
"time": "2017-01-26T22:05:40+00:00"
},
{
"name": "phenx/php-font-lib",
@ -566,23 +604,23 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "4.0.5",
"version": "4.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "c19cfc7cbb0e9338d8c469c7eedecc2a428b0971"
"reference": "ca060f645beeddebedb1885c97bf163e93264c35"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c19cfc7cbb0e9338d8c469c7eedecc2a428b0971",
"reference": "c19cfc7cbb0e9338d8c469c7eedecc2a428b0971",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca060f645beeddebedb1885c97bf163e93264c35",
"reference": "ca060f645beeddebedb1885c97bf163e93264c35",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0",
"phpunit/php-file-iterator": "~1.3",
"phpunit/php-text-template": "~1.2",
"phpunit/php-token-stream": "^1.4.2",
"phpunit/php-token-stream": "^1.4.2 || ^2.0",
"sebastian/code-unit-reverse-lookup": "~1.0",
"sebastian/environment": "^1.3.2 || ^2.0",
"sebastian/version": "~1.0|~2.0"
@ -625,7 +663,7 @@
"testing",
"xunit"
],
"time": "2017-01-20T15:06:43+00:00"
"time": "2017-02-23T07:38:02+00:00"
},
{
"name": "phpunit/php-file-iterator",
@ -761,16 +799,16 @@
},
{
"name": "phpunit/php-token-stream",
"version": "1.4.9",
"version": "1.4.10",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "3b402f65a4cc90abf6e1104e388b896ce209631b"
"reference": "284fb0679dd25fb5ffb56dad92c72860c0a22f1b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b",
"reference": "3b402f65a4cc90abf6e1104e388b896ce209631b",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/284fb0679dd25fb5ffb56dad92c72860c0a22f1b",
"reference": "284fb0679dd25fb5ffb56dad92c72860c0a22f1b",
"shasum": ""
},
"require": {
@ -806,20 +844,20 @@
"keywords": [
"tokenizer"
],
"time": "2016-11-15T14:06:22+00:00"
"time": "2017-02-23T06:14:45+00:00"
},
{
"name": "phpunit/phpunit",
"version": "5.7.6",
"version": "5.7.14",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "caf8141b89691498d91aaac6c82e9cd5f685ae86"
"reference": "4906b8faf23e42612182fd212eb6f4c0f2954b57"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/caf8141b89691498d91aaac6c82e9cd5f685ae86",
"reference": "caf8141b89691498d91aaac6c82e9cd5f685ae86",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4906b8faf23e42612182fd212eb6f4c0f2954b57",
"reference": "4906b8faf23e42612182fd212eb6f4c0f2954b57",
"shasum": ""
},
"require": {
@ -836,14 +874,14 @@
"phpunit/php-text-template": "~1.2",
"phpunit/php-timer": "^1.0.6",
"phpunit/phpunit-mock-objects": "^3.2",
"sebastian/comparator": "~1.2.2",
"sebastian/comparator": "^1.2.4",
"sebastian/diff": "~1.2",
"sebastian/environment": "^1.3.4 || ^2.0",
"sebastian/exporter": "~2.0",
"sebastian/global-state": "^1.0 || ^2.0",
"sebastian/global-state": "^1.1",
"sebastian/object-enumerator": "~2.0",
"sebastian/resource-operations": "~1.0",
"sebastian/version": "~1.0|~2.0",
"sebastian/version": "~1.0.3|~2.0",
"symfony/yaml": "~2.1|~3.0"
},
"conflict": {
@ -888,7 +926,7 @@
"testing",
"xunit"
],
"time": "2017-01-22T08:39:59+00:00"
"time": "2017-02-19T07:22:16+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
@ -1084,16 +1122,16 @@
},
{
"name": "sebastian/comparator",
"version": "1.2.2",
"version": "1.2.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f"
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f",
"reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"shasum": ""
},
"require": {
@ -1144,7 +1182,7 @@
"compare",
"equality"
],
"time": "2016-11-19T09:18:40+00:00"
"time": "2017-01-29T09:50:25+00:00"
},
{
"name": "sebastian/diff",
@ -1368,16 +1406,16 @@
},
{
"name": "sebastian/object-enumerator",
"version": "2.0.0",
"version": "2.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
"reference": "96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35"
"reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35",
"reference": "96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
"reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
"shasum": ""
},
"require": {
@ -1410,7 +1448,7 @@
],
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"time": "2016-11-19T07:35:10+00:00"
"time": "2017-02-18T15:18:39+00:00"
},
{
"name": "sebastian/recursion-context",
@ -1601,16 +1639,16 @@
},
{
"name": "squizlabs/php_codesniffer",
"version": "2.7.1",
"version": "2.8.0",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "9b324f3a1132459a7274a0ace2e1b766ba80930f"
"reference": "86dd55a522238211f9f3631e3361703578941d9a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9b324f3a1132459a7274a0ace2e1b766ba80930f",
"reference": "9b324f3a1132459a7274a0ace2e1b766ba80930f",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/86dd55a522238211f9f3631e3361703578941d9a",
"reference": "86dd55a522238211f9f3631e3361703578941d9a",
"shasum": ""
},
"require": {
@ -1675,20 +1713,20 @@
"phpcs",
"standards"
],
"time": "2016-11-30T04:02:31+00:00"
"time": "2017-02-02T03:30:00+00:00"
},
{
"name": "symfony/console",
"version": "v3.2.2",
"version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "4f9e449e76996adf310498a8ca955c6deebe29dd"
"reference": "0e5e6899f82230fcb1153bcaf0e106ffaa44b870"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/4f9e449e76996adf310498a8ca955c6deebe29dd",
"reference": "4f9e449e76996adf310498a8ca955c6deebe29dd",
"url": "https://api.github.com/repos/symfony/console/zipball/0e5e6899f82230fcb1153bcaf0e106ffaa44b870",
"reference": "0e5e6899f82230fcb1153bcaf0e106ffaa44b870",
"shasum": ""
},
"require": {
@ -1738,20 +1776,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2017-01-08T20:47:33+00:00"
"time": "2017-02-16T14:07:22+00:00"
},
{
"name": "symfony/debug",
"version": "v3.2.2",
"version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "810ba5c1c5352a4ddb15d4719e8936751dff0b05"
"reference": "9b98854cb45bc59d100b7d4cc4cf9e05f21026b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/810ba5c1c5352a4ddb15d4719e8936751dff0b05",
"reference": "810ba5c1c5352a4ddb15d4719e8936751dff0b05",
"url": "https://api.github.com/repos/symfony/debug/zipball/9b98854cb45bc59d100b7d4cc4cf9e05f21026b9",
"reference": "9b98854cb45bc59d100b7d4cc4cf9e05f21026b9",
"shasum": ""
},
"require": {
@ -1795,11 +1833,11 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2017-01-02T20:32:22+00:00"
"time": "2017-02-16T16:34:18+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v3.2.2",
"version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
@ -1859,7 +1897,7 @@
},
{
"name": "symfony/filesystem",
"version": "v3.2.2",
"version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
@ -1908,7 +1946,7 @@
},
{
"name": "symfony/finder",
"version": "v3.2.2",
"version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
@ -2073,17 +2111,73 @@
"time": "2016-11-14T01:06:16+00:00"
},
{
"name": "symfony/process",
"version": "v3.2.2",
"name": "symfony/polyfill-php55",
"version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "350e810019fc52dd06ae844b6a6d382f8a0e8893"
"url": "https://github.com/symfony/polyfill-php55.git",
"reference": "03e3f0350bca2220e3623a0e340eef194405fc67"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/350e810019fc52dd06ae844b6a6d382f8a0e8893",
"reference": "350e810019fc52dd06ae844b6a6d382f8a0e8893",
"url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/03e3f0350bca2220e3623a0e340eef194405fc67",
"reference": "03e3f0350bca2220e3623a0e340eef194405fc67",
"shasum": ""
},
"require": {
"ircmaxell/password-compat": "~1.0",
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php55\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"time": "2016-11-14T01:06:16+00:00"
},
{
"name": "symfony/process",
"version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856",
"reference": "0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856",
"shasum": ""
},
"require": {
@ -2119,11 +2213,11 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2017-01-02T20:32:22+00:00"
"time": "2017-02-16T14:07:22+00:00"
},
{
"name": "symfony/stopwatch",
"version": "v3.2.2",
"version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
@ -2172,16 +2266,16 @@
},
{
"name": "symfony/yaml",
"version": "v3.2.2",
"version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "50eadbd7926e31842893c957eca362b21592a97d"
"reference": "9724c684646fcb5387d579b4bfaa63ee0b0c64c8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/50eadbd7926e31842893c957eca362b21592a97d",
"reference": "50eadbd7926e31842893c957eca362b21592a97d",
"url": "https://api.github.com/repos/symfony/yaml/zipball/9724c684646fcb5387d579b4bfaa63ee0b0c64c8",
"reference": "9724c684646fcb5387d579b4bfaa63ee0b0c64c8",
"shasum": ""
},
"require": {
@ -2223,7 +2317,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2017-01-03T13:51:32+00:00"
"time": "2017-02-16T22:46:52+00:00"
},
{
"name": "tecnickcom/tcpdf",