@@ -63,7 +63,7 @@ |
||
63 | 63 | */ |
64 | 64 | public function getValues() |
65 | 65 | { |
66 | - if (! isset($this->source->values)) { |
|
66 | + if (!isset($this->source->values)) { |
|
67 | 67 | $this->values = new ArrayCollection(); |
68 | 68 | } |
69 | 69 |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public function getThumbnail() |
212 | 212 | { |
213 | - if (! isset($this->source->thumbnail)) { |
|
213 | + if (!isset($this->source->thumbnail)) { |
|
214 | 214 | return null; |
215 | 215 | } |
216 | 216 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function getTechnicalInformation() |
246 | 246 | { |
247 | - if (! isset($this->source->technical_informations)) { |
|
247 | + if (!isset($this->source->technical_informations)) { |
|
248 | 248 | $this->technicalInformation = new ArrayCollection(); |
249 | 249 | } |
250 | 250 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | */ |
261 | 261 | public function getSubdefs() |
262 | 262 | { |
263 | - if (! isset($this->source->subdefs)) { |
|
263 | + if (!isset($this->source->subdefs)) { |
|
264 | 264 | $this->subdefs = new ArrayCollection(); |
265 | 265 | } |
266 | 266 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | */ |
273 | 273 | public function getStatus() |
274 | 274 | { |
275 | - if (! isset($this->source->status)) { |
|
275 | + if (!isset($this->source->status)) { |
|
276 | 276 | $this->status = new ArrayCollection(); |
277 | 277 | } |
278 | 278 | |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public function getCaption() |
286 | 286 | { |
287 | - if (! isset($this->source->caption)) { |
|
287 | + if (!isset($this->source->caption)) { |
|
288 | 288 | $this->caption = new ArrayCollection(); |
289 | 289 | } |
290 | 290 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | */ |
297 | 297 | public function getMetadata() |
298 | 298 | { |
299 | - if (! isset($this->source->metadata)) { |
|
299 | + if (!isset($this->source->metadata)) { |
|
300 | 300 | $this->metadata = new ArrayCollection(); |
301 | 301 | } |
302 | 302 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | */ |
55 | 55 | public function getStatusCode() |
56 | 56 | { |
57 | - return (int)$this->meta->http_code; |
|
57 | + return (int) $this->meta->http_code; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -75,7 +75,7 @@ |
||
75 | 75 | */ |
76 | 76 | public function setExtended($extended) |
77 | 77 | { |
78 | - $this->extended = (boolean)$extended; |
|
78 | + $this->extended = (boolean) $extended; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -133,7 +133,6 @@ |
||
133 | 133 | * |
134 | 134 | * @param string $endpoint |
135 | 135 | * @param EventSubscriberInterface[] $plugins |
136 | - * @param int $endpointVersion |
|
137 | 136 | * @return static |
138 | 137 | */ |
139 | 138 | public static function create( |
@@ -108,8 +108,8 @@ |
||
108 | 108 | { |
109 | 109 | $entity = new static::$mappings[$name]['entity'](); |
110 | 110 | |
111 | - array_walk($data, function ($value, $property) use ($entity) { |
|
112 | - $method = 'set'.implode('', array_map(function ($chunk) { |
|
111 | + array_walk($data, function($value, $property) use ($entity) { |
|
112 | + $method = 'set' . implode('', array_map(function($chunk) { |
|
113 | 113 | return ucfirst($chunk); |
114 | 114 | }, preg_split('/[-_]/', $property))); |
115 | 115 |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | { |
41 | 41 | $app['recorder.config'] = $app['sdk.config'] = $app['cache.config'] = array(); |
42 | 42 | |
43 | - $app['phraseanet-sdk.recorder.config'] = $app->share(function () use ($app) { |
|
43 | + $app['phraseanet-sdk.recorder.config'] = $app->share(function() use ($app) { |
|
44 | 44 | return array_replace_recursive( |
45 | 45 | array( |
46 | 46 | 'type' => 'file', |
47 | 47 | 'options' => array( |
48 | - 'file' => realpath(__DIR__.'/../..').'/phraseanet.recorder.json', |
|
48 | + 'file' => realpath(__DIR__ . '/../..') . '/phraseanet.recorder.json', |
|
49 | 49 | ), |
50 | 50 | 'limit' => 1000, |
51 | 51 | ), |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | ); |
54 | 54 | }); |
55 | 55 | |
56 | - $app['phraseanet-sdk.config'] = $app->share(function () use ($app) { |
|
56 | + $app['phraseanet-sdk.config'] = $app->share(function() use ($app) { |
|
57 | 57 | return array_replace( |
58 | 58 | array( |
59 | 59 | 'client-id' => null, |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | ); |
65 | 65 | }); |
66 | 66 | |
67 | - $app['phraseanet-sdk.cache.config'] = $app->share(function () use ($app) { |
|
67 | + $app['phraseanet-sdk.cache.config'] = $app->share(function() use ($app) { |
|
68 | 68 | return array_replace( |
69 | 69 | array( |
70 | 70 | 'type' => 'array', |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | ); |
75 | 75 | }); |
76 | 76 | |
77 | - $app['phraseanet-sdk.cache.factory'] = $app->share(function () use ($app) { |
|
77 | + $app['phraseanet-sdk.cache.factory'] = $app->share(function() use ($app) { |
|
78 | 78 | return new BackendCacheFactory(); |
79 | 79 | }); |
80 | 80 | |
81 | - $app['phraseanet-sdk.cache.adapter'] = $app->share(function () use ($app) { |
|
81 | + $app['phraseanet-sdk.cache.adapter'] = $app->share(function() use ($app) { |
|
82 | 82 | $config = $app['phraseanet-sdk.cache.config']; |
83 | 83 | |
84 | 84 | $backend = $app['phraseanet-sdk.cache.factory']->create( |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | return new DoctrineCacheAdapter($backend); |
91 | 91 | }); |
92 | 92 | |
93 | - $app['phraseanet-sdk.cache.revalidation'] = $app->share(function (SilexApplication $app) { |
|
93 | + $app['phraseanet-sdk.cache.revalidation'] = $app->share(function(SilexApplication $app) { |
|
94 | 94 | $config = $app['phraseanet-sdk.cache.config']; |
95 | 95 | if (isset($config['revalidation']) && is_string($config['revalidation'])) { |
96 | 96 | $factory = new RevalidationFactory(); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | return; |
104 | 104 | }); |
105 | 105 | |
106 | - $app['phraseanet-sdk.cache.can_cache'] = $app->share(function (SilexApplication $app) { |
|
106 | + $app['phraseanet-sdk.cache.can_cache'] = $app->share(function(SilexApplication $app) { |
|
107 | 107 | $config = $app['phraseanet-sdk.cache.config']; |
108 | 108 | if (isset($config['can_cache'])) { |
109 | 109 | return $config['can_cache']; |
@@ -112,13 +112,13 @@ discard block |
||
112 | 112 | return new CanCacheStrategy(); |
113 | 113 | }); |
114 | 114 | |
115 | - $app['phraseanet-sdk.cache.key_provider'] = $app->share(function (SilexApplication $app) { |
|
115 | + $app['phraseanet-sdk.cache.key_provider'] = $app->share(function(SilexApplication $app) { |
|
116 | 116 | $config = $app['phraseanet-sdk.cache.config']; |
117 | 117 | |
118 | 118 | return isset($config['key_provider']) ? $config['key_provider'] : null; |
119 | 119 | }); |
120 | 120 | |
121 | - $app['phraseanet-sdk.cache.plugin'] = $app->share(function () use ($app) { |
|
121 | + $app['phraseanet-sdk.cache.plugin'] = $app->share(function() use ($app) { |
|
122 | 122 | $cacheConfig = array_merge( |
123 | 123 | $app['phraseanet-sdk.cache.config'], |
124 | 124 | array( |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | return new CachePlugin($cacheConfig); |
134 | 134 | }); |
135 | 135 | |
136 | - $app['phraseanet-sdk.guzzle.plugins'] = $app->share(function ($app) { |
|
136 | + $app['phraseanet-sdk.guzzle.plugins'] = $app->share(function($app) { |
|
137 | 137 | $plugins = array( |
138 | 138 | $app['phraseanet-sdk.cache.plugin'], |
139 | 139 | ); |
@@ -145,26 +145,26 @@ discard block |
||
145 | 145 | return $plugins; |
146 | 146 | }); |
147 | 147 | |
148 | - $app['phraseanet-sdk.guzzle-adapter'] = $app->share(function (SilexApplication $app) { |
|
148 | + $app['phraseanet-sdk.guzzle-adapter'] = $app->share(function(SilexApplication $app) { |
|
149 | 149 | return GuzzleAdapter::create( |
150 | 150 | $app['phraseanet-sdk.config']['url'], |
151 | 151 | $app['phraseanet-sdk.guzzle.plugins'] |
152 | 152 | ); |
153 | 153 | }); |
154 | 154 | |
155 | - $app['phraseanet-sdk.guzzle-connected-adapter'] = $app->protect(function ($token) use ($app) { |
|
155 | + $app['phraseanet-sdk.guzzle-connected-adapter'] = $app->protect(function($token) use ($app) { |
|
156 | 156 | return new ConnectedGuzzleAdapter($token, $app['phraseanet-sdk.guzzle-adapter']); |
157 | 157 | }); |
158 | 158 | |
159 | - $app['phraseanet-sdk.guzzle-api-adapter'] = $app->protect(function ($token) use ($app) { |
|
159 | + $app['phraseanet-sdk.guzzle-api-adapter'] = $app->protect(function($token) use ($app) { |
|
160 | 160 | return new APIGuzzleAdapter($app['phraseanet-sdk.guzzle-connected-adapter']($token)); |
161 | 161 | }); |
162 | 162 | |
163 | - $app['phraseanet-sdk'] = $app->share(function (SilexApplication $app) { |
|
163 | + $app['phraseanet-sdk'] = $app->share(function(SilexApplication $app) { |
|
164 | 164 | return Application::create($app['phraseanet-sdk.config'], $app['phraseanet-sdk.guzzle-adapter']); |
165 | 165 | }); |
166 | 166 | |
167 | - $app['phraseanet-sdk.guzzle.history-plugin'] = $app->share(function (SilexApplication $app) { |
|
167 | + $app['phraseanet-sdk.guzzle.history-plugin'] = $app->share(function(SilexApplication $app) { |
|
168 | 168 | $plugin = new HistoryPlugin(); |
169 | 169 | $plugin->setLimit($app['phraseanet-sdk.recorder.config']['limit']); |
170 | 170 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | |
176 | 176 | if (isset($app['profiler'])) { |
177 | 177 | $app['data_collectors'] = array_merge($app['data_collectors'], array( |
178 | - 'phraseanet-sdk' => $app->share(function ($app) { |
|
178 | + 'phraseanet-sdk' => $app->share(function($app) { |
|
179 | 179 | return new PhraseanetSDKDataCollector($app['phraseanet-sdk.guzzle.history-plugin']); |
180 | 180 | }), |
181 | 181 | )); |
@@ -183,11 +183,11 @@ discard block |
||
183 | 183 | array('phrasea-sdk', '@PhraseanetSDK/Collector/phraseanet-sdk.html.twig'), |
184 | 184 | )); |
185 | 185 | |
186 | - $app['phraseanet-sdk.profiler.templates_path'] = __DIR__.'/Profiler/resources/views'; |
|
186 | + $app['phraseanet-sdk.profiler.templates_path'] = __DIR__ . '/Profiler/resources/views'; |
|
187 | 187 | |
188 | 188 | $app['twig.loader.filesystem'] = $app->share($app->extend( |
189 | 189 | 'twig.loader.filesystem', |
190 | - function ($loader, $app) { |
|
190 | + function($loader, $app) { |
|
191 | 191 | $loader->addPath($app['phraseanet-sdk.profiler.templates_path'], 'PhraseanetSDK'); |
192 | 192 | |
193 | 193 | return $loader; |
@@ -195,21 +195,21 @@ discard block |
||
195 | 195 | )); |
196 | 196 | } |
197 | 197 | |
198 | - $app['phraseanet-sdk.recorder.storage-factory'] = $app->share(function (SilexApplication $app) { |
|
198 | + $app['phraseanet-sdk.recorder.storage-factory'] = $app->share(function(SilexApplication $app) { |
|
199 | 199 | return new StorageFactory($app['phraseanet-sdk.cache.factory']); |
200 | 200 | }); |
201 | 201 | |
202 | - $app['phraseanet-sdk.recorder.request-extractor'] = $app->share(function (SilexApplication $app) { |
|
202 | + $app['phraseanet-sdk.recorder.request-extractor'] = $app->share(function(SilexApplication $app) { |
|
203 | 203 | return new RequestExtractor(); |
204 | 204 | }); |
205 | 205 | |
206 | - $app['phraseanet-sdk.recorder.storage'] = $app->share(function (SilexApplication $app) { |
|
206 | + $app['phraseanet-sdk.recorder.storage'] = $app->share(function(SilexApplication $app) { |
|
207 | 207 | $config = $app['phraseanet-sdk.recorder.config']; |
208 | 208 | |
209 | 209 | return $app['phraseanet-sdk.recorder.storage-factory']->create($config['type'], $config['options']); |
210 | 210 | }); |
211 | 211 | |
212 | - $app['phraseanet-sdk.recorder.filters'] = $app->share(function (SilexApplication $app) { |
|
212 | + $app['phraseanet-sdk.recorder.filters'] = $app->share(function(SilexApplication $app) { |
|
213 | 213 | return array( |
214 | 214 | new MonitorFilter(), |
215 | 215 | new DuplicateFilter(), |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | ); |
218 | 218 | }); |
219 | 219 | |
220 | - $app['phraseanet-sdk.recorder'] = $app->share(function (SilexApplication $app) { |
|
220 | + $app['phraseanet-sdk.recorder'] = $app->share(function(SilexApplication $app) { |
|
221 | 221 | $recorder = new Recorder( |
222 | 222 | $app['phraseanet-sdk.guzzle.history-plugin'], |
223 | 223 | $app['phraseanet-sdk.recorder.storage'], |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | return $recorder; |
232 | 232 | }); |
233 | 233 | |
234 | - $app['phraseanet-sdk.player.factory'] = $app->protect(function ($token) use ($app) { |
|
234 | + $app['phraseanet-sdk.player.factory'] = $app->protect(function($token) use ($app) { |
|
235 | 235 | return new Player( |
236 | 236 | $app['phraseanet-sdk.guzzle-api-adapter']($token), |
237 | 237 | $app['phraseanet-sdk.recorder.storage'] |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | public function boot(SilexApplication $app) |
243 | 243 | { |
244 | 244 | if ($app['recorder.enabled']) { |
245 | - $app->finish(function () use ($app) { |
|
245 | + $app->finish(function() use ($app) { |
|
246 | 246 | $app['phraseanet-sdk.recorder']->save(); |
247 | 247 | }); |
248 | 248 | } |
@@ -20,8 +20,7 @@ |
||
20 | 20 | public function extract(RequestInterface $request) |
21 | 21 | { |
22 | 22 | $postFields = $request instanceof EntityEnclosingRequestInterface ? |
23 | - $request->getPostFields()->toArray() : |
|
24 | - array(); |
|
23 | + $request->getPostFields()->toArray() : array(); |
|
25 | 24 | |
26 | 25 | return array( |
27 | 26 | 'query' => $request->getQuery()->toArray(), |
@@ -21,7 +21,7 @@ |
||
21 | 21 | public function __construct(MemcacheCache $memcache) |
22 | 22 | { |
23 | 23 | $this->memcache = $memcache; |
24 | - $this->key = 'PhraseanetSDK-recording-'.md5(__DIR__); |
|
24 | + $this->key = 'PhraseanetSDK-recording-' . md5(__DIR__); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -21,7 +21,7 @@ |
||
21 | 21 | public function __construct(MemcachedCache $memcached) |
22 | 22 | { |
23 | 23 | $this->memcached = $memcached; |
24 | - $this->key = 'VCR-recording-'.md5(__DIR__); |
|
24 | + $this->key = 'VCR-recording-' . md5(__DIR__); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |