Skip to content

Commit 6ca30b6

Browse files
authored
Merge pull request #2381 from teohhanhui/merge-2.3
Merge 2.3 into master
2 parents b6898f3 + 7952567 commit 6ca30b6

File tree

65 files changed

+113
-161
lines changed

Some content is hidden

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

65 files changed

+113
-161
lines changed

.circleci/config.yml

Lines changed: 9 additions & 4 deletions
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:
@@ -124,7 +124,6 @@ jobs:
124124
- image: circleci/php:7.2-node-browsers
125125
environment:
126126
SYMFONY_DEPRECATIONS_HELPER: weak_vendors
127-
APP_ENV: test
128127
parallelism: 2
129128
working_directory: ~/api-platform/core
130129
steps:
@@ -141,8 +140,11 @@ jobs:
141140
- run:
142141
name: Run PHPUnit tests
143142
command: |-
144-
mkdir -p build/logs/tmp build/cov
145-
phpdbg -qrr vendor/bin/phpunit --coverage-php build/cov/coverage.cov --log-junit build/logs/tmp/coverage.xml --colors=always
143+
mkdir -p build/logs/parallel build/logs/tmp build/cov
144+
split_tests=$(find tests -name '*Test.php' -not -path 'tests/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php' | circleci tests split --split-by=timings)
145+
export PARALLEL='-j10% --joblog build/logs/parallel/jobs.log --rpl {_}\ s/\\//_/g;'
146+
phpunit_cmd='phpdbg -qrr vendor/bin/phpunit --coverage-php build/cov/coverage-{_}.cov --log-junit build/logs/tmp/{_}.xml --colors=always {}'
147+
echo "$split_tests" | parallel "$phpunit_cmd" || echo "$split_tests" | parallel --retry-failed "$phpunit_cmd"
146148
- run:
147149
name: Merge PHPUnit test reports
148150
command: |-
@@ -154,6 +156,9 @@ jobs:
154156
- store_artifacts:
155157
path: build/logs/phpunit/junit.xml
156158
destination: build/logs/phpunit/junit.xml
159+
- store_artifacts:
160+
path: build/logs/parallel/jobs.log
161+
destination: build/logs/parallel/jobs.log
157162
- persist_to_workspace:
158163
root: build
159164
paths:

.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
@@ -72,6 +72,7 @@
7272
"webonyx/graphql-php": ">=0.13 <1.0"
7373
},
7474
"conflict": {
75+
"doctrine/common": "<2.7",
7576
"symfony/dependency-injection": "<3.4"
7677
},
7778
"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)