@@ -90,18 +90,18 @@ discard block |
||
90 | 90 | $pathParts = \pathinfo($object->getAvatarUrl()); |
91 | 91 | $assetId = \sha1($pathParts['filename']); |
92 | 92 | if (null !== $object->getSlug()) { |
93 | - $assetId = $object->getSlug() . '_' . $assetId; |
|
93 | + $assetId = $object->getSlug().'_'.$assetId; |
|
94 | 94 | } |
95 | 95 | $existingAvatar = $this->entityManager->getRepository(Image::class)->findBy(['assetId' => $assetId]); |
96 | 96 | if (\count($existingAvatar) > 0) { |
97 | - $object->setAvatarUrl((string)\reset($existingAvatar)); |
|
97 | + $object->setAvatarUrl((string) \reset($existingAvatar)); |
|
98 | 98 | |
99 | 99 | return $object; |
100 | 100 | } |
101 | 101 | |
102 | 102 | try { |
103 | - $tempDirectory = $this->cacheDirectory . \DIRECTORY_SEPARATOR . 'downloaded_avatars'; |
|
104 | - $tempLocation = $tempDirectory . \DIRECTORY_SEPARATOR . \sha1($assetId . date('his')); |
|
103 | + $tempDirectory = $this->cacheDirectory.\DIRECTORY_SEPARATOR.'downloaded_avatars'; |
|
104 | + $tempLocation = $tempDirectory.\DIRECTORY_SEPARATOR.\sha1($assetId.date('his')); |
|
105 | 105 | if (!$filesystem->exists($tempDirectory)) { |
106 | 106 | $filesystem->mkdir($tempDirectory); |
107 | 107 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $this->entityManager->persist($image); |
134 | 134 | |
135 | 135 | $object->setAvatar($avatar); |
136 | - $object->setAvatarUrl((string)$image); |
|
136 | + $object->setAvatarUrl((string) $image); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $object; |
@@ -86,7 +86,7 @@ |
||
86 | 86 | unset($server['HTTP_Authorization']); |
87 | 87 | } |
88 | 88 | |
89 | - if(!array_key_exists("HTTP_HOST", $server)) { |
|
89 | + if (!array_key_exists("HTTP_HOST", $server)) { |
|
90 | 90 | $server['HTTP_HOST'] = 'localhost'; |
91 | 91 | } |
92 | 92 |
@@ -77,12 +77,12 @@ |
||
77 | 77 | $paginator = new Paginator($eventDispatcher); |
78 | 78 | return $paginator->paginate( |
79 | 79 | $queryBuilder, |
80 | - (int)$criteria->get('firstResult', 0), |
|
81 | - (int)$criteria->get('maxResults', RepositoryInterface::MAX_RESULTS) |
|
80 | + (int) $criteria->get('firstResult', 0), |
|
81 | + (int) $criteria->get('maxResults', RepositoryInterface::MAX_RESULTS) |
|
82 | 82 | ); |
83 | 83 | } |
84 | 84 | |
85 | - return $this->getPaginator( $eventDispatcher,$queryBuilder, $paginationData); |
|
85 | + return $this->getPaginator($eventDispatcher, $queryBuilder, $paginationData); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | public function getCountByCriteria(Criteria $criteria): int |
@@ -129,7 +129,7 @@ |
||
129 | 129 | $name = ""; |
130 | 130 | $params = ['slug' => $article->getSlug()]; |
131 | 131 | DecoratingRoutingExtension::setupParams($article->getRoute(), $name, $params); |
132 | - $url = $this->urlGenerator->generate($name, $params , UrlGeneratorInterface::ABSOLUTE_URL); |
|
132 | + $url = $this->urlGenerator->generate($name, $params, UrlGeneratorInterface::ABSOLUTE_URL); |
|
133 | 133 | |
134 | 134 | return $this->getClient($feed)->removeArticle($url); |
135 | 135 | } |
@@ -154,7 +154,7 @@ |
||
154 | 154 | $form->handleRequest($request); |
155 | 155 | if ($form->isSubmitted() && $form->isValid()) { |
156 | 156 | $this->menuItemManager->update($menu); |
157 | - if($parent !== $menu->getParent()) { |
|
157 | + if ($parent !== $menu->getParent()) { |
|
158 | 158 | $this->menuItemManager->update($parent); |
159 | 159 | } |
160 | 160 | $this->menuItemRepository->flush(); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | public function loadConfigsFromPath($configsPath) |
127 | 127 | { |
128 | 128 | if (file_exists($configsPath)) { |
129 | - $files = $this->metadataCache->get('metadata_config_files', function () use ($configsPath) { |
|
129 | + $files = $this->metadataCache->get('metadata_config_files', function() use ($configsPath) { |
|
130 | 130 | $finder = new Finder(); |
131 | 131 | $finder->in($configsPath)->files()->name('*.{yaml,yml}'); |
132 | 132 | $files = []; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | public function addNewConfig(string $filePath) |
190 | 190 | { |
191 | 191 | $cacheKey = md5($filePath); |
192 | - $configuration = $this->metadataCache->get($cacheKey, function () use ($filePath) { |
|
192 | + $configuration = $this->metadataCache->get($cacheKey, function() use ($filePath) { |
|
193 | 193 | if (!is_readable($filePath)) { |
194 | 194 | throw new \InvalidArgumentException('Configuration file is not readable for parser'); |
195 | 195 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | public function registerMeta(Meta $meta = null) |
222 | 222 | { |
223 | 223 | $configuration = $meta->getConfiguration(); |
224 | - if(array_key_exists("name" ,$configuration)) { |
|
224 | + if (array_key_exists("name", $configuration)) { |
|
225 | 225 | $name = $configuration['name']; |
226 | 226 | if (!array_key_exists($name, $this->registeredMeta)) { |
227 | 227 | $this->registeredMeta[$name] = $configuration; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | { |
334 | 334 | return $this->getExtraCollection() |
335 | 335 | ->map( |
336 | - function (ArticleExtraFieldInterface $field) { |
|
336 | + function(ArticleExtraFieldInterface $field) { |
|
337 | 337 | return $field->toApiFormat(); |
338 | 338 | } |
339 | 339 | )->toArray(); |
@@ -536,8 +536,8 @@ discard block |
||
536 | 536 | if (is_array($value)) { |
537 | 537 | $this->addEmbedExtra(ArticleExtraEmbedField::newFromValue($key, $value)); |
538 | 538 | } else { |
539 | - if(is_int($value)) { |
|
540 | - $value = (string)$value; |
|
539 | + if (is_int($value)) { |
|
540 | + $value = (string) $value; |
|
541 | 541 | } |
542 | 542 | $this->addTextExtra(ArticleExtraTextField::newFromValue($key, $value)); |
543 | 543 | } |
@@ -100,7 +100,7 @@ |
||
100 | 100 | if (is_array($extraItem)) { |
101 | 101 | $extra = ArticleExtraEmbedField::newFromValue($key, $extraItem); |
102 | 102 | } else { |
103 | - $extra = ArticleExtraTextField::newFromValue($key, (string)$extraItem); |
|
103 | + $extra = ArticleExtraTextField::newFromValue($key, (string) $extraItem); |
|
104 | 104 | } |
105 | 105 | $extra->setArticle($article); |
106 | 106 | } |
@@ -691,7 +691,7 @@ |
||
691 | 691 | */ |
692 | 692 | public function isCurrent(): bool |
693 | 693 | { |
694 | - return ($this->isCurrent?true:false); |
|
694 | + return ($this->isCurrent ?true:false); |
|
695 | 695 | } |
696 | 696 | |
697 | 697 | /** |