Skip to content

Commit dab3c78

Browse files
authored
Merge pull request #2853 from teohhanhui/merge-2.4
Merge 2.4 into master
2 parents efe39ce + b0fd804 commit dab3c78

File tree

56 files changed

+1261
-388
lines changed

Some content is hidden

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

56 files changed

+1261
-388
lines changed

.circleci/config.yml

Lines changed: 24 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
# codecov: codecov/codecov@1
5-
# https://github.com/codecov/codecov-circleci-orb/pull/17
6-
codecov:
7-
commands:
8-
upload:
9-
parameters:
10-
conf:
11-
description: Used to specify the location of the .codecov.yml config file
12-
type: string
13-
default: ".codecov.yml"
14-
file:
15-
description: Path to the code coverage data file to upload.
16-
type: string
17-
default: ""
18-
flags:
19-
description: Flag the upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
20-
type: string
21-
default: ""
22-
token:
23-
description: Set the private repository token (defaults to environment variable $CODECOV_TOKEN)
24-
type: string
25-
default: ${CODECOV_TOKEN}
26-
upload_name:
27-
description: Custom defined name of the upload. Visible in Codecov UI
28-
type: string
29-
default: ${CIRCLE_BUILD_NUM}
30-
steps:
31-
- when:
32-
condition: << parameters.file >>
33-
steps:
34-
- run:
35-
name: Upload Coverage Results
36-
command: |
37-
curl -s https://codecov.io/bash | bash -s -- \
38-
-f "<< parameters.file >>" \
39-
-t "<< parameters.token >>" \
40-
-n "<< parameters.upload_name >>" \
41-
-y "<< parameters.conf >>" \
42-
-F "<< parameters.flags >>" \
43-
-Z || echo 'Codecov upload failed'
44-
- unless:
45-
condition: << parameters.file >>
46-
steps:
47-
- run:
48-
name: Upload Coverage Results
49-
command: |
50-
curl -s https://codecov.io/bash | bash -s -- \
51-
-t "<< parameters.token >>" \
52-
-n "<< parameters.upload_name >>" \
53-
-y "<< parameters.conf >>" \
54-
-F "<< parameters.flags >>" \
55-
-Z || echo 'Codecov upload failed'
4+
codecov: codecov/codecov@1
565
coveralls:
576
commands:
587
upload:
@@ -83,20 +32,12 @@ commands:
8332
- run:
8433
name: Disable Xdebug PHP extension
8534
command: sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
86-
install-doctrine-mongodb-odm:
87-
steps:
88-
- run:
89-
name: Install Doctrine MongoDB ODM
90-
command: |
91-
composer require --prefer-dist --no-progress --no-suggest --no-update --ansi \
92-
doctrine/mongodb-odm:^2.0@beta \
93-
doctrine/mongodb-odm-bundle:^4.0@beta \
9435
install-mongodb-php-extension:
9536
steps:
9637
- run:
9738
name: Install mongodb PHP extension
9839
command: |
99-
sudo pecl install mongodb
40+
sudo pecl install mongodb-1.5.4
10041
sudo docker-php-ext-enable mongodb
10142
merge-code-coverage-reports:
10243
parameters:
@@ -274,17 +215,18 @@ jobs:
274215
working_directory: ~/api-platform/core
275216
steps:
276217
- checkout
277-
- restore-composer-cache
278-
- restore-php-cs-fixer-cache
218+
- install-mongodb-php-extension
279219
- disable-xdebug-php-extension
280220
- disable-php-memory-limit
281221
- update-composer
222+
- restore-composer-cache
282223
- run:
283224
name: Install PHP-CS-Fixer
284225
command: |
285226
composer global require --prefer-dist --no-progress --no-suggest --ansi \
286227
friendsofphp/php-cs-fixer:^2.14
287228
- save-composer-cache
229+
- restore-php-cs-fixer-cache
288230
- run:
289231
name: Run PHP-CS-Fixer
290232
command: |
@@ -300,16 +242,15 @@ jobs:
300242
working_directory: ~/api-platform/core
301243
steps:
302244
- checkout
303-
- restore-composer-cache
304-
- restore-phpstan-cache
245+
- install-mongodb-php-extension
305246
- disable-xdebug-php-extension
306247
- disable-php-memory-limit
307-
- install-mongodb-php-extension
308248
- update-composer
309-
- install-doctrine-mongodb-odm
249+
- restore-composer-cache
310250
- update-project-dependencies
311251
- save-composer-cache
312252
- clear-test-app-cache
253+
- restore-phpstan-cache
313254
- run:
314255
name: Run PHPStan
315256
command: vendor/bin/phpstan analyse --ansi
@@ -321,11 +262,11 @@ jobs:
321262
working_directory: ~/api-platform/core
322263
steps:
323264
- checkout
324-
- restore-composer-cache
325-
- restore-npm-cache
265+
- install-mongodb-php-extension
326266
- disable-xdebug-php-extension
327267
- disable-php-memory-limit
328268
- update-composer
269+
- restore-composer-cache
329270
- update-project-dependencies
330271
- save-composer-cache
331272
- clear-test-app-cache
@@ -337,6 +278,7 @@ jobs:
337278
export PARALLEL='-j10% --joblog build/logs/parallel.log --rpl {_}\ s/\\//_/g;'
338279
phpunit_cmd='phpdbg -qrr vendor/bin/phpunit --coverage-php build/coverage/coverage-{_}.cov --log-junit build/logs/phpunit/{_}.xml --exclude-group mongodb,resource-hog --colors=always {}'
339280
echo "$split_tests" | parallel "$phpunit_cmd" || echo "$split_tests" | parallel --retry-failed "$phpunit_cmd"
281+
- restore-npm-cache
340282
- merge-test-reports:
341283
dir: build/logs/phpunit
342284
out: build/logs/phpunit/junit.xml
@@ -367,11 +309,11 @@ jobs:
367309
working_directory: ~/api-platform/core
368310
steps:
369311
- checkout
370-
- restore-composer-cache
371-
- restore-npm-cache
312+
- install-mongodb-php-extension
372313
- disable-xdebug-php-extension
373314
- disable-php-memory-limit
374315
- update-composer
316+
- restore-composer-cache
375317
- update-project-dependencies
376318
- save-composer-cache
377319
- clear-test-app-cache
@@ -383,6 +325,7 @@ jobs:
383325
_f=$(echo "$f" | tr / _)
384326
FEATURE="${_f}" phpdbg -qrr vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/"${_f}" --profile=default-coverage --no-interaction "$f"
385327
done
328+
- restore-npm-cache
386329
- merge-test-reports:
387330
dir: build/logs/behat
388331
out: build/logs/behat/junit.xml
@@ -411,13 +354,11 @@ jobs:
411354
working_directory: ~/api-platform/core
412355
steps:
413356
- checkout
414-
- restore-composer-cache
415-
- restore-npm-cache
357+
- install-mongodb-php-extension
416358
- disable-xdebug-php-extension
417359
- disable-php-memory-limit
418-
- install-mongodb-php-extension
419360
- update-composer
420-
- install-doctrine-mongodb-odm
361+
- restore-composer-cache
421362
- update-project-dependencies
422363
- save-composer-cache
423364
- clear-test-app-cache
@@ -435,6 +376,7 @@ jobs:
435376
- store_artifacts:
436377
path: build/logs/clover.xml
437378
destination: build/logs/clover.xml
379+
- restore-npm-cache
438380
- codecov/upload:
439381
file: build/logs/clover.xml
440382
flags: phpunit_mongodb
@@ -449,13 +391,11 @@ jobs:
449391
working_directory: ~/api-platform/core
450392
steps:
451393
- checkout
452-
- restore-composer-cache
453-
- restore-npm-cache
394+
- install-mongodb-php-extension
454395
- disable-xdebug-php-extension
455396
- disable-php-memory-limit
456-
- install-mongodb-php-extension
457397
- update-composer
458-
- install-doctrine-mongodb-odm
398+
- restore-composer-cache
459399
- update-project-dependencies
460400
- save-composer-cache
461401
- clear-test-app-cache
@@ -465,6 +405,7 @@ jobs:
465405
command: |
466406
mkdir -p build/logs/behat
467407
phpdbg -qrr vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat --profile=mongodb-coverage --no-interaction
408+
- restore-npm-cache
468409
- merge-test-reports:
469410
dir: build/logs/behat
470411
out: build/logs/behat/junit.xml
@@ -493,11 +434,11 @@ jobs:
493434
working_directory: ~/api-platform/core
494435
steps:
495436
- checkout
496-
- restore-composer-cache
497-
- restore-npm-cache
437+
- install-mongodb-php-extension
498438
- disable-xdebug-php-extension
499439
- disable-php-memory-limit
500440
- update-composer
441+
- restore-composer-cache
501442
- update-project-dependencies
502443
- save-composer-cache
503444
- clear-test-app-cache
@@ -507,6 +448,7 @@ jobs:
507448
command: |
508449
mkdir -p build/logs/behat
509450
phpdbg -qrr vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat --profile=elasticsearch-coverage --no-interaction
451+
- restore-npm-cache
510452
- merge-test-reports:
511453
dir: build/logs/behat
512454
out: build/logs/behat/junit.xml
@@ -530,12 +472,10 @@ jobs:
530472

531473
workflows:
532474
version: 2
533-
lint:
475+
lint-and-coverage:
534476
jobs:
535477
- php-cs-fixer
536478
- phpstan
537-
test-with-coverage:
538-
jobs:
539479
- phpunit-coverage
540480
- behat-coverage
541481
- phpunit-mongodb-coverage

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ indent_size = 4
3838
indent_style = space
3939
indent_size = 4
4040

41-
[*.yml]
41+
[*.{yaml,yml}]
4242
indent_style = space
4343
indent_size = 4
4444
trim_trailing_whitespace = false

.travis.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ cache:
1414
echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
1515
- &disable-xdebug-php-extension |
1616
phpenv config-rm xdebug.ini || echo "xdebug not available"
17-
- &install-doctrine-mongodb-odm |
18-
composer require --prefer-dist --no-progress --no-suggest --no-update --ansi \
19-
doctrine/mongodb-odm:^2.0@beta \
20-
doctrine/mongodb-odm-bundle:^4.0@beta \
2117
- &install-mongodb-php-extension |
2218
echo "extension=mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/mongodb.ini
2319
- &run-behat-tests |
@@ -39,10 +35,16 @@ jobs:
3935
include:
4036
- php: '7.1'
4137
before_install:
42-
- *disable-php-memory-limit
38+
- *install-mongodb-php-extension
4339
- *disable-xdebug-php-extension
40+
- *disable-php-memory-limit
4441
- *add-composer-bin-dir-to-path
4542
install:
43+
- |
44+
composer remove --dev --no-progress --no-update --ansi \
45+
doctrine/mongodb-odm \
46+
doctrine/mongodb-odm-bundle \
47+
- sed -i '33,39d' tests/Fixtures/app/config/config_common.yml
4648
- *update-project-dependencies
4749
before_script:
4850
- *clear-test-app-cache
@@ -57,8 +59,9 @@ jobs:
5759

5860
- php: '7.2'
5961
before_install:
60-
- *disable-php-memory-limit
62+
- *install-mongodb-php-extension
6163
- *disable-xdebug-php-extension
64+
- *disable-php-memory-limit
6265
- *add-composer-bin-dir-to-path
6366
install:
6467
- *update-project-dependencies
@@ -75,8 +78,9 @@ jobs:
7578

7679
- php: '7.3'
7780
before_install:
78-
- *disable-php-memory-limit
81+
- *install-mongodb-php-extension
7982
- *disable-xdebug-php-extension
83+
- *disable-php-memory-limit
8084
- *add-composer-bin-dir-to-path
8185
install:
8286
- *update-project-dependencies
@@ -94,8 +98,9 @@ jobs:
9498
- php: '7.3'
9599
env: deps=low
96100
before_install:
97-
- *disable-php-memory-limit
101+
- *install-mongodb-php-extension
98102
- *disable-xdebug-php-extension
103+
- *disable-php-memory-limit
99104
- *add-composer-bin-dir-to-path
100105
install:
101106
- composer update --prefer-dist --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi
@@ -115,8 +120,9 @@ jobs:
115120
services:
116121
- postgresql
117122
before_install:
118-
- *disable-php-memory-limit
123+
- *install-mongodb-php-extension
119124
- *disable-xdebug-php-extension
125+
- *disable-php-memory-limit
120126
- *add-composer-bin-dir-to-path
121127
install:
122128
- *update-project-dependencies
@@ -137,8 +143,9 @@ jobs:
137143
services:
138144
- mysql
139145
before_install:
140-
- *disable-php-memory-limit
146+
- *install-mongodb-php-extension
141147
- *disable-xdebug-php-extension
148+
- *disable-php-memory-limit
142149
- *add-composer-bin-dir-to-path
143150
install:
144151
- *update-project-dependencies
@@ -159,12 +166,11 @@ jobs:
159166
services:
160167
- mongodb
161168
before_install:
162-
- *disable-php-memory-limit
163169
- *install-mongodb-php-extension
164170
- *disable-xdebug-php-extension
171+
- *disable-php-memory-limit
165172
- *add-composer-bin-dir-to-path
166173
install:
167-
- *install-doctrine-mongodb-odm
168174
- *update-project-dependencies
169175
before_script:
170176
- *clear-test-app-cache
@@ -186,8 +192,9 @@ jobs:
186192
- sudo apt-get update
187193
- sudo apt-get install elasticsearch
188194
- sudo service elasticsearch start
189-
- *disable-php-memory-limit
195+
- *install-mongodb-php-extension
190196
- *disable-xdebug-php-extension
197+
- *disable-php-memory-limit
191198
- *add-composer-bin-dir-to-path
192199
install:
193200
- *update-project-dependencies
@@ -205,8 +212,9 @@ jobs:
205212
- php: '7.3'
206213
env: SYMFONY_DEPRECATIONS_HELPER=0
207214
before_install:
208-
- *disable-php-memory-limit
215+
- *install-mongodb-php-extension
209216
- *disable-xdebug-php-extension
217+
- *disable-php-memory-limit
210218
- *add-composer-bin-dir-to-path
211219
install:
212220
- *update-project-dependencies

CHANGELOG.md

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

55
* GraphQL: Add support for custom types
66

7+
## 2.4.4
8+
9+
* Store the original data in the `previous_data` request attribute, and allow to access it in security expressions using the `previous_object` variable (useful for PUT and PATCH requests)
10+
* Fix resource inheritance handling
11+
* Fix BC break in `AbstractItemNormalizer` introduced in 2.4
12+
* Fix serialization when using interface as resource
13+
* Basic compatibility with Symfony 4.3
14+
715
## 2.4.3
816

917
* Doctrine: allow autowiring of filter classes

0 commit comments

Comments
 (0)