Skip to content

Commit 345612c

Browse files
authored
Merge pull request #2638 from soyuka/merge
Merge 2.4 onto master
2 parents d0bde7e + 74bfbef commit 345612c

File tree

273 files changed

+2390
-1199
lines changed

Some content is hidden

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

273 files changed

+2390
-1199
lines changed

.circleci/config.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ reusable-steps:
3737
- php-cs-fixer-cache-{{ .Revision }}
3838
- php-cs-fixer-cache-{{ .Branch }}
3939
- php-cs-fixer-cache
40+
- &restore-phpstan-cache
41+
restore_cache:
42+
keys:
43+
- phpstan-cache-{{ .Revision }}
44+
- phpstan-cache-{{ .Branch }}
45+
- phpstan-cache
4046
- &save-composer-cache-by-branch
4147
save_cache:
4248
paths:
@@ -67,6 +73,16 @@ reusable-steps:
6773
paths:
6874
- .php_cs.cache
6975
key: php-cs-fixer-cache-{{ .Revision }}-{{ .BuildNum }}
76+
- &save-phpstan-cache-by-branch
77+
save_cache:
78+
paths:
79+
- /tmp/phpstan/cache
80+
key: phpstan-cache-{{ .Branch }}-{{ .BuildNum }}
81+
- &save-phpstan-cache-by-revision
82+
save_cache:
83+
paths:
84+
- /tmp/phpstan/cache
85+
key: phpstan-cache-{{ .Revision }}-{{ .BuildNum }}
7086
- &update-composer
7187
run:
7288
name: Update Composer
@@ -106,25 +122,27 @@ jobs:
106122
phpstan:
107123
docker:
108124
- image: circleci/php:7.2-node-browsers
125+
environment:
126+
# https://github.com/phpstan/phpstan-symfony/issues/37
127+
APP_DEBUG: 1
109128
working_directory: ~/api-platform/core
110129
steps:
111130
- checkout
112131
- *restore-composer-cache
132+
- *restore-phpstan-cache
113133
- *disable-xdebug-php-extension
114134
- *disable-php-memory-limit
115135
- *install-php-extensions
116136
- *update-composer
117137
- *update-project-dependencies
118-
- run:
119-
name: Install PHPStan
120-
command: composer global require phpstan/phpstan:0.10.5
121138
- *save-composer-cache-by-revision
122139
- *save-composer-cache-by-branch
140+
- *clear-test-app-cache
123141
- run:
124142
name: Run PHPStan
125-
command: |-
126-
export PATH="$PATH:$HOME/.composer/vendor/bin"
127-
phpstan analyse -c phpstan.neon -l6 --ansi src tests
143+
command: vendor/bin/phpstan analyse --ansi
144+
- *save-phpstan-cache-by-revision
145+
- *save-phpstan-cache-by-branch
128146

129147
phpunit-coverage:
130148
docker:

.editorconfig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ indent_size = 2
2626
[*.md]
2727
trim_trailing_whitespace = false
2828

29+
[*.neon]
30+
indent_style = tab
31+
indent_size = 4
32+
2933
[*.php]
3034
indent_style = space
3135
indent_size = 4
@@ -62,14 +66,18 @@ indent_size = 2
6266
indent_style = space
6367
indent_size = 2
6468

65-
[behat.yml]
69+
[behat.yml{,.dist}]
6670
indent_style = space
6771
indent_size = 2
6872

6973
[composer.json]
7074
indent_style = space
7175
indent_size = 4
7276

73-
[phpunit.xml.dist]
77+
[phpstan.neon{,.dist}]
78+
indent_style = tab
79+
indent_size = 4
80+
81+
[phpunit.xml{,.dist}]
7482
indent_style = space
7583
indent_size = 4

.php_cs.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ return PhpCsFixer\Config::create()
7878
'phpdoc_trim_consecutive_blank_line_separation' => true,
7979
'strict_comparison' => true,
8080
'strict_param' => true,
81+
'visibility_required' => [
82+
'elements' => [
83+
'const',
84+
'method',
85+
'property',
86+
],
87+
],
8188
'void_return' => false, // BC breaks; to be done in API Platform 3.0
8289
])
8390
->setFinder($finder)

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@
44

55
* GraphQL: Add support for custom types
66

7+
## 2.4.0
8+
9+
* Listeners are now opt-in when not handling API Platform operations
10+
* `DISTINCT` is not used when there are no joins
11+
* Preserve manual join in FilterEagerLoadingExtension
12+
* The `elasticsearch` attribute can be disabled resource-wise or per-operation
13+
* The `messenger` attribute can now take the `input` string as a value (`messenger="input"`). This will use a default transformer so that the given `input` is directly sent to the messenger handler.
14+
* The `messenger` attribute can be declared per-operation
15+
* Mercure updates are now published after the Doctrine flush event instead of on `kernel.terminate`, so the Mercure and the Messenger integration can be used together
16+
* Use Symfony's MetadataAwareNameConverter when available
17+
* Change the extension's priorities (`<0`) for improved compatibility with Symfony's autoconfiguration feature. If you have custom extensions we recommend to use positive priorities.
18+
19+
| Service name | Priority | Class |
20+
|------------------------------------------------------------|------|---------------------------------------------------------|
21+
| api_platform.doctrine.orm.query_extension.eager_loading (collection) | -8 | ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\EagerLoadingExtension |
22+
| api_platform.doctrine.orm.query_extension.eager_loading (item) | -8 | ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\EagerLoadingExtension |
23+
| api_platform.doctrine.orm.query_extension.filter | -16 | ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\FilterExtension |
24+
| api_platform.doctrine.orm.query_extension.filter_eager_loading | -17 | ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\FilterEagerLoadingExtension |
25+
| api_platform.doctrine.orm.query_extension.order | -32 | ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\OrderExtension |
26+
| api_platform.doctrine.orm.query_extension.pagination | -64 | ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\PaginationExtension |
27+
28+
* Fix JSON-LD contexts when using output classes
29+
* GraphQl: Fix pagination (the `endCursor` behavior was wrong)
30+
* GraphQl: Improve output/input behavior
31+
* GraphQl: Improve mutations (make the `clientMutationId` nullable and return mutation payload as an object)
32+
* MongoDB: Fix search filter when searching by related collection id
33+
* MongoDB: Fix numeric and range filters
34+
735
## 2.4.0 beta 2
836

937
* Fix version constraints for Doctrine MongoDB ODM

composer.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,20 @@
3939
"doctrine/mongodb-odm-bundle": "^4.0.0@beta",
4040
"doctrine/orm": "^2.6.3",
4141
"elasticsearch/elasticsearch": "^6.0",
42-
"friendsofsymfony/user-bundle": "dev-fix-mongodb-mapping",
42+
"friendsofsymfony/user-bundle": "^2.2@dev",
4343
"guzzlehttp/guzzle": "^6.0",
44+
"jangregor/phpstan-prophecy": "^0.3",
4445
"justinrainbow/json-schema": "^5.0",
4546
"nelmio/api-doc-bundle": "^2.13.3",
4647
"php-mock/php-mock-phpunit": "^2.0",
4748
"phpdocumentor/reflection-docblock": "^3.0 || ^4.0",
4849
"phpdocumentor/type-resolver": "^0.3 || ^0.4",
4950
"phpspec/prophecy": "^1.8",
50-
"phpunit/phpunit": "^7.5.4",
51+
"phpstan/phpstan": "^0.11.3",
52+
"phpstan/phpstan-doctrine": "^0.11.2",
53+
"phpstan/phpstan-phpunit": "^0.11",
54+
"phpstan/phpstan-symfony": "^0.11.2",
55+
"phpunit/phpunit": "^7.5.2",
5156
"psr/log": "^1.0",
5257
"ramsey/uuid": "^3.7",
5358
"ramsey/uuid-doctrine": "^1.4",
@@ -111,12 +116,5 @@
111116
},
112117
"config": {
113118
"sort-packages": true
114-
},
115-
"repositories": [
116-
{
117-
"type": "vcs",
118-
"url": "https://github.com/alanpoulain/FOSUserBundle",
119-
"no-api": true
120-
}
121-
]
119+
}
122120
}

features/bootstrap/DoctrineContext.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,17 +1202,17 @@ public function thereIsAMaxDepthDummyWithLevelOfDescendants(int $level)
12021202
}
12031203

12041204
/**
1205-
* @Given there is a DummyCustomDto
1205+
* @Given there is a DummyDtoCustom
12061206
*/
1207-
public function thereIsADummyCustomDto()
1207+
public function thereIsADummyDtoCustom()
12081208
{
1209-
$this->thereAreNbDummyCustomDto(1);
1209+
$this->thereAreNbDummyDtoCustom(1);
12101210
}
12111211

12121212
/**
1213-
* @Given there are :nb DummyCustomDto
1213+
* @Given there are :nb DummyDtoCustom
12141214
*/
1215-
public function thereAreNbDummyCustomDto($nb)
1215+
public function thereAreNbDummyDtoCustom($nb)
12161216
{
12171217
for ($i = 0; $i < $nb; ++$i) {
12181218
$dto = $this->isOrm() ? new DummyDtoCustom() : new DummyDtoCustomDocument();

features/doctrine/date_filter.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Feature: Date filter on collections
3131
}
3232
}
3333
},
34+
"minItems": 2,
3435
"maxItems": 2
3536
},
3637
"hydra:view": {
@@ -70,6 +71,7 @@ Feature: Date filter on collections
7071
}
7172
}
7273
},
74+
"minItems": 3,
7375
"maxItems": 3
7476
},
7577
"hydra:view": {
@@ -108,6 +110,7 @@ Feature: Date filter on collections
108110
}
109111
}
110112
},
113+
"minItems": 2,
111114
"maxItems": 2
112115
},
113116
"hydra:view": {
@@ -147,6 +150,7 @@ Feature: Date filter on collections
147150
}
148151
}
149152
},
153+
"minItems": 3,
150154
"maxItems": 3
151155
},
152156
"hydra:view": {
@@ -186,6 +190,7 @@ Feature: Date filter on collections
186190
}
187191
}
188192
},
193+
"minItems": 1,
189194
"maxItems": 1
190195
},
191196
"hydra:view": {
@@ -223,6 +228,7 @@ Feature: Date filter on collections
223228
}
224229
}
225230
},
231+
"minItems": 1,
226232
"maxItems": 1
227233
},
228234
"hydra:view": {
@@ -292,6 +298,7 @@ Feature: Date filter on collections
292298
}
293299
}
294300
},
301+
"minItems": 3,
295302
"maxItems": 3
296303
},
297304
"hydra:view": {
@@ -331,6 +338,7 @@ Feature: Date filter on collections
331338
}
332339
}
333340
},
341+
"minItems": 3,
334342
"maxItems": 3
335343
},
336344
"hydra:view": {
@@ -370,6 +378,7 @@ Feature: Date filter on collections
370378
}
371379
}
372380
},
381+
"minItems": 3,
373382
"maxItems": 3
374383
},
375384
"hydra:view": {

features/doctrine/multiple_filter.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Feature: Multiple filters on collections
3232
}
3333
}
3434
},
35+
"minItems": 2,
3536
"maxItems": 2
3637
},
3738
"hydra:view": {

features/doctrine/numeric_filter.feature

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ Feature: Numeric filter on collections
3232
}
3333
}
3434
},
35+
"minItems": 3,
3536
"maxItems": 3,
3637
"uniqueItems": true
3738
},
38-
"hydra:totalItems": {"pattern": "^3$"},
39+
"hydra:totalItems": {"type": "number", "minimum": 3, "maximum": 3},
3940
"hydra:view": {
4041
"type": "object",
4142
"properties": {
@@ -76,10 +77,11 @@ Feature: Numeric filter on collections
7677
}
7778
}
7879
},
80+
"minItems": 3,
7981
"maxItems": 3,
8082
"uniqueItems": true
8183
},
82-
"hydra:totalItems": {"pattern": "^6$"},
84+
"hydra:totalItems": {"type": "number", "minimum": 6, "maximum": 6},
8385
"hydra:view": {
8486
"type": "object",
8587
"properties": {
@@ -119,10 +121,11 @@ Feature: Numeric filter on collections
119121
}
120122
}
121123
},
124+
"minItems": 3,
122125
"maxItems": 3,
123126
"uniqueItems": true
124127
},
125-
"hydra:totalItems": {"pattern": "^20$"},
128+
"hydra:totalItems": {"type": "number", "minimum": 20, "maximum": 20},
126129
"hydra:view": {
127130
"type": "object",
128131
"properties": {

0 commit comments

Comments
 (0)