@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | |
| 385 | 385 | private function mapNames(array $values): array |
| 386 | 386 | { |
| 387 | - return array_map(function ($subject) { |
|
| 387 | + return array_map(function($subject) { |
|
| 388 | 388 | if (\is_array($subject) && \array_key_exists('name', $subject)) { |
| 389 | 389 | return $subject['name']; |
| 390 | 390 | } |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | private function mapCodes(array $values): array |
| 397 | 397 | { |
| 398 | - return array_map(function ($subject) { |
|
| 398 | + return array_map(function($subject) { |
|
| 399 | 399 | if (\is_array($subject) && \array_key_exists('code', $subject)) { |
| 400 | 400 | return $subject['code']; |
| 401 | 401 | } |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | |
| 407 | 407 | private function mapSchemes(array $values): array |
| 408 | 408 | { |
| 409 | - return array_map(function ($subject) { |
|
| 409 | + return array_map(function($subject) { |
|
| 410 | 410 | if (\is_array($subject) && \array_key_exists('scheme', $subject)) { |
| 411 | 411 | return $subject['scheme']; |
| 412 | 412 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | $package = $event->getPackage(); |
| 49 | 49 | $article = $event->getArticle(); |
| 50 | 50 | |
| 51 | - $groups = $package->getGroups()->filter(function ($group) { |
|
| 51 | + $groups = $package->getGroups()->filter(function($group) { |
|
| 52 | 52 | return GroupInterface::TYPE_RELATED !== $group->getType(); |
| 53 | 53 | }); |
| 54 | 54 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | $this->removeOldRelatedArticles($article); |
| 51 | 51 | |
| 52 | - $relatedItemsGroups = $package->getGroups()->filter(function ($group) { |
|
| 52 | + $relatedItemsGroups = $package->getGroups()->filter(function($group) { |
|
| 53 | 53 | return GroupInterface::TYPE_RELATED === $group->getType(); |
| 54 | 54 | }); |
| 55 | 55 | |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | |
| 144 | 144 | $ids = array_column($rules['tenants'], 'tenant'); |
| 145 | 145 | $ids = array_unique($ids); |
| 146 | - $tenants = array_filter($rules['tenants'], function ($key, $value) use ($ids) { |
|
| 146 | + $tenants = array_filter($rules['tenants'], function($key, $value) use ($ids) { |
|
| 147 | 147 | return array_key_exists($value, $ids); |
| 148 | 148 | }, ARRAY_FILTER_USE_BOTH); |
| 149 | 149 | |
@@ -194,6 +194,9 @@ |
||
| 194 | 194 | return $route; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | + /** |
|
| 198 | + * @param string $name |
|
| 199 | + */ |
|
| 197 | 200 | private function ensureRouteExists($name) |
| 198 | 201 | { |
| 199 | 202 | if (null !== $this->get('swp.repository.route')->findOneByName($name)) { |
@@ -268,6 +268,9 @@ |
||
| 268 | 268 | return $list; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | + /** |
|
| 272 | + * @param null|string $name |
|
| 273 | + */ |
|
| 271 | 274 | private function ensureContentListExists($name) |
| 272 | 275 | { |
| 273 | 276 | if (null !== $this->get('swp.repository.content_list')->findOneByName($name)) { |
@@ -216,6 +216,9 @@ |
||
| 216 | 216 | return new SingleResourceResponse($form, new ResponseContext(400)); |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | + /** |
|
| 220 | + * @param ContentListInterface $listId |
|
| 221 | + */ |
|
| 219 | 222 | private function findByContentOr404($listId, $contentId): ContentListItemInterface |
| 220 | 223 | { |
| 221 | 224 | $listItem = $this->get('swp.repository.content_list_item')->findOneBy([ |
@@ -85,6 +85,10 @@ |
||
| 85 | 85 | return new SingleResourceResponse($form, new ResponseContext(400)); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | + /** |
|
| 89 | + * @param \SWP\Bundle\CoreBundle\Model\ContentListInterface $contentBucket |
|
| 90 | + * @param \SWP\Bundle\FacebookInstantArticlesBundle\Model\PageInterface $facebookPage |
|
| 91 | + */ |
|
| 88 | 92 | private function checkIfFeedExists($contentBucket, $facebookPage) |
| 89 | 93 | { |
| 90 | 94 | if (null !== $this->get('swp.repository.facebook_instant_articles_feed')->findOneBy([ |
@@ -61,6 +61,9 @@ discard block |
||
| 61 | 61 | return new ResourcesListResponse($items); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | + /** |
|
| 65 | + * @param string $id |
|
| 66 | + */ |
|
| 64 | 67 | private function findOr404($id): ?SlideshowInterface |
| 65 | 68 | { |
| 66 | 69 | if (null === $slideshow = $this->get('swp.repository.slideshow')->findOneById($id)) { |
@@ -70,6 +73,9 @@ discard block |
||
| 70 | 73 | return $slideshow; |
| 71 | 74 | } |
| 72 | 75 | |
| 76 | + /** |
|
| 77 | + * @param string $id |
|
| 78 | + */ |
|
| 73 | 79 | private function findArticleOr404($id) |
| 74 | 80 | { |
| 75 | 81 | if (null === $article = $this->get('swp.repository.article')->findOneById($id)) { |