Skip to content

Commit

Permalink
Automatically fix coding style with php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasnatter committed Apr 9, 2021
1 parent b79daf0 commit d4c0f2c
Show file tree
Hide file tree
Showing 19 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Content/ArticleDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ private function getResource($uuid, $locale)
{
return $this->proxyFactory->createProxy(
ArticleDocument::class,
function (
function(
&$wrappedObject,
LazyLoadingInterface $proxy,
$method,
Expand Down
2 changes: 1 addition & 1 deletion Content/ArticleResourceItemFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private function getResource($uuid, $locale)
{
return $this->proxyFactory->createProxy(
ArticleDocument::class,
function (
function(
&$wrappedObject,
LazyLoadingInterface $proxy,
$method,
Expand Down
2 changes: 1 addition & 1 deletion Controller/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function cgetAction(Request $request)
);
$fieldDescriptors = array_filter(
$fieldDescriptors,
function (FieldDescriptorInterface $fieldDescriptor) use ($fields) {
function(FieldDescriptorInterface $fieldDescriptor) use ($fields) {
return in_array($fieldDescriptor->getName(), $fields);
}
);
Expand Down
4 changes: 2 additions & 2 deletions Controller/VersionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function cgetAction(Request $request, $uuid)
$versions = array_reverse(
array_filter(
$document->getVersions(),
function ($version) use ($locale) {
function($version) use ($locale) {
/** @var Version $version */
return $version->getLocale() === $locale;
}
Expand All @@ -65,7 +65,7 @@ function ($version) use ($locale) {

$userIds = array_unique(
array_map(
function ($version) {
function($version) {
/** @var Version $version */
return $version->getAuthor();
},
Expand Down
6 changes: 3 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ public function getConfigTreeBuilder()
->useAttributeAsKey('locale')
->beforeNormalization()
->ifString()
->then(function ($v) {
->then(function($v) {
return ['default' => $v];
})
->end()
->prototype('scalar')->end()
->end()
->arrayNode('default_additional_webspaces')
->beforeNormalization()
->ifTrue(function ($v) {
->ifTrue(function($v) {
return count(array_filter(array_keys($v), 'is_string')) <= 0;
})
->then(function ($v) {
->then(function($v) {
return ['default' => $v];
})
->end()
Expand Down
4 changes: 2 additions & 2 deletions Document/Structure/ContentProxyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function createContentProxy(StructureInterface $structure, array $data)
{
return $this->proxyFactory->createProxy(
\ArrayObject::class,
function (
function(
&$wrappedObject,
LazyLoadingInterface $proxy,
$method,
Expand Down Expand Up @@ -103,7 +103,7 @@ public function createViewProxy(StructureInterface $structure, array $data)
{
return $this->proxyFactory->createProxy(
\ArrayObject::class,
function (
function(
&$wrappedObject,
LazyLoadingInterface $proxy,
$method,
Expand Down
2 changes: 1 addition & 1 deletion Markup/ArticleLinkProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function getConfiguration()
$tabs = null;
if (1 < count($this->types)) {
$tabs = array_map(
function ($type) {
function($type) {
return ['title' => $type['translation_key']];
},
$this->types
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Content/PageTreeRouteContentTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function testWriteGeneratePath()
$route->getPath()->willReturn('/test-article');

$route->setPath('/test-page/test-article')->shouldBeCalled()->will(
function () use ($route) {
function() use ($route) {
$route->getPath()->willReturn('/test-page/test-article');
}
);
Expand Down Expand Up @@ -307,7 +307,7 @@ public function testWriteGeneratePathRoot()
$route->getPath()->willReturn('/test-article');

$route->setPath('/test-article')->shouldBeCalled()->will(
function () use ($route) {
function() use ($route) {
$route->getPath()->willReturn('/test-article');
}
);
Expand Down
20 changes: 10 additions & 10 deletions Tests/Functional/Controller/ArticleControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public function testCGetGhost()
$this->assertCount(2, $response['_embedded']['articles']);

$items = array_map(
function ($item) {
function($item) {
return [$item['id'], $item['title']];
},
$response['_embedded']['articles']
Expand All @@ -451,7 +451,7 @@ function ($item) {
$this->assertCount(2, $response['_embedded']['articles']);

$items = array_map(
function ($item) {
function($item) {
return [$item['id'], $item['title']];
},
$response['_embedded']['articles']
Expand Down Expand Up @@ -525,7 +525,7 @@ public function testCGetShadow()
$this->assertCount(3, $response['_embedded']['articles']);

$items = array_map(
function ($item) {
function($item) {
return [$item['id'], $item['title']];
},
$response['_embedded']['articles']
Expand All @@ -544,7 +544,7 @@ function ($item) {
$this->assertCount(3, $response['_embedded']['articles']);

$items = array_map(
function ($item) {
function($item) {
return [$item['id'], $item['title'], $item['localizationState']];
},
$response['_embedded']['articles']
Expand Down Expand Up @@ -719,7 +719,7 @@ public function testCGet()
$this->assertCount(2, $response['_embedded']['articles']);

$items = array_map(
function ($item) {
function($item) {
return [$item['id'], $item['title']];
},
$response['_embedded']['articles']
Expand Down Expand Up @@ -920,7 +920,7 @@ public function testCGetTypes()
$this->assertCount(1, $response['_embedded']['articles']);

$items = array_map(
function ($item) {
function($item) {
return [$item['id'], $item['title']];
},
$response['_embedded']['articles']
Expand All @@ -939,7 +939,7 @@ function ($item) {
$this->assertCount(1, $response['_embedded']['articles']);

$items = array_map(
function ($item) {
function($item) {
return [$item['id'], $item['title']];
},
$response['_embedded']['articles']
Expand Down Expand Up @@ -1191,7 +1191,7 @@ public function testCopyLocale()
$this->assertCount(2, $response['_embedded']['articles']);

$items = array_map(
function ($item) {
function($item) {
return [$item['id'], $item['title']];
},
$response['_embedded']['articles']
Expand All @@ -1208,7 +1208,7 @@ function ($item) {
$this->assertCount(2, $response['_embedded']['articles']);

$items = array_map(
function ($item) {
function($item) {
return [$item['id'], $item['title'], $item['localizationState']];
},
$response['_embedded']['articles']
Expand Down Expand Up @@ -1236,7 +1236,7 @@ function ($item) {
$this->assertCount(2, $response['_embedded']['articles']);

$items = array_map(
function ($item) {
function($item) {
return [$item['id'], $item['title'], $item['localizationState']];
},
$response['_embedded']['articles']
Expand Down
6 changes: 3 additions & 3 deletions Tests/Functional/Markup/ArticleLinkProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function testPreload()
];

$uuids = array_map(
function (array $data) {
function(array $data) {
return $data['id'];
},
$articles
Expand All @@ -73,7 +73,7 @@ public function testPreloadPublished()
];

$uuids = array_map(
function (array $data) {
function(array $data) {
return $data['id'];
},
$articles
Expand Down Expand Up @@ -102,7 +102,7 @@ public function testPreloadMoreThan10()
];

$uuids = array_map(
function (array $data) {
function(array $data) {
return $data['id'];
},
$articles
Expand Down
6 changes: 3 additions & 3 deletions Tests/Unit/Content/ArticleSelectionContentTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testGetContentData()
{
$ids = ['123-123-123', '321-321-321'];
$articles = array_map(
function ($id) {
function($id) {
return new ArticleViewDocument($id);
},
array_reverse($ids)
Expand All @@ -52,11 +52,11 @@ function ($id) {
$repository->createSearch()->willReturn($search->reveal());
$search->addQuery(
Argument::that(
function (IdsQuery $query) use ($ids) {
function(IdsQuery $query) use ($ids) {
return $query->toArray() === [
'ids' => [
'values' => array_map(
function ($id) {
function($id) {
return $id . '-de';
},
$ids
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Document/Subscriber/ArticlePageSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ protected function setUp()
$this->factory->getStructureMetadata('article_page', 'default')->willReturn($this->metadata->reveal());

$this->slugifier->slugify(Argument::type('string'))->will(
function ($arguments) {
function($arguments) {
return Urlizer::urlize($arguments[0]);
}
);
$this->nameResolver->resolveName(Argument::type(NodeInterface::class), Argument::type('string'))->will(
function ($arguments) {
function($arguments) {
return $arguments[1];
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function testResolveContentForArticleOnPostSerialize()
$object->getStructureType()->willReturn('default');
$object->getChildren()->willReturn(
array_map(
function ($child) {
function($child) {
return $child->reveal();
},
$children
Expand Down Expand Up @@ -167,7 +167,7 @@ public function testResolveContentForArticleOnPostSerializePage2()
$object->getStructureType()->shouldNotBeCalled();
$object->getChildren()->willReturn(
array_map(
function ($child) {
function($child) {
return $child->reveal();
},
$children
Expand Down Expand Up @@ -212,7 +212,7 @@ public function testResolveContentForArticleOnPostSerializeUnknownDocument()
$object->getStructureType()->shouldNotBeCalled();
$object->getChildren()->willReturn(
array_map(
function ($child) {
function($child) {
return $child->reveal();
},
$children
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Document/Subscriber/PageSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function testHandleReorder()
$parentNode = $this->prophesize(NodeInterface::class);
$parentNode->getNodes()->willReturn(
array_map(
function ($item) {
function($item) {
return $item->reveal();
},
$nodes
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Document/Subscriber/RoutableSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected function setUp()
$this->node->getIdentifier()->willReturn('123-123-123');

$this->conflictResolver->resolve(Argument::type(RouteInterface::class))->will(
function (array $arguments) {
function(array $arguments) {
return $arguments[0];
}
);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/PageTree/AutomationPageTreeUpdaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testUpdate()

$this->taskManager->create(
Argument::that(
function (TaskInterface $task) {
function(TaskInterface $task) {
return BasePageDocument::class === $task->getEntityClass()
&& '123-123-123' === $task->getEntityId()
&& 'de' === $task->getLocale()
Expand Down
8 changes: 4 additions & 4 deletions Tests/Unit/Preview/ArticleObjectProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testSerialize()
$object->reveal(),
'json',
Argument::that(
function (SerializationContext $context) {
function(SerializationContext $context) {
return $context->shouldSerializeNull()
&& $context->attributes->get('groups')->get() === ['preview'];
}
Expand Down Expand Up @@ -124,7 +124,7 @@ public function testSerializePage()
$article->reveal(),
'json',
Argument::that(
function (SerializationContext $context) {
function(SerializationContext $context) {
return $context->shouldSerializeNull()
&& $context->attributes->get('groups')->get() === ['preview'];
}
Expand All @@ -146,7 +146,7 @@ public function testDeserialize()
ArticleDocument::class,
'json',
Argument::that(
function (DeserializationContext $context) {
function(DeserializationContext $context) {
return $context->shouldSerializeNull()
&& $context->attributes->get('groups')->get() === ['preview'];
}
Expand Down Expand Up @@ -176,7 +176,7 @@ public function testDeserializePage()
ArticleDocument::class,
'json',
Argument::that(
function (DeserializationContext $context) {
function(DeserializationContext $context) {
return $context->shouldSerializeNull()
&& $context->attributes->get('groups')->get() === ['preview'];
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Repository/ArticleViewDocumentRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function testFindSimilar(

$documentIterator = $this->prophesize(DocumentIterator::class);

$this->repository->findDocuments(Argument::that(function (Search $search) use ($expectedSearch, $limit) {
$this->repository->findDocuments(Argument::that(function(Search $search) use ($expectedSearch, $limit) {
$this->assertEquals($expectedSearch, $search->getQueries()->toArray());
$this->assertEquals($limit, $search->getSize());
$this->assertCount(0, $search->getSorts());
Expand Down Expand Up @@ -216,7 +216,7 @@ public function testFindRecent(

$documentIterator = $this->prophesize(DocumentIterator::class);

$this->repository->findDocuments(Argument::that(function (Search $search) use ($expectedSearch, $limit) {
$this->repository->findDocuments(Argument::that(function(Search $search) use ($expectedSearch, $limit) {
$this->assertEquals($expectedSearch, $search->getQueries()->toArray());
$this->assertEquals($limit, $search->getSize());
$this->assertCount(1, $search->getSorts());
Expand Down
Loading

0 comments on commit d4c0f2c

Please sign in to comment.