Skip to content

Commit 0b5ed6f

Browse files
committed
Merge 3.4
2 parents 1c98fd4 + 88c6066 commit 0b5ed6f

File tree

19 files changed

+470
-26
lines changed

19 files changed

+470
-26
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,17 @@ jobs:
940940
path: ${{ steps.composercache.outputs.dir }}
941941
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
942942
restore-keys: ${{ runner.os }}-composer-
943-
# TODO: fix pmu windows path directory
943+
- name: Keep windows path
944+
id: get-cwd
945+
run: |
946+
cwd=$(php -r 'echo(str_replace("\\", "\\\\", $_SERVER["argv"][1]));' '${{ github.workspace }}')
947+
echo cwd=$cwd >> $GITHUB_OUTPUT
948+
shell: bash
944949
- name: Update project dependencies
945950
run: |
946951
composer global require soyuka/pmu
947952
composer global config allow-plugins.soyuka/pmu true --no-interaction
948-
composer global link . --working-directory=${{ github.workspace }}
953+
composer global link . --working-directory='${{ steps.get-cwd.outputs.cwd }}'
949954
- name: Clear test app cache
950955
run: tests/Fixtures/app/console cache:clear --ansi
951956
- name: Run Behat tests
@@ -1223,3 +1228,4 @@ jobs:
12231228
composer run-script build
12241229
composer run-script test
12251230
working-directory: 'src/Laravel'
1231+

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@
1010

1111
* [0d5f35683](https://github.com/api-platform/core/commit/0d5f356839eb6aa9f536044abe4affa736553e76) feat(laravel): laravel component (#5882)
1212

13+
## v3.4.0-alpha.2
14+
15+
### Deprecations:
16+
17+
Namespaces like `ApiPlatform/Api` or `ApiPlatform/Util` are deprecated and will be removed in 4.0.
18+
You should now install `api-platform/symfony` instead of `api-platform/core`.
19+
20+
### Bug fixes
21+
22+
* [3c5aea80f](https://github.com/api-platform/core/commit/3c5aea80fdbed20216764f6d721fe4f37cf2889d) fix(symfony): load isApiResource metadata (#6562)
23+
* [61af0cc90](https://github.com/api-platform/core/commit/61af0cc90c1e095edb12e32ef433a742ef46637e) fix(doctrine): allow doctrine/dbal:^4
24+
* [e063b80af](https://github.com/api-platform/core/commit/e063b80afe012ca4a6c8999de55b59193e8ae0ae) fix: parameter context for filters (#6535)
25+
* [e22392193](https://github.com/api-platform/core/commit/e22392193bb1fc71ece5abf393fa54b0745fc287) fix(state): security parameter with listeners (#6457)
26+
27+
### Features
28+
29+
* [05e75be83](https://github.com/api-platform/core/commit/05e75be834c629e0487caaaedfe9fdf0bd5a7226) feat(doctrine): add new filter for filtering an entity using PHP backed enum, resolves #6506 (#6547) (#6560)
30+
* [0b985ae76](https://github.com/api-platform/core/commit/0b985ae760bc4689d3f5bbacebb21b35b334d0be) feat(state): add security to parameters (#6435)
31+
* [26d5cbb9b](https://github.com/api-platform/core/commit/26d5cbb9ba996f793e50eff3eab578ea0753d243) feat: deprecate query parameter validator (#6454)
32+
* [63ccfd58c](https://github.com/api-platform/core/commit/63ccfd58c95b5aa4aa0353eb122d96ef35187222) feat: BackedEnum resources (#6309)
33+
* [65296eaf1](https://github.com/api-platform/core/commit/65296eaf1eb18dc725e9316e9ab49b191aae43a3) feat(openapi): allow optional request body content (#6374)
34+
* [7399fcf7e](https://github.com/api-platform/core/commit/7399fcf7eaf28cd649d137da1fdd54f69093e275) feat(symfony): skip error handler (#6463)
35+
* [74986cb55](https://github.com/api-platform/core/commit/74986cb552182dc645bd1fc967faa0954dd59e0a) feat: inflector as service (#6447)
36+
* [b47edb2a4](https://github.com/api-platform/core/commit/b47edb2a499c34e79c167f963e3a626a3e9d040a) feat(serializer): context IRI in HAL or JsonApi format (#6215)
37+
* [db1241c66](https://github.com/api-platform/core/commit/db1241c66a08d226f57d8d61e0ec519071c6afdb) feat(openapi): make open_api_override_responses act on default 404 response generation (#6551)
38+
1339
## v3.4.0-alpha.1
1440

1541
### Bug fixes
@@ -30,6 +56,19 @@
3056
* [74986cb55](https://github.com/api-platform/core/commit/74986cb552182dc645bd1fc967faa0954dd59e0a) feat: inflector as service (#6447)
3157
* [b47edb2a4](https://github.com/api-platform/core/commit/b47edb2a499c34e79c167f963e3a626a3e9d040a) feat(serializer): context IRI in HAL or JsonApi format (#6215)
3258

59+
## v3.3.12
60+
61+
### Bug fixes
62+
63+
* [0a461d749](https://github.com/api-platform/core/commit/0a461d749b7b4ac706f3b7b6138a13cb6e4a9d2d) fix(symfony): allow schema restriction for collection like property from choice constraint (#6520)
64+
* [0e91b0451](https://github.com/api-platform/core/commit/0e91b045168fa74603a093b301546d604e7997ad) fix: use correct class in FilterValidationException deprecation message (#6549)
65+
* [2da8dd326](https://github.com/api-platform/core/commit/2da8dd32681fe9d51b0bdb343f60b98b4e9033d2) fix(symfony): replace tagged by tagged_iterator
66+
* [3b42c9ff2](https://github.com/api-platform/core/commit/3b42c9ff235de5feac555d0283c513a6e4643953) fix: deserialization path for not denormalizable relations collected errors (#6537)
67+
* [41deeb4e4](https://github.com/api-platform/core/commit/41deeb4e49c35d27cd902ea41ddaa3c8c492d8e4) fix(symfony): fix debug:api-resource command for class with multiple resources with same uriTemplate (#6505)
68+
* [52fd9818b](https://github.com/api-platform/core/commit/52fd9818b1d02dd89cac578e0762530079b5b42d) fix(elasticsearch): change normalize return type to compatible with other normalizers (#6493)
69+
* [b3d7c0768](https://github.com/api-platform/core/commit/b3d7c07682366cc387ceee904cadbdd85bad0c09) fix(openapi): allow null return type parameter
70+
>>>>>>> upstream/3.3
71+
3372
## v3.3.11
3473

3574
### Features

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"api-platform/ramsey-uuid": "^3.2 || ^4.0",
5151
"api-platform/jsonld": "^3.2 || ^4.0",
5252
"api-platform/serializer": "^3.2 || ^4.0",
53-
"api-platform/json-api": "^3.2 || ^4.0",
53+
"api-platform/json-api": "^3.3 || ^4.0",
5454
"api-platform/http-cache": "^3.2 || ^4.0",
5555
"api-platform/elasticsearch": "^3.2 || ^4.0",
5656
"api-platform/hydra": "^3.2 || ^4.0",
@@ -94,7 +94,7 @@
9494
"ramsey/uuid": "^4.0",
9595
"ramsey/uuid-doctrine": "^2.0",
9696
"soyuka/contexts": "^3.3.10",
97-
"soyuka/pmu": "^0.0.7",
97+
"soyuka/pmu": "^0.0.11",
9898
"soyuka/stubs-mongodb": "^1.0",
9999
"symfony/asset": "^6.4 || ^7.1",
100100
"symfony/browser-kit": "^6.4 || ^7.1",

src/Doctrine/Orm/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"symfony/property-info": "^6.4 || ^7.1"
3030
},
3131
"require-dev": {
32-
"api-platform/parameter-validator": "^3.2 || ^4.0",
3332
"phpspec/prophecy-phpunit": "^2.2",
3433
"phpunit/phpunit": "^11.2",
3534
"ramsey/uuid": "^4.0",

src/JsonApi/Tests/JsonSchema/SchemaFactoryTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ protected function setUp(): void
5959
definitionNameFactory: $definitionNameFactory,
6060
);
6161

62-
// $halSchemaFactory = new HalSchemaFactory($baseSchemaFactory);
63-
// $hydraSchemaFactory = new HydraSchemaFactory($halSchemaFactory);
64-
6562
$resourceClassResolver = $this->prophesize(ResourceClassResolverInterface::class);
6663

6764
$this->schemaFactory = new SchemaFactory(

src/JsonApi/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"api-platform/metadata": "^3.2 || ^4.0",
3434
"api-platform/serializer": "^3.2 || ^4.0",
3535
"api-platform/state": "^3.2 || ^4.0",
36-
"symfony/error-handler": "^7.1",
36+
"symfony/error-handler": "^6.4 || ^7.1",
3737
"symfony/http-foundation": "^6.4 || ^7.1"
3838
},
3939
"require-dev": {

src/Metadata/Property/Factory/ConcernsPropertyNameCollectionMetadataFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
namespace ApiPlatform\Metadata\Property\Factory;
1515

1616
use ApiPlatform\Metadata\ApiProperty;
17-
use ApiPlatform\Metadata\IsApiResource;
1817
use ApiPlatform\Metadata\Property\PropertyNameCollection;
1918

2019
/**
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace ApiPlatform\Metadata\Tests\Util;
15+
16+
use ApiPlatform\Metadata\Util\ClassInfoTrait;
17+
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Dummy;
18+
use PHPUnit\Framework\TestCase;
19+
20+
class ClassInfoTraitTest extends TestCase
21+
{
22+
private function getClassInfoTraitImplementation()
23+
{
24+
return new class {
25+
use ClassInfoTrait {
26+
ClassInfoTrait::getRealClassName as public;
27+
}
28+
};
29+
}
30+
31+
public function testDoctrineRealClassName(): void
32+
{
33+
$classInfo = $this->getClassInfoTraitImplementation();
34+
35+
$this->assertSame(Dummy::class, $classInfo->getRealClassName('Proxies\__CG__\ApiPlatform\Tests\Fixtures\TestBundle\Entity\Dummy'));
36+
}
37+
38+
public function testProxyManagerRealClassName(): void
39+
{
40+
$classInfo = $this->getClassInfoTraitImplementation();
41+
42+
$this->assertSame(Dummy::class, $classInfo->getRealClassName('MongoDBODMProxies\__PM__\ApiPlatform\Tests\Fixtures\TestBundle\Entity\Dummy\Generated'));
43+
}
44+
45+
public function testUnmarkedRealClassName(): void
46+
{
47+
$classInfo = $this->getClassInfoTraitImplementation();
48+
49+
$this->assertSame(Dummy::class, $classInfo->getRealClassName(Dummy::class));
50+
}
51+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace ApiPlatform\Metadata\Tests\Util;
15+
16+
use ApiPlatform\Metadata\Util\CloneTrait;
17+
use PHPUnit\Framework\TestCase;
18+
19+
/**
20+
* @author Quentin Barloy <[email protected]>
21+
*/
22+
class CloneTraitTest extends TestCase
23+
{
24+
use CloneTrait;
25+
26+
public function testScalarClone(): void
27+
{
28+
$this->assertSame(5, $this->clone(5));
29+
}
30+
31+
public function testObjectClone(): void
32+
{
33+
$data = new \stdClass();
34+
$result = $this->clone($data);
35+
36+
$this->assertNotSame($data, $result);
37+
$this->assertEquals($data, $result);
38+
}
39+
40+
public function testGeneratorClone(): void
41+
{
42+
$this->assertNull($this->clone($this->generator()));
43+
}
44+
45+
private function generator(): \Generator
46+
{
47+
yield 1;
48+
}
49+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace ApiPlatform\Metadata\Tests\Util;
15+
16+
use ApiPlatform\Metadata\Util\Reflection;
17+
use PHPUnit\Framework\TestCase;
18+
19+
/**
20+
* @author Amrouche Hamza <[email protected]>
21+
*/
22+
class ReflectionTest extends TestCase
23+
{
24+
public function testWithGoodMethodName(): void
25+
{
26+
$methodName = 'addGerard';
27+
$reflection = new Reflection();
28+
$return = $reflection->getProperty($methodName);
29+
$this->assertSame($return, 'Gerard');
30+
}
31+
32+
public function testWithBadMethodName(): void
33+
{
34+
$methodName = 'delGerard';
35+
$reflection = new Reflection();
36+
$return = $reflection->getProperty($methodName);
37+
$this->assertNotEquals($return, 'Gerard');
38+
$this->assertSame($return, null);
39+
}
40+
}

0 commit comments

Comments
 (0)