@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Alchemy\PhraseanetBundle\DependencyInjection\Builder; |
4 | 4 | |
5 | 5 | use Doctrine\Common\Cache\ArrayCache; |
6 | -use Doctrine\Common\Cache\FileCache; |
|
7 | 6 | use Doctrine\Common\Cache\MemcachedCache; |
8 | 7 | use Doctrine\Common\Cache\PhpFileCache; |
9 | 8 | use Doctrine\Common\Cache\RedisCache; |
@@ -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 | } |
@@ -7,7 +7,6 @@ |
||
7 | 7 | use ProxyManager\Configuration; |
8 | 8 | use ProxyManager\Factory\LazyLoadingValueHolderFactory; |
9 | 9 | use ProxyManager\Proxy\LazyLoadingInterface; |
10 | -use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; |
|
11 | 10 | |
12 | 11 | class EntityManagerFactory |
13 | 12 | { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | /** |
79 | 79 | * @param $name |
80 | - * @return \PhraseanetSDK\AbstractRepository |
|
80 | + * @return \ProxyManager\Proxy\VirtualProxyInterface |
|
81 | 81 | */ |
82 | 82 | public function getRepository($name) |
83 | 83 | { |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * Builds the options array used to build SDK entity managers |
111 | 111 | * |
112 | - * @return array |
|
112 | + * @return string |
|
113 | 113 | */ |
114 | 114 | private function getOptions() |
115 | 115 | { |
@@ -97,7 +97,7 @@ |
||
97 | 97 | return true; |
98 | 98 | }; |
99 | 99 | |
100 | - $class = 'PhraseanetSDK\Repository\\' . ucfirst($name); |
|
100 | + $class = 'PhraseanetSDK\Repository\\'.ucfirst($name); |
|
101 | 101 | |
102 | 102 | if ($name == 'search') { |
103 | 103 | $class = SearchRepository::class; |
@@ -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 | } |
@@ -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 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | foreach ($mappings as $alias => $localizedFields) { |
30 | 30 | foreach ($localizedFields as $locale => $localizedField) { |
31 | - if (! isset($this->fieldMap[$locale])) { |
|
31 | + if (!isset($this->fieldMap[$locale])) { |
|
32 | 32 | $this->fieldMap[$locale] = array(); |
33 | 33 | } |
34 | 34 | |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function getAliasFromFieldName($key, $locale) |
77 | 77 | { |
78 | - if (! isset($this->fieldMap[$locale])) { |
|
78 | + if (!isset($this->fieldMap[$locale])) { |
|
79 | 79 | throw new \OutOfBoundsException(); |
80 | 80 | } |
81 | 81 | |
82 | 82 | $flipped = array_flip($this->fieldMap[$locale]); |
83 | 83 | |
84 | - if (! isset($flipped[$key])) { |
|
84 | + if (!isset($flipped[$key])) { |
|
85 | 85 | throw new \OutOfBoundsException(); |
86 | 86 | } |
87 | 87 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | public function isFieldMapped($key, $locale) |
92 | 92 | { |
93 | - if (! isset($this->fieldMap[$locale])) { |
|
93 | + if (!isset($this->fieldMap[$locale])) { |
|
94 | 94 | return false; |
95 | 95 | } |
96 | 96 |