Skip to content

Commit 4f0c36e

Browse files
authored
Merge pull request #2372 from teohhanhui/tighten-cs-without-bc-breaks
Tighten CS without BC breaks
2 parents 903397f + f1fd1ce commit 4f0c36e

File tree

61 files changed

+90
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+90
-154
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
- *update-composer
8787
- run:
8888
name: Install PHP-CS-Fixer
89-
command: composer global require friendsofphp/php-cs-fixer:^2.12
89+
command: composer global require friendsofphp/php-cs-fixer:^2.13
9090
- *save-composer-cache-by-revision
9191
- *save-composer-cache-by-branch
9292
- run:

.php_cs.dist

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ return PhpCsFixer\Config::create()
2020
->setRiskyAllowed(true)
2121
->setRules([
2222
'@DoctrineAnnotation' => true,
23+
'@PHP71Migration' => true,
24+
'@PHP71Migration:risky' => true,
2325
'@PHPUnit60Migration:risky' => true,
2426
'@Symfony' => true,
2527
'@Symfony:risky' => true,
@@ -33,7 +35,7 @@ return PhpCsFixer\Config::create()
3335
'braces' => [
3436
'allow_single_line_closure' => true,
3537
],
36-
'declare_strict_types' => true,
38+
'compact_nullable_typehint' => true,
3739
'doctrine_annotation_array_assignment' => [
3840
'operator' => '=',
3941
],
@@ -45,11 +47,6 @@ return PhpCsFixer\Config::create()
4547
'header' => $header,
4648
'location' => 'after_open',
4749
],
48-
'native_function_invocation' => [
49-
'include' => [
50-
'@compiler_optimized',
51-
],
52-
],
5350
'no_extra_blank_lines' => [
5451
'tokens' => [
5552
'break',
@@ -74,11 +71,14 @@ return PhpCsFixer\Config::create()
7471
],
7572
'sortAlgorithm' => 'alpha',
7673
],
74+
'php_unit_method_casing' => [
75+
'case' => 'camel_case',
76+
],
7777
'phpdoc_order' => true,
78-
// 'simplified_null_return' => true,
78+
'phpdoc_trim_consecutive_blank_line_separation' => true,
7979
'strict_comparison' => true,
8080
'strict_param' => true,
81-
'ternary_to_null_coalescing' => true,
81+
'void_return' => false, // BC breaks; to be done in API Platform 3.0
8282
])
8383
->setFinder($finder)
8484
;

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ install:
99
- ps: Set-Service wuauserv -StartupType Manual
1010
- cinst -y php composer
1111
- refreshenv
12-
- cd c:\tools\php72
12+
- cd c:\tools\php73
1313
- copy php.ini-production php.ini /Y
1414
- echo date.timezone="UTC" >> php.ini
1515
- echo extension_dir=ext >> php.ini

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"webonyx/graphql-php": ">=0.13 <1.0"
6969
},
7070
"conflict": {
71+
"doctrine/common": "<2.7",
7172
"symfony/dependency-injection": "<3.4"
7273
},
7374
"suggest": {

src/Api/FilterLocatorTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ private function setFilterLocator($filterLocator = null, bool $allowNull = false
4848
/**
4949
* Gets a filter with a backward compatibility.
5050
*
51-
*
5251
* @return FilterInterface|null
5352
*/
5453
private function getFilter(string $filterId)

src/Api/IriConverterInterface.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ interface IriConverterInterface
2727
/**
2828
* Retrieves an item from its IRI.
2929
*
30-
*
3130
* @throws InvalidArgumentException
3231
* @throws ItemNotFoundException
3332
*
@@ -48,23 +47,20 @@ public function getIriFromItem($item, int $referenceType = UrlGeneratorInterface
4847
/**
4948
* Gets the IRI associated with the given resource collection.
5049
*
51-
*
5250
* @throws InvalidArgumentException
5351
*/
5452
public function getIriFromResourceClass(string $resourceClass, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;
5553

5654
/**
5755
* Gets the item IRI associated with the given resource.
5856
*
59-
*
6057
* @throws InvalidArgumentException
6158
*/
6259
public function getItemIriFromResourceClass(string $resourceClass, array $identifiers, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;
6360

6461
/**
6562
* Gets the IRI associated with the given resource subresource.
6663
*
67-
*
6864
* @throws InvalidArgumentException
6965
*/
7066
public function getSubresourceIriFromResourceClass(string $resourceClass, array $identifiers, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;

src/Api/OperationMethodResolverInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ interface OperationMethodResolverInterface
2525
/**
2626
* Resolves the uppercased HTTP method associated with a collection operation.
2727
*
28-
*
2928
* @throws RuntimeException
3029
*/
3130
public function getCollectionOperationMethod(string $resourceClass, string $operationName): string;
3231

3332
/**
3433
* Resolves the uppercased HTTP method associated with an item operation.
3534
*
36-
*
3735
* @throws RuntimeException
3836
*/
3937
public function getItemOperationMethod(string $resourceClass, string $operationName): string;

src/Api/ResourceClassResolverInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ interface ResourceClassResolverInterface
2525
/**
2626
* Guesses the associated resource.
2727
*
28-
*
2928
* @throws InvalidArgumentException
3029
*/
3130
public function getResourceClass($value, string $resourceClass = null, bool $strict = false): string;

src/Bridge/Doctrine/Common/DataPersister.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public function remove($data)
7878
/**
7979
* Gets the Doctrine object manager associated with given data.
8080
*
81-
*
8281
* @return DoctrineObjectManager|null
8382
*/
8483
private function getManager($data)

src/Bridge/Doctrine/EventListener/PurgeHttpCacheListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private function addTagsFor($value)
133133
return;
134134
}
135135

136-
if (!\is_array($value) && !$value instanceof \Traversable) {
136+
if (!is_iterable($value)) {
137137
$this->addTagForItem($value);
138138

139139
return;

0 commit comments

Comments
 (0)