Skip to content

Commit

Permalink
Merge 662e69a into 23141d8
Browse files Browse the repository at this point in the history
  • Loading branch information
stiffroy committed Jan 29, 2021
2 parents 23141d8 + 662e69a commit 1a0deba
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -522,9 +522,9 @@ jobs:
- name: Update project dependencies
run: |
composer update --no-interaction --no-progress --ansi
composer why doctrine/reflection
# - name: Require Symfony Uid
# run: composer require symfony/uid --dev --no-interaction --no-progress --ansi
# composer why doctrine/reflection
- name: Require Symfony Uid
run: composer require symfony/uid --dev --no-interaction --no-progress --ansi
- name: Install PHPUnit
run: vendor/bin/simple-phpunit --version
- name: Clear test app cache
Expand Down
4 changes: 2 additions & 2 deletions src/Annotation/ApiResource.php
Expand Up @@ -148,7 +148,7 @@ final class ApiResource
* @param bool|array $mercure https://api-platform.com/docs/core/mercure
* @param bool $messenger https://api-platform.com/docs/core/messenger/#dispatching-a-resource-through-the-message-bus
* @param array $normalizationContext https://api-platform.com/docs/core/serialization/#using-serialization-groups
* @param array $openapiContext https://api-platform.com/docs/core/swagger/#using-the-openapi-and-swagger-contexts
* @param array $openapiContext https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
* @param array $order https://api-platform.com/docs/core/default-order/#overriding-default-order
* @param string|false $output https://api-platform.com/docs/core/dto/#specifying-an-input-or-an-output-data-representation
* @param bool $paginationClientEnabled https://api-platform.com/docs/core/pagination/#for-a-specific-resource-1
Expand All @@ -167,7 +167,7 @@ final class ApiResource
* @param string $securityPostDenormalizeMessage https://api-platform.com/docs/core/security/#configuring-the-access-control-error-message
* @param bool $stateless
* @param string $sunset https://api-platform.com/docs/core/deprecations/#setting-the-sunset-http-header-to-indicate-when-a-resource-or-an-operation-will-be-removed
* @param array $swaggerContext https://api-platform.com/docs/core/swagger/#using-the-openapi-and-swagger-contexts
* @param array $swaggerContext https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
* @param array $validationGroups https://api-platform.com/docs/core/validation/#using-validation-groups
* @param int $urlGenerationStrategy
*
Expand Down
Expand Up @@ -73,7 +73,7 @@ private function tracePersisters($data, array $context = [])
$found = false;
foreach ($this->persisters as $persister) {
if (
($this->persistersResponse[\get_class($persister)] = $found ? false : $persister->supports($data))
($this->persistersResponse[\get_class($persister)] = $found ? false : $persister->supports($data, $context))
&&
!($persister instanceof ResumableDataPersisterInterface && $persister->resumable()) && !$found
) {
Expand Down
2 changes: 2 additions & 0 deletions src/OpenApi/Model/Components.php
Expand Up @@ -38,6 +38,8 @@ public function __construct(\ArrayObject $schemas = null, \ArrayObject $response
$this->securitySchemes = $securitySchemes;
$this->links = $links;
$this->callbacks = $callbacks;

$this->schemas->ksort();
}

public function getSchemas(): ?\ArrayObject
Expand Down
6 changes: 4 additions & 2 deletions src/OpenApi/Model/Paths.php
Expand Up @@ -15,7 +15,7 @@

final class Paths
{
private $paths;
private $paths = [];

public function addPath(string $path, PathItem $pathItem)
{
Expand All @@ -29,6 +29,8 @@ public function getPath(string $path): ?PathItem

public function getPaths(): array
{
return $this->paths ?? [];
ksort($this->paths);

return $this->paths;
}
}
Expand Up @@ -60,6 +60,17 @@ public function testRemove($persister, $expected)
$this->assertSame($expected, array_values($result));
}

public function testSupports()
{
$context = ['ok' => true];
$persister = $this->prophesize(DataPersisterInterface::class);
$persister->supports('', $context)->willReturn(true)->shouldBeCalled();
$chain = new ChainDataPersister([$persister->reveal()]);
$persister->persist('', $context)->shouldBeCalled();
$dataPersister = new TraceableChainDataPersister($chain);
$dataPersister->persist('', $context);
}

public function dataPersisterProvider(): iterable
{
yield [
Expand Down

0 comments on commit 1a0deba

Please sign in to comment.