Skip to content

Commit

Permalink
Merge pull request #5438 from BacLuc/apply-cs-fix
Browse files Browse the repository at this point in the history
api: apply cs-fix
  • Loading branch information
pmattmann authored Jun 28, 2024
2 parents 950cdb5 + f15889d commit 79ee1a3
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api/src/Metadata/Resource/Factory/UriTemplateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected function allowsActionParameter(string $uriTemplateBase, ResourceMetada
* - any uriTemplate, which doesn't start with the same $uriTemplateBase
*/
if ($operation instanceof HttpOperation) {
if (preg_match('/^\/?'.preg_quote($uriTemplateBase, '/').'.*\\/?{.*}\\/.+$/', $operation->getUriTemplate() ?? '')) {
if (preg_match('/^\/?'.preg_quote($uriTemplateBase, '/').'.*\/?{.*}\/.+$/', $operation->getUriTemplate() ?? '')) {
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion api/src/Util/ClassInfoTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private function getObjectClass(object $object): string {
*/
private function getRealClassName(string $className): string {
// __CG__: Doctrine Common Marker for Proxy (ODM < 2.0 and ORM < 3.0)
$positionCg = strrpos($className, '\\__CG__\\');
$positionCg = strrpos($className, '\__CG__\\');

if (false === $positionCg) {
return $className;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testPatchColumnLayoutValidatesMissingParent() {
'violations' => [
[
'propertyPath' => 'parent',
'message' => 'This value should be of type App\\Entity\\ContentNode.',
'message' => 'This value should be of type App\Entity\ContentNode.',
],
],
]);
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/FirewallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private static function getEndPoints() {
$responseArray = $response->toArray();
$onlyUrls = array_map(fn (array $item) => $item['href'], $responseArray['_links']);

return array_map(fn (string $uriTemplate) => preg_replace('/\\{[^}]*}/', '', $uriTemplate), $onlyUrls);
return array_map(fn (string $uriTemplate) => preg_replace('/\{[^}]*}/', '', $uriTemplate), $onlyUrls);
}

private static function isProtectedByFirewall(mixed $endpoint): bool {
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/SnapshotTests/EndpointPerformanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private static function getCollectionEndpoints() {

$responseArray = $response->toArray();
$onlyUrls = array_map(fn (array $item) => $item['href'], $responseArray['_links']);
$withoutParameters = array_map(fn (string $uriTemplate) => preg_replace('/\\{[^}]*}/', '', $uriTemplate), $onlyUrls);
$withoutParameters = array_map(fn (string $uriTemplate) => preg_replace('/\{[^}]*}/', '', $uriTemplate), $onlyUrls);
$normalEndpoints = array_filter($withoutParameters, function (string $endpoint) {
// @noinspection PhpDuplicateMatchArmBodyInspection
return match ($endpoint) {
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/SnapshotTests/ResponseSnapshotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static function getCollectionEndpoints() {

$responseArray = $response->toArray();
$onlyUrls = array_map(fn (array $item) => $item['href'], $responseArray['_links']);
$withoutParameters = array_map(fn (string $uriTemplate) => preg_replace('/\\{[^}]*}/', '', $uriTemplate), $onlyUrls);
$withoutParameters = array_map(fn (string $uriTemplate) => preg_replace('/\{[^}]*}/', '', $uriTemplate), $onlyUrls);
$normalEndpoints = array_filter($withoutParameters, function (string $endpoint) {
// @noinspection PhpDuplicateMatchArmBodyInspection
return match ($endpoint) {
Expand Down
4 changes: 2 additions & 2 deletions api/tests/HttpCache/PurgeHttpCacheListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ protected function setUp(): void {
$classMetadataProphecy = $this->prophesize(ClassMetadata::class);
$classMetadataProphecy->getAssociationMappings()->willReturn([
'relatedDummy' => [
'targetEntity' => 'App\\Tests\\HttpCache\\Entity\\RelatedDummy',
'targetEntity' => 'App\Tests\HttpCache\Entity\RelatedDummy',
'isOwningSide' => true,
'inversedBy' => 'dummies',
'mappedBy' => null,
],
'relatedOwningDummy' => [
'targetEntity' => 'App\\Tests\\HttpCache\\Entity\\RelatedOwningDummy',
'targetEntity' => 'App\Tests\HttpCache\Entity\RelatedOwningDummy',
'isOwningSide' => true,
'inversedBy' => 'ownedDummy',
'mappedBy' => null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function testNormalizeReplacesLinkArrayWithSingleFilteredCollectionLinkBa
$this->uriTemplateFactory
->expects($this->once())
->method('createFromResourceClass')
->with('App\\Entity\\DummyEntity')
->with('App\Entity\DummyEntity')
->willReturn(['/relatedEntities{/id}{?test_param}', true])
;
$this->uriTemplate
Expand Down Expand Up @@ -498,7 +498,7 @@ public function getFilterValue(): string {
return '';
}

#[RelatedCollectionLink('App\\Entity\\DummyEntity', ['test_param' => 'filterValue'])]
#[RelatedCollectionLink('App\Entity\DummyEntity', ['test_param' => 'filterValue'])]
public function getRelatedEntities(): array {
return [];
}
Expand Down

0 comments on commit 79ee1a3

Please sign in to comment.