@@ -44,7 +44,7 @@ |
||
44 | 44 | */ |
45 | 45 | public function execute($repository) |
46 | 46 | { |
47 | - if (! $repository instanceof Record && ! $repository instanceof Story) { |
|
47 | + if (!$repository instanceof Record && !$repository instanceof Story) { |
|
48 | 48 | throw new \InvalidArgumentException('Invalid repository type (story or record required).'); |
49 | 49 | } |
50 | 50 |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | self::RECORD_TYPE_VIDEO |
245 | 245 | ); |
246 | 246 | |
247 | - if (! in_array($recordType, $allowedTypes, true)) { |
|
247 | + if (!in_array($recordType, $allowedTypes, true)) { |
|
248 | 248 | throw new \InvalidArgumentException( |
249 | 249 | sprintf('Record type must be one of the RECORD_TYPE_* values, %s given.', $recordType) |
250 | 250 | ); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | self::SEARCH_STORIES |
270 | 270 | ); |
271 | 271 | |
272 | - if (! in_array($searchType, $allowedTypes, true)) { |
|
272 | + if (!in_array($searchType, $allowedTypes, true)) { |
|
273 | 273 | throw new \InvalidArgumentException('Search type must be one of the SEARCH_* values'); |
274 | 274 | } |
275 | 275 | |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | |
366 | 366 | private function validateFieldName($fieldName, $errorMessage) |
367 | 367 | { |
368 | - if (! is_string($fieldName) || trim($fieldName) === '') { |
|
368 | + if (!is_string($fieldName) || trim($fieldName) === '') { |
|
369 | 369 | throw new \InvalidArgumentException($errorMessage); |
370 | 370 | } |
371 | 371 | } |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | |
429 | 429 | private function buildQueryTerm() |
430 | 430 | { |
431 | - if (! $this->conditionBuilder) { |
|
431 | + if (!$this->conditionBuilder) { |
|
432 | 432 | return $this->query; |
433 | 433 | } |
434 | 434 |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $locale = $this->defaultLocale; |
82 | 82 | } |
83 | 83 | |
84 | - if (! $this->fieldsMap->hasAlias($field, $locale)) { |
|
84 | + if (!$this->fieldsMap->hasAlias($field, $locale)) { |
|
85 | 85 | if ($locale !== $this->defaultLocale) { |
86 | 86 | return $this->getStoryField($story, $field, $this->defaultLocale); |
87 | 87 | } |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function addMapping($definition, $subDefinition) |
40 | 40 | { |
41 | - if (! is_array($subDefinition)) { |
|
42 | - $subDefinition = [ 'default' => $subDefinition ]; |
|
41 | + if (!is_array($subDefinition)) { |
|
42 | + $subDefinition = ['default' => $subDefinition]; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | $this->map[$definition] = $subDefinition; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function getSubDefinition($definition, $type = null) |
68 | 68 | { |
69 | - if (! $this->hasSubDefinition($definition, $type)) { |
|
69 | + if (!$this->hasSubDefinition($definition, $type)) { |
|
70 | 70 | throw new \OutOfBoundsException(sprintf('No subdef configured for definition "%s".', $definition)); |
71 | 71 | } |
72 | 72 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | protected function loadInternal(array $mergedConfig, ContainerBuilder $container) |
45 | 45 | { |
46 | - $locator = new FileLocator(__DIR__ . '/../Resources/config'); |
|
46 | + $locator = new FileLocator(__DIR__.'/../Resources/config'); |
|
47 | 47 | $loader = new YamlFileLoader($container, $locator); |
48 | 48 | |
49 | 49 | $loader->load('services.yml'); |
@@ -59,23 +59,23 @@ discard block |
||
59 | 59 | $factory |
60 | 60 | ]); |
61 | 61 | |
62 | - $container->setDefinition('phraseanet.factories.' . $name, $factory); |
|
62 | + $container->setDefinition('phraseanet.factories.'.$name, $factory); |
|
63 | 63 | |
64 | 64 | $entityManager = new Definition(EntityManager::class, [$name]); |
65 | 65 | $entityManager->setFactory([ |
66 | - new Reference('phraseanet.factories.' . $name), |
|
66 | + new Reference('phraseanet.factories.'.$name), |
|
67 | 67 | 'getEntityManager' |
68 | 68 | ]); |
69 | 69 | |
70 | - $container->setDefinition('phraseanet.em.' . $name, $entityManager); |
|
70 | + $container->setDefinition('phraseanet.em.'.$name, $entityManager); |
|
71 | 71 | |
72 | 72 | if ($name == $mergedConfig['default_instance']) { |
73 | 73 | $registry->addMethodCall('setDefaultEntityManager', [ |
74 | 74 | $mergedConfig['default_instance'] |
75 | 75 | ]); |
76 | 76 | |
77 | - $container->setAlias('phraseanet.em', 'phraseanet.em.' . $name); |
|
78 | - $container->setAlias('phraseanet.helpers', 'phraseanet.helpers.' . $name); |
|
77 | + $container->setAlias('phraseanet.em', 'phraseanet.em.'.$name); |
|
78 | + $container->setAlias('phraseanet.helpers', 'phraseanet.helpers.'.$name); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | $this->buildEntityRepositories($name, $configuration, $container); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $configuration['connection']['token'] |
107 | 107 | ]); |
108 | 108 | |
109 | - $tokenProvider->addMethodCall('setDefaultProvider', [ $applicationTokenProvider ]); |
|
109 | + $tokenProvider->addMethodCall('setDefaultProvider', [$applicationTokenProvider]); |
|
110 | 110 | |
111 | 111 | $container->setDefinition('phraseanet.token_provider', $tokenProvider); |
112 | 112 | |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | |
118 | 118 | $factory->addMethodCall( |
119 | 119 | 'setAnnotationCacheDirectory', |
120 | - array($container->getParameter('kernel.cache_dir') . '/phraseanet/annotations') |
|
120 | + array($container->getParameter('kernel.cache_dir').'/phraseanet/annotations') |
|
121 | 121 | ); |
122 | 122 | |
123 | 123 | $factory->addMethodCall( |
124 | 124 | 'setProxyCacheDirectory', |
125 | - array($container->getParameter('kernel.cache_dir') . '/phraseanet/proxies') |
|
125 | + array($container->getParameter('kernel.cache_dir').'/phraseanet/proxies') |
|
126 | 126 | ); |
127 | 127 | |
128 | 128 | return $factory; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | ); |
143 | 143 | |
144 | 144 | $definition->setFactory([ |
145 | - new Reference('phraseanet.factories.' . $instanceName), |
|
145 | + new Reference('phraseanet.factories.'.$instanceName), |
|
146 | 146 | 'getRepository' |
147 | 147 | ]); |
148 | 148 | |
@@ -162,33 +162,33 @@ discard block |
||
162 | 162 | ContainerBuilder $container, |
163 | 163 | Definition $registry |
164 | 164 | ) { |
165 | - $baseKey = 'phraseanet.helpers.' . $instanceName; |
|
165 | + $baseKey = 'phraseanet.helpers.'.$instanceName; |
|
166 | 166 | |
167 | - $container->setDefinition($baseKey . '.feeds', new Definition(FeedHelper::class)); |
|
168 | - $container->setDefinition($baseKey . '.meta', new Definition(MetadataHelper::class, [ |
|
167 | + $container->setDefinition($baseKey.'.feeds', new Definition(FeedHelper::class)); |
|
168 | + $container->setDefinition($baseKey.'.meta', new Definition(MetadataHelper::class, [ |
|
169 | 169 | new Definition(FieldMap::class, [$mergedConfig['mappings']]), |
170 | 170 | 'fr', |
171 | 171 | 'fr' |
172 | 172 | ])); |
173 | 173 | |
174 | - $container->setDefinition($baseKey . '.definitions', new Definition(DefinitionMap::class, [ |
|
174 | + $container->setDefinition($baseKey.'.definitions', new Definition(DefinitionMap::class, [ |
|
175 | 175 | $mergedConfig['subdefinitions'] |
176 | 176 | ])); |
177 | 177 | |
178 | - $container->setDefinition($baseKey . '.thumbs', new Definition(ThumbHelper::class, [ |
|
179 | - new Definition(DefinitionMap::class, [ $mergedConfig['thumbnails'] ]) |
|
178 | + $container->setDefinition($baseKey.'.thumbs', new Definition(ThumbHelper::class, [ |
|
179 | + new Definition(DefinitionMap::class, [$mergedConfig['thumbnails']]) |
|
180 | 180 | ])); |
181 | 181 | |
182 | 182 | $container->setDefinition($baseKey, new Definition(InstanceHelper::class, [ |
183 | - new Reference($baseKey . '.definitions'), |
|
184 | - new Reference($baseKey . '.feeds'), |
|
185 | - new Reference($baseKey . '.meta'), |
|
186 | - new Reference($baseKey . '.thumbs') |
|
183 | + new Reference($baseKey.'.definitions'), |
|
184 | + new Reference($baseKey.'.feeds'), |
|
185 | + new Reference($baseKey.'.meta'), |
|
186 | + new Reference($baseKey.'.thumbs') |
|
187 | 187 | ])); |
188 | 188 | |
189 | 189 | $container |
190 | 190 | ->getDefinition($baseKey) |
191 | - ->addMethodCall('setTokenProvider', [ new Reference('phraseanet.token_provider') ]); |
|
191 | + ->addMethodCall('setTokenProvider', [new Reference('phraseanet.token_provider')]); |
|
192 | 192 | |
193 | 193 | $registry->addMethodCall('addHelper', [ |
194 | 194 | $instanceName, |
@@ -37,7 +37,7 @@ |
||
37 | 37 | return false; |
38 | 38 | } |
39 | 39 | |
40 | - return ! class_exists("PhraseanetSDK\\Repository\\" . ucfirst($value)); |
|
40 | + return !class_exists("PhraseanetSDK\\Repository\\".ucfirst($value)); |
|
41 | 41 | }) |
42 | 42 | ->thenInvalid('Repository type does not exist.'); |
43 | 43 |