Skip to content

Commit

Permalink
Merge branch 'master' into mongodb_date_immutable_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
CheapHasz committed Jan 5, 2021
2 parents c565c1b + 8711c80 commit 0fed86f
Show file tree
Hide file tree
Showing 519 changed files with 19,633 additions and 1,795 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
@@ -0,0 +1 @@
tidelift: "packagist/api-platform/core"
13 changes: 0 additions & 13 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

35 changes: 18 additions & 17 deletions .github/workflows/ci.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
php-version: ${{ matrix.php }}
extensions: intl, bcmath, curl, openssl, mbstring
ini-values: memory_limit=-1
tools: flex, pecl, composer, flex, php-cs-fixer
tools: pecl, composer, php-cs-fixer
coverage: none
- name: Run PHP-CS-Fixer fix
run: php-cs-fixer fix --dry-run --diff --ansi
Expand All @@ -51,7 +51,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex, phpstan
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Run PHPStan analysis
env:
SYMFONY_PHPUNIT_VERSION: '9.4'
run: phpstan analyse --no-interaction --no-progress --no-interaction --ansi
run: ./vendor/bin/phpstan analyse --no-interaction --no-progress --no-interaction --ansi

phpunit:
name: PHPUnit (PHP ${{ matrix.php }})
Expand All @@ -112,7 +112,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring
coverage: pcov
ini-values: memory_limit=-1
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
coverage: pcov
ini-values: memory_limit=-1
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -362,7 +362,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -412,7 +412,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_pgsql
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -460,7 +460,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_mysql
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -506,7 +506,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -562,7 +562,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -600,15 +600,15 @@ jobs:
- '7.4'
fail-fast: false
env:
SYMFONY_DEPRECATIONS_HELPER: max[total]=7
SYMFONY_DEPRECATIONS_HELPER: max[total]=8
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -650,7 +650,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -710,7 +710,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -774,7 +774,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
coverage: none
ini-values: memory_limit=-1
Expand Down Expand Up @@ -817,7 +817,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex, pecl, composer, flex
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
coverage: none
ini-values: memory_limit=-1
Expand All @@ -840,3 +840,4 @@ jobs:
run: tests/Fixtures/app/console cache:clear --ansi
- name: Run Behat tests
run: vendor/bin/behat --out=std --format=progress --profile=default --no-interaction

5 changes: 4 additions & 1 deletion .php_cs.dist
Expand Up @@ -16,6 +16,8 @@ $finder = PhpCsFixer\Finder::create()
->exclude([
'tests/Fixtures/app/var',
])
->notPath('src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php')
->notPath('tests/Fixtures/TestBundle/Entity/DummyPhp8.php') // temporary
->append([
'tests/Fixtures/app/console',
]);
Expand All @@ -29,14 +31,15 @@ return PhpCsFixer\Config::create()
'@PHPUnit60Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'single_line_comment_style' => false, // Temporary fix for compatibility with PHP 8 attributes, see https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/5284
'comment_to_phpdoc' => true, // Temporary fix for compatibility with PHP 8 attributes, see https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/5284
'align_multiline_comment' => [
'comment_type' => 'phpdocs_like',
],
'array_indentation' => true,
'array_syntax' => [
'syntax' => 'short',
],
'comment_to_phpdoc' => true,
'compact_nullable_typehint' => true,
'doctrine_annotation_array_assignment' => [
'operator' => '=',
Expand Down
60 changes: 59 additions & 1 deletion CHANGELOG.md
@@ -1,5 +1,63 @@
# Changelog

## 2.6.0

* Cache: adds a `max_header_length` configuration (#2865)
* Cache: support `stale-while-revalidate` and `stale-if-error` cache control headers (#3439)
* Config: Add an option to set global default values (#3151)
* DTO: Add `ApiPlatform\Core\DataTransformer\DataTransformerInitializerInterface` to pre-hydrate inputs (#3701)
* DTO: Improve Input/Output support (#3231)
* Data Persisters: Add `previous_data` to the context passed to persisters when available (#3752)
* Data Persister: Add a `ResumableDataPersisterInterface` that allows to call multiple persisters (#3912)
* Debug: Display API Platform's version in the debug bar (#3235)
* Docs: Make `asset_package` configurable (#3764)
* Doctrine: Allow searching on multiple values on every strategies (#3786)
* Elasticsearch: The `Paginator` class constructor now receives the denormalization context to support denormalizing documents using serialization groups. This change may cause potential **BC** breaks for existing applications as denormalization was previously done without serialization groups.
* GraphQL: **BC** New syntax for the filters' arguments to preserve the order: `order: [{foo: 'asc'}, {bar: 'desc'}]` (#3468)
* GraphQL: **BC** `operation` is now `operationName` to follow the standard (#3568)
* GraphQL: **BC** `paginationType` is now `pagination_type` (#3614)
* GraphQL: Add page-based pagination (#3175, #3517)
* GraphQL: Allow formatting GraphQL errors based on exceptions (#3063)
* GraphQL: Errors thrown from the GraphQL library can now be handled (#3632, #3643)
* GraphQL: Possibility to add a custom description for queries, mutations and subscriptions (#3477, #3514)
* GraphQL: Subscription support with Mercure (#3321)
* GraphQL: Support for field name conversion (serialized name) (#3455, #3516)
* Hydra: Sort entries in the API entrypoint (#3091)
* Identifiers: Add Symfony Uid support (#3715)
* IriConverter: **BC** Fix double encoding in IRIs - may cause breaking change as some characters no longer encoded in output (#3552)
* JSON-LD: Add an `iri_only` attribute to simplify documents structure (useful when using Vulcain) (#3275)
* Exception: Response error codes can be specified via the `ApiPlatform\Core\Exception\ErrorCodeSerializableInterface` (#2922)
* Mercure: Add a `normalization_context` option in `mercure` attribute (#3772)
* Messenger: Add a context stamp containing contextual data (#3157)
* Metadata: Deprecate `InheritedPropertyMetadataFactory` (#3273)
* Metadata: Improve and simplify identifiers management (#3825)
* Metadata: Support the Symfony Serializer's `@Ignore` annotation (#3820)
* Metadata: Support using annotations as PHP 8 attributes (#3869, #3868, #3851)
* Metadata: Throw an error when no identifier is defined (#3871)
* Metadata: Use `id` as default identifier if none provided (#3874)
* MongoDB: Mercure support (#3290)
* MongoDB: Possibility to add execute options (aggregate command fields) for a resource, like `allowDiskUse` (#3144)
* OpenAPI: Add default values of PHP properties to the documentation (#2386)
* OpenAPI: **BC** Replace all characters other than `[a-zA-Z0-9\.\-_]` to `.` in definition names to be compliant with OpenAPI 3.0 (#3669)
* OpenAPI: Refactor OpenAPI v3 support, OpenAPI v2 (aka Swagger) is deprecated (#3407)
* Order: Support default order for a specific custom operation (#3784)
* PATCH: Support patching deep objects (#3847)
* Router: UrlGenerator strategy configuration via `url_generation_strategy` (#3198)
* Routing: Add stateless `ApiResource` attribute (#3436)
* Security: Add support for access control rule on attributes (#3503)
* Subresources: `resourceClass` can now be defined as a container parameter in XML and YAML definitions
* Symfony: improved 5.x support with fewer deprecations (#3589)
* Symfony: Allow using `ItemNormalizer` without Symfony SecurityBundle (#3801)
* Symfony: Lazy load all commands (#3798)
* Tests: adds a method to retrieve the CookieJar in the test Client `getCookieJar`
* Validator: Add the violation code to the violation properties (#3857)
* Validator: Allow customizing the validation error status code (#3808)
* Validator: Autoconfiguration of validation groups generator via `ApiPlatform\Core\Validator\ValidationGroupsGeneratorInterface`
* Validator: Deprecate using a validation groups generator service not implementing `ApiPlatform\Core\Bridge\Symfony\Validator\ValidationGroupsGeneratorInterface` (#3346)
* Validator: Property validation through OpenAPI (#33329)
* Validator:Query filters and parameters are validated (#1723)
* `ExceptionInterface` now extends `\Throwable` (#3217)

## 2.5.9

* Fix a warning when preloading the `AbstractPaginator` class (#3827)
Expand Down Expand Up @@ -136,7 +194,7 @@ For compatibility reasons with Symfony 5.2 and PHP 8, we do not test anymore the

* Allow to not declare GET item operation
* Add support for the Accept-Patch header
* Make the `maximum_items_per_page` attribute consistent with other attributes controlling pagination
* Make the `maximum_items_per_page` attribute consistent with other attributes controlling pagination
* Allow to use a string instead of an array for serializer groups
* Test: Add a helper method to find the IRI of a resource
* Test: Add assertions for testing response against JSON Schema from API resource
Expand Down
17 changes: 6 additions & 11 deletions CONTRIBUTING.md
Expand Up @@ -18,11 +18,6 @@ Then, if it appears that it's a real bug, you may report it using GitHub by foll

> _NOTE:_ Don't hesitate giving as much information as you can (OS, PHP version extensions...)
### Security Issues

If you find a security issue, send a mail to Kévin Dunglas <dunglas@gmail.com>. **Please do not report security problems
publicly**. We will disclose details of the issue and credit you after having released a new version including a fix.

## Pull Requests

### Writing a Pull Request
Expand Down Expand Up @@ -50,7 +45,7 @@ Alternatively, you can also work with the test application we provide:
### Matching Coding Standards

The API Platform project follows [Symfony coding standards](https://symfony.com/doc/current/contributing/code/standards.html).
But don't worry, you can fix CS issues automatically using the [PHP CS Fixer](http://cs.sensiolabs.org/) tool:
But don't worry, you can fix CS issues automatically using the [PHP CS Fixer](https://cs.sensiolabs.org/) tool:

php-cs-fixer.phar fix

Expand All @@ -68,8 +63,6 @@ When you send a PR, just make sure that:
that you did not make in your PR, you're doing it wrong.
* Also don't forget to add a comment when you update a PR with a ping to [the maintainers](https://github.com/orgs/api-platform/people), so he/she will get a notification.

All Pull Requests must include [this header](.github/PULL_REQUEST_TEMPLATE.md).

### Tests

On `api-platform/core` there are two kinds of tests: unit (`phpunit` through `simple-phpunit`) and integration tests (`behat`).
Expand All @@ -96,13 +89,15 @@ Coverage will be available in `coverage/index.html`.

The command to launch Behat tests is:

php -d memory_limit=-1 ./vendor/bin/behat --suite=default --stop-on-failure --format=progress
php -d memory_limit=-1 ./vendor/bin/behat --profile=default --stop-on-failure --format=progress

If you want to launch Behat tests for MongoDB, the command is:

APP_ENV=mongodb php -d memory_limit=-1 ./vendor/bin/behat --suite=mongodb --stop-on-failure --format=progress
MONGODB_URL=mongodb://localhost:27017 APP_ENV=mongodb php -d memory_limit=-1 ./vendor/bin/behat --profile=mongodb --stop-on-failure --format=progress

To get more details about an error, replace `--format=progress` by `-vvv`. You may run a mongo instance using docker:

To get more details about an error, replace `--format=progress` by `-vvv`.
docker run -p 27017:27017 mongo:latest

# License and Copyright Attribution

Expand Down
1 change: 1 addition & 0 deletions behat.yml.dist
Expand Up @@ -132,3 +132,4 @@ elasticsearch-coverage:
- 'ApiPlatform\Core\Tests\Behat\CoverageContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'

4 changes: 3 additions & 1 deletion composer.json
Expand Up @@ -93,6 +93,7 @@
"doctrine/mongodb-odm-bundle": "To support MongoDB. Only versions 4.0 and later are supported.",
"elasticsearch/elasticsearch": "To support Elasticsearch.",
"guzzlehttp/guzzle": "To use the HTTP cache invalidation system.",
"ocramius/package-versions": "To display the API Platform's version in the debug bar.",
"phpdocumentor/reflection-docblock": "To support extracting metadata from PHPDoc.",
"psr/cache-implementation": "To use metadata caching.",
"ramsey/uuid": "To support Ramsey's UUID identifiers.",
Expand All @@ -101,6 +102,7 @@
"symfony/expression-language": "To use authorization features.",
"symfony/security": "To use authorization features.",
"symfony/twig-bundle": "To use the Swagger UI integration.",
"symfony/uid": "To support Symfony UUID/ULID identifiers.",
"symfony/web-profiler-bundle": "To use the data collector.",
"webonyx/graphql-php": "To support GraphQL."
},
Expand All @@ -122,7 +124,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.5.x-dev"
"dev-master": "2.6.x-dev"
},
"symfony": {
"require": "^3.4 || ^4.4 || ^5.1"
Expand Down

0 comments on commit 0fed86f

Please sign in to comment.