Completed
Push — master ( 1fb3b9...9b0da8 )
by Thibaud
18:27 queued 07:50
created
src/Bundle/DependencyInjection/Builder/CacheDefinitionBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Bundle/DependencyInjection/Configuration/CacheNodeBuilder.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,17 +40,17 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Bundle/DependencyInjection/Configuration/RepositoriesNodeBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Bundle/DependencyInjection/PhraseanetExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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, [
Please login to merge, or discard this patch.
src/Bundle/Twig/PhraseanetExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
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']),
Please login to merge, or discard this patch.
src/Component/Helper/FeedEntryFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/Component/Helper/FeedHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
src/Component/Helper/InstanceHelperRegistry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Component/Helper/MetadataHelper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
     public function getFieldAlias($fieldName, $locale = null, $fallback = true)
62 62
     {
63 63
         if ($locale == null) {
64
-            $locale =  $this->defaultLocale;
64
+            $locale = $this->defaultLocale;
65 65
         }
66 66
 
67
-        if (! $this->fieldsMap->isFieldMapped($fieldName, $locale)) {
67
+        if (!$this->fieldsMap->isFieldMapped($fieldName, $locale)) {
68 68
             if ($locale !== $this->defaultLocale && $fallback) {
69 69
                 return $this->getFieldAlias($fieldName, $this->defaultLocale);
70 70
             }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
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
             }
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
         $map = [];
114 114
 
115 115
         foreach ($record->getMetadata() as $metadata) {
116
-            if (! $this->fieldsMap->isFieldMapped($metadata->getName(), $locale)) {
116
+            if (!$this->fieldsMap->isFieldMapped($metadata->getName(), $locale)) {
117 117
                 continue;
118 118
             }
119 119
 
120 120
             $alias = $this->fieldsMap->getAliasFromFieldName($metadata->getName(), $locale);
121 121
 
122
-            if ($fields !== null && ! in_array($alias, $fields)) {
122
+            if ($fields !== null && !in_array($alias, $fields)) {
123 123
                 continue;
124 124
             }
125 125
 
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
     private function appendValueToMap($map, $alias, $value)
139 139
     {
140 140
         if (isset($map[$alias])) {
141
-            if (! is_array($map[$alias])) {
142
-                $map[$alias] = [ $map[$alias] ];
141
+            if (!is_array($map[$alias])) {
142
+                $map[$alias] = [$map[$alias]];
143 143
             }
144 144
 
145 145
             $map[$alias][] = $value;
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             $locale = $this->defaultLocale;
157 157
         }
158 158
 
159
-        if (! $this->fieldsMap->hasAlias($field, $locale)) {
159
+        if (!$this->fieldsMap->hasAlias($field, $locale)) {
160 160
             return null;
161 161
         }
162 162
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
     public function getRecordMultiField(Record $record, $field, $locale = null)
176 176
     {
177
-        if (! $this->fieldsMap->hasAlias($field, $locale)) {
177
+        if (!$this->fieldsMap->hasAlias($field, $locale)) {
178 178
             return [];
179 179
         }
180 180
 
Please login to merge, or discard this patch.