@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $cacheConfiguration['validation'] |
| 63 | 63 | ]); |
| 64 | 64 | |
| 65 | - $revalidation->setFactory([ $factory, 'create' ]); |
|
| 65 | + $revalidation->setFactory([$factory, 'create']); |
|
| 66 | 66 | |
| 67 | 67 | return $revalidation; |
| 68 | 68 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | ]); |
| 77 | 77 | |
| 78 | 78 | $definition = new Definition(RedisCache::class); |
| 79 | - $definition->addMethodCall('setRedis', [ $redisDefinition ]); |
|
| 79 | + $definition->addMethodCall('setRedis', [$redisDefinition]); |
|
| 80 | 80 | |
| 81 | 81 | return $definition; |
| 82 | 82 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | ]); |
| 91 | 91 | |
| 92 | 92 | $definition = new Definition(MemcachedCache::class); |
| 93 | - $definition->addMethodCall('setMemcached', [ $memcachedDefinition ]); |
|
| 93 | + $definition->addMethodCall('setMemcached', [$memcachedDefinition]); |
|
| 94 | 94 | |
| 95 | 95 | return $definition; |
| 96 | 96 | } |
@@ -40,17 +40,17 @@ discard block |
||
| 40 | 40 | ->scalarNode('ttl') |
| 41 | 41 | ->validate() |
| 42 | 42 | ->ifTrue(function ($value) { |
| 43 | - return ! is_int($value) || $value < 0; |
|
| 43 | + return !is_int($value) || $value < 0; |
|
| 44 | 44 | }) |
| 45 | 45 | ->thenInvalid('TTL must be a non-negative integer') |
| 46 | 46 | ->end() |
| 47 | 47 | ->end() |
| 48 | 48 | ->enumNode('type') |
| 49 | - ->values([ null, 'none', 'array', 'file', 'redis', 'memcached' ]) |
|
| 49 | + ->values([null, 'none', 'array', 'file', 'redis', 'memcached']) |
|
| 50 | 50 | ->treatNullLike('none') |
| 51 | 51 | ->end() |
| 52 | 52 | ->enumNode('validation') |
| 53 | - ->values([ 'skip', 'deny' ]) |
|
| 53 | + ->values(['skip', 'deny']) |
|
| 54 | 54 | ->end(); |
| 55 | 55 | |
| 56 | 56 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | private function validate($value) |
| 61 | 61 | { |
| 62 | - if (! is_array($value)) { |
|
| 62 | + if (!is_array($value)) { |
|
| 63 | 63 | return $value; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | $this->validateServerCache($value['type'], $value); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if ($value['type'] == 'file' && ! isset($value['path'])) { |
|
| 70 | + if ($value['type'] == 'file' && !isset($value['path'])) { |
|
| 71 | 71 | throw new \InvalidArgumentException("'path' property is required for 'file' cache"); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if ($value['type'] !== 'none' && ! isset($value['validation'])) { |
|
| 74 | + if ($value['type'] !== 'none' && !isset($value['validation'])) { |
|
| 75 | 75 | throw new \InvalidArgumentException("'validation' property is required when cache is enabled."); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | private function validateServerCache($type, $value) |
| 82 | 82 | { |
| 83 | - if (! isset($value['host'])) { |
|
| 83 | + if (!isset($value['host'])) { |
|
| 84 | 84 | throw new \InvalidArgumentException("'host' is required for '$type' cache"); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - if (! isset($value['port'])) { |
|
| 87 | + if (!isset($value['port'])) { |
|
| 88 | 88 | throw new \InvalidArgumentException("'port' is required for '$type' cache"); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | ->cannotBeEmpty() |
| 34 | 34 | ->validate() |
| 35 | 35 | ->ifTrue(function ($value) { |
| 36 | - return ! class_exists("PhraseanetSDK\\Repository\\" . ucfirst($value)); |
|
| 36 | + return !class_exists("PhraseanetSDK\\Repository\\" . ucfirst($value)); |
|
| 37 | 37 | }) |
| 38 | 38 | ->thenInvalid('Repository type does not exist.'); |
| 39 | 39 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $configuration['connection']['token'] |
| 105 | 105 | ]); |
| 106 | 106 | |
| 107 | - $tokenProvider->addMethodCall('setDefaultProvider', [ $applicationTokenProvider ]); |
|
| 107 | + $tokenProvider->addMethodCall('setDefaultProvider', [$applicationTokenProvider]); |
|
| 108 | 108 | |
| 109 | 109 | $container->setDefinition('phraseanet.token_provider', $tokenProvider); |
| 110 | 110 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | ])); |
| 175 | 175 | |
| 176 | 176 | $container->setDefinition($baseKey . '.thumbs', new Definition(ThumbHelper::class, [ |
| 177 | - new Definition(DefinitionMap::class, [ $mergedConfig['thumbnails'] ]) |
|
| 177 | + new Definition(DefinitionMap::class, [$mergedConfig['thumbnails']]) |
|
| 178 | 178 | ])); |
| 179 | 179 | |
| 180 | 180 | $container->setDefinition($baseKey, new Definition(InstanceHelper::class, [ |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | public function getFunctions() |
| 23 | 23 | { |
| 24 | 24 | return array( |
| 25 | - new \Twig_SimpleFunction('record_hash', [ $this, 'getRecordHash' ]), |
|
| 25 | + new \Twig_SimpleFunction('record_hash', [$this, 'getRecordHash']), |
|
| 26 | 26 | new \Twig_SimpleFunction('record_caption', [$this, 'getRecordCaption']), |
| 27 | 27 | new \Twig_SimpleFunction('story_caption', [$this, 'getStoryCaption']), |
| 28 | 28 | new \Twig_SimpleFunction('fetch_thumbnail', [$this, 'fetchThumbnail']), |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | public function hasItems() |
| 34 | 34 | { |
| 35 | - return ! empty($this->getItems()); |
|
| 35 | + return !empty($this->getItems()); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function entryContainsPdfDocuments(FeedEntry $feedEntry) |
| 21 | 21 | { |
| 22 | - return ! empty($this->filterPdfItems($feedEntry)); |
|
| 22 | + return !empty($this->filterPdfItems($feedEntry)); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function filterPdfItems(FeedEntry $feedEntry) |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | return $this->getDefaultHelper(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - if (! $this->hasHelper($name)) { |
|
| 31 | + if (!$this->hasHelper($name)) { |
|
| 32 | 32 | throw new \OutOfBoundsException("Helper '$name' is not defined."); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | throw new \InvalidArgumentException(); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if (! $this->thumbnailMap->hasSubDefinition($type) || $record instanceof Story) { |
|
| 41 | + if (!$this->thumbnailMap->hasSubDefinition($type) || $record instanceof Story) { |
|
| 42 | 42 | return $record->getThumbnail(); |
| 43 | 43 | } |
| 44 | 44 | |