Skip to content

Commit

Permalink
chore: remove deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Jul 19, 2024
1 parent 2e92aea commit 754e499
Show file tree
Hide file tree
Showing 525 changed files with 1,969 additions and 22,727 deletions.
295 changes: 17 additions & 278 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
'src/Doctrine/Odm/Tests/var'
])
->notPath('src/Symfony/Bundle/DependencyInjection/Configuration.php')
->notPath('src/Annotation/ApiFilter.php') // temporary
->notPath('src/Annotation/ApiProperty.php') // temporary
->notPath('src/Annotation/ApiResource.php') // temporary
->notPath('src/Annotation/ApiSubresource.php') // temporary
->notPath('tests/Fixtures/TestBundle/Entity/DummyPhp8.php') // temporary
->notPath('tests/Fixtures/TestBundle/Enum/EnumWithDescriptions.php') // PHPDoc on enum cases
->notPath('tests/Fixtures/TestBundle/Enum/GamePlayMode.php') // PHPDoc on enum cases
->notPath('tests/Fixtures/TestBundle/Enum/GenderTypeEnum.php') // PHPDoc on enum cases
->append([
'tests/Fixtures/app/console',
]);
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,19 @@ Only the first commit on a Pull Request need to use a conventional commit, other

### Tests

On `api-platform/core` there are two kinds of tests: unit (`phpunit` through `simple-phpunit`) and integration tests (`behat`).
On `api-platform/core` there are two kinds of tests: unit (`phpunit`) and integration tests (`behat`).

Note that we stopped using `prophesize` for new tests since 3.2, use `phpunit` stub system.

Both `simple-phpunit` and `behat` are development dependencies and should be available in the `vendor` directory.
Both `phpunit` and `behat` are development dependencies and should be available in the `vendor` directory.

Recommendations:

* don't change existing tests if possible
* always add a new `ApiResource` or a new `Entity/Document` to add a new test instead of changing an existing class
* as of API Platform 3 each component has it's own test directory, avoid the `tests/` directory except for functional tests
* dependencies between components must be kept at its minimal (`api-platform/metadata`, `api-platform/state`) except for bridges (Doctrine, Symfony, Laravel etc.)
* for functional testing with phpunit (see `tests/Functional`, add your ApiResource to `ApiPlatform\Tests\Fixtures\PhpUnitResourceNameCollectionFactory`)

Note that in most of the testing, you don't need Doctrine take a look at how we write fixtures at:

Expand Down
43 changes: 19 additions & 24 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"symfony/serializer": "^6.4 || ^7.1",
"symfony/translation-contracts": "^3.3",
"symfony/web-link": "^6.4 || ^7.1",
"willdurand/negotiation": "^3.0"
"willdurand/negotiation": "^3.1"
},
"require-dev": {
"behat/behat": "^3.11",
Expand All @@ -47,35 +47,34 @@
"doctrine/mongodb-odm": "^2.2",
"doctrine/mongodb-odm-bundle": "^4.0 || ^5.0",
"doctrine/orm": "^2.14 || ^3.0",
"elasticsearch/elasticsearch": "^7.11 || ^8.4",
"elasticsearch/elasticsearch": "^8.4",
"friends-of-behat/mink-browserkit-driver": "^1.3.1",
"friends-of-behat/mink-extension": "^2.2",
"friends-of-behat/symfony-extension": "^2.1",
"guzzlehttp/guzzle": "^6.0 || ^7.1",
"illuminate/config": "^10.0||^11.0",
"illuminate/contracts": "^10.0||^11.0",
"illuminate/database": "^10.0||^11.0",
"illuminate/http": "^10.0||^11.0",
"illuminate/pagination": "^10.0||^11.0",
"illuminate/routing": "^10.0||^11.0",
"illuminate/support": "^10.0||^11.0",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"illuminate/config": "^11.0",
"illuminate/contracts": "^11.0",
"illuminate/database": "^11.0",
"illuminate/http": "^11.0",
"illuminate/pagination": "^11.0",
"illuminate/routing": "^11.0",
"illuminate/support": "^11.0",
"jangregor/phpstan-prophecy": "^1.0",
"justinrainbow/json-schema": "^5.2.1",
"laravel/framework": "^10.0||^11.0",
"orchestra/testbench": "^8.18",
"justinrainbow/json-schema": "^5.2.11",
"laravel/framework": "^11.0",
"orchestra/testbench": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpdoc-parser": "^1.13",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^11.2",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"ramsey/uuid": "^3.9.7 || ^4.0",
"ramsey/uuid-doctrine": "^1.4 || ^2.0 || ^3.0",
"sebastian/comparator": "<5.0",
"soyuka/contexts": "v3.3.9",
"soyuka/contexts": "^3.3.10",
"soyuka/pmu": "^0.0.4",
"soyuka/stubs-mongodb": "^1.0",
"symfony/asset": "^6.4 || ^7.1",
Expand All @@ -84,8 +83,8 @@
"symfony/config": "^6.4 || ^7.1",
"symfony/console": "^6.4 || ^7.1",
"symfony/css-selector": "^6.4 || ^7.1",
"symfony/dependency-injection": "^6.4 || ^7.1.12",
"symfony/doctrine-bridge": "^6.4 || ^7.1",
"symfony/dependency-injection": "^6.4 || ^7.1",
"symfony/doctrine-bridge": "^6.4.2 || ^7.1.2",
"symfony/dom-crawler": "^6.4 || ^7.1",
"symfony/error-handler": "^6.4 || ^7.1",
"symfony/event-dispatcher": "^6.4 || ^7.1",
Expand All @@ -98,7 +97,6 @@
"symfony/maker-bundle": "^1.24",
"symfony/mercure-bundle": "*",
"symfony/messenger": "^6.4 || ^7.1",
"symfony/phpunit-bridge": "^6.4.1 || ^7.1",
"symfony/routing": "^6.4 || ^7.1",
"symfony/security-bundle": "^6.4 || ^7.1",
"symfony/security-core": "^6.4 || ^7.1",
Expand All @@ -110,7 +108,7 @@
"symfony/web-profiler-bundle": "^6.4 || ^7.1",
"symfony/yaml": "^6.4 || ^7.1",
"twig/twig": "^1.42.3 || ^2.12 || ^3.0",
"webonyx/graphql-php": "^14.0 || ^15.0"
"webonyx/graphql-php": "^15.0"
},
"conflict": {
"doctrine/common": "<3.2.2",
Expand All @@ -121,8 +119,7 @@
"symfony/framework-bundle": "6.4.6 || 7.1.6",
"symfony/var-exporter": "<6.1.1",
"phpunit/phpunit": "<9.5",
"phpspec/prophecy": "<1.15",
"elasticsearch/elasticsearch": ">=8.0,<8.4"
"phpspec/prophecy": "<1.15"
},
"suggest": {
"doctrine/mongodb-odm-bundle": "To support MongoDB. Only versions 4.0 and later are supported.",
Expand Down Expand Up @@ -189,7 +186,6 @@
"api-platform/graphql",
"api-platform/http-cache",
"api-platform/documentation",
"api-platform/parameter-validator",
"api-platform/ramsey-uuid",
"api-platform/serializer",
"api-platform/state",
Expand All @@ -212,7 +208,6 @@
{"type": "path", "url": "./src/GraphQl"},
{"type": "path", "url": "./src/HttpCache"},
{"type": "path", "url": "./src/Documentation"},
{"type": "path", "url": "./src/ParameterValidator"},
{"type": "path", "url": "./src/RamseyUuid"},
{"type": "path", "url": "./src/Serializer"},
{"type": "path", "url": "./src/State"},
Expand Down
8 changes: 3 additions & 5 deletions docs/config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ api_platform:
json: ['application/json']
docs_formats:
jsonopenapi: ['application/vnd.openapi+json']
keep_legacy_inflector: false
http_cache:
invalidation:
enabled: true
public: true
invalidation:
enabled: true
public: true
use_symfony_listeners: false
defaults:
extra_properties:
rfc_7807_compliant_errors: true
standard_put: true
8 changes: 0 additions & 8 deletions docs/guides/error-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
// tags: design, state
// ---

// Note that we use the following configuration:
// ```
// api_platform:
// defaults:
// rfc_7807_compliant_errors: true
// ```
// To customize the API Platform response, replace the api_platform.state.error_provider with your own provider:

namespace App\ApiResource {
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
Expand Down
7 changes: 0 additions & 7 deletions docs/guides/error-resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
// tags: design, state
// ---

// Note that we use the following configuration:
// ```
// api_platform:
// defaults:
// rfc_7807_compliant_errors: true
// ```

namespace App\ApiResource {
use ApiPlatform\Metadata\ErrorResource;
use ApiPlatform\Metadata\Exception\ProblemExceptionInterface;
Expand Down
171 changes: 0 additions & 171 deletions features/filter/filter_validation_legacy.feature

This file was deleted.

Loading

0 comments on commit 754e499

Please sign in to comment.