@@ -18,6 +18,9 @@ discard block |
||
18 | 18 | |
19 | 19 | class BackendCacheFactory |
20 | 20 | { |
21 | + /** |
|
22 | + * @param string $type |
|
23 | + */ |
|
21 | 24 | public function create($type, $host = null, $port = null) |
22 | 25 | { |
23 | 26 | $host = $host ? $host : '127.0.0.1'; |
@@ -48,6 +51,9 @@ discard block |
||
48 | 51 | return new ArrayCache(); |
49 | 52 | } |
50 | 53 | |
54 | + /** |
|
55 | + * @param integer $port |
|
56 | + */ |
|
51 | 57 | private function createMemcache($host, $port) |
52 | 58 | { |
53 | 59 | $memcache = new \Memcache(); |
@@ -70,6 +76,9 @@ discard block |
||
70 | 76 | return $cache; |
71 | 77 | } |
72 | 78 | |
79 | + /** |
|
80 | + * @param integer $port |
|
81 | + */ |
|
73 | 82 | private function createMemcached($host, $port) |
74 | 83 | { |
75 | 84 | $memcached = new \Memcached(); |
@@ -12,8 +12,6 @@ |
||
12 | 12 | namespace PhraseanetSDK\Entity; |
13 | 13 | |
14 | 14 | use Doctrine\Common\Collections\ArrayCollection; |
15 | -use PhraseanetSDK\Annotation\ApiField as ApiField; |
|
16 | -use PhraseanetSDK\Annotation\ApiRelation as ApiRelation; |
|
17 | 15 | use PhraseanetSDK\EntityManager; |
18 | 16 | |
19 | 17 | class Story |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function getThumbnail() |
132 | 132 | { |
133 | - if (! isset($this->source->thumbnail)) { |
|
133 | + if (!isset($this->source->thumbnail)) { |
|
134 | 134 | return null; |
135 | 135 | } |
136 | 136 | |
@@ -183,8 +183,7 @@ discard block |
||
183 | 183 | public function getRecordCount() |
184 | 184 | { |
185 | 185 | return $this->recordCount !== null ? |
186 | - $this->recordCount : |
|
187 | - $this->recordCount = (isset($this->source->record_count) ? $this->source->record_count : count($this->getRecords())); |
|
186 | + $this->recordCount : $this->recordCount = (isset($this->source->record_count) ? $this->source->record_count : count($this->getRecords())); |
|
188 | 187 | } |
189 | 188 | |
190 | 189 | /** |
@@ -192,7 +191,7 @@ discard block |
||
192 | 191 | */ |
193 | 192 | public function getRecords() |
194 | 193 | { |
195 | - if (! isset($this->source->records)) { |
|
194 | + if (!isset($this->source->records)) { |
|
196 | 195 | $this->records = new ArrayCollection(); |
197 | 196 | } |
198 | 197 | |
@@ -204,7 +203,7 @@ discard block |
||
204 | 203 | */ |
205 | 204 | public function getMetadata() |
206 | 205 | { |
207 | - if (! isset($this->source->metadata)) { |
|
206 | + if (!isset($this->source->metadata)) { |
|
208 | 207 | $this->metadata = new ArrayCollection(); |
209 | 208 | } |
210 | 209 | |
@@ -216,7 +215,7 @@ discard block |
||
216 | 215 | */ |
217 | 216 | public function getStatus() |
218 | 217 | { |
219 | - if (! isset($this->status)) { |
|
218 | + if (!isset($this->status)) { |
|
220 | 219 | $this->status = $this->entityManager->getRepository('recordStatus')->findByRecord( |
221 | 220 | $this->getDataboxId(), |
222 | 221 | $this->getStoryId() |
@@ -231,7 +230,7 @@ discard block |
||
231 | 230 | */ |
232 | 231 | public function getCaption() |
233 | 232 | { |
234 | - if (! isset($this->caption)) { |
|
233 | + if (!isset($this->caption)) { |
|
235 | 234 | $this->caption = $this->entityManager->getRepository('caption')->findByRecord( |
236 | 235 | $this->getDataboxId(), |
237 | 236 | $this->getStoryId() |
@@ -70,6 +70,9 @@ |
||
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | + /** |
|
74 | + * @param string $message |
|
75 | + */ |
|
73 | 76 | private function output($message, OutputInterface $output = null) |
74 | 77 | { |
75 | 78 | if (null !== $output) { |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * Find all collection in the provided databox |
22 | 22 | * |
23 | 23 | * @param integer $databoxId the databox id |
24 | - * @return ArrayCollection|\PhraseanetSDK\Entity\DataboxCollection[] |
|
24 | + * @return ArrayCollection |
|
25 | 25 | * @throws RuntimeException |
26 | 26 | */ |
27 | 27 | public function findByDatabox($databoxId) |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | namespace PhraseanetSDK\Repository; |
13 | 13 | |
14 | -use PhraseanetSDK\EntityHydrator; |
|
15 | 14 | use PhraseanetSDK\Exception\RuntimeException; |
16 | 15 | |
17 | 16 | class User extends AbstractRepository |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * Retrieve the entry identified by its id |
23 | 23 | * |
24 | 24 | * @param integer $id The entry id |
25 | - * @return \PhraseanetSDK\Entity\Feed |
|
25 | + * @return FeedEntry |
|
26 | 26 | * @throws RuntimeException |
27 | 27 | */ |
28 | 28 | public function findById($id) |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | namespace PhraseanetSDK\Repository; |
13 | 13 | |
14 | -use PhraseanetSDK\EntityHydrator; |
|
15 | 14 | use PhraseanetSDK\Exception\RuntimeException; |
16 | 15 | |
17 | 16 | class User extends AbstractRepository |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | namespace PhraseanetSDK\Repository; |
13 | 13 | |
14 | -use PhraseanetSDK\EntityHydrator; |
|
15 | 14 | use PhraseanetSDK\Exception\RuntimeException; |
16 | 15 | |
17 | 16 | class User extends AbstractRepository |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function requestPasswordReset($emailAddress) |
78 | 78 | { |
79 | - $response = $this->query('POST', 'v1/accounts/reset-password/' . $emailAddress . '/'); |
|
79 | + $response = $this->query('POST', 'v1/accounts/reset-password/'.$emailAddress.'/'); |
|
80 | 80 | |
81 | 81 | if (!$response->hasProperty('reset_token')) { |
82 | 82 | throw new RuntimeException('Missing "token" property in response content'); |
83 | 83 | } |
84 | 84 | |
85 | - return (string)$response->getProperty('reset_token'); |
|
85 | + return (string) $response->getProperty('reset_token'); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function resetPassword($token, $password) |
96 | 96 | { |
97 | - $response = $this->query('POST', 'v1/accounts/update-password/' . $token . '/', array(), array( |
|
97 | + $response = $this->query('POST', 'v1/accounts/update-password/'.$token.'/', array(), array( |
|
98 | 98 | 'password' => $password |
99 | 99 | )); |
100 | 100 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | throw new RuntimeException('Missing "success" property in response content'); |
103 | 103 | } |
104 | 104 | |
105 | - return (bool)$response->getProperty('success'); |
|
105 | + return (bool) $response->getProperty('success'); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | public function updatePassword($currentPassword, $newPassword) |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | throw new RuntimeException('Missing "success" property in response content'); |
120 | 120 | } |
121 | 121 | |
122 | - return (bool)$response->getProperty('success'); |
|
122 | + return (bool) $response->getProperty('success'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | throw new \RuntimeException('Missing "token" property in response content'); |
166 | 166 | } |
167 | 167 | |
168 | - return (string)$response->getProperty('token'); |
|
168 | + return (string) $response->getProperty('token'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | public function updateUser(\PhraseanetSDK\Entity\User $user) |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | throw new RuntimeException('Missing "success" property in response content'); |
195 | 195 | } |
196 | 196 | |
197 | - return (bool)$response->getProperty('success'); |
|
197 | + return (bool) $response->getProperty('success'); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | public function deleteAccount() |
@@ -210,12 +210,12 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public function unlockAccount($token) |
212 | 212 | { |
213 | - $response = $this->query('POST', 'v1/accounts/unlock/' . $token . '/', array(), array()); |
|
213 | + $response = $this->query('POST', 'v1/accounts/unlock/'.$token.'/', array(), array()); |
|
214 | 214 | |
215 | 215 | if (!$response->hasProperty('success')) { |
216 | 216 | throw new \RuntimeException('Missing "success" property in response content'); |
217 | 217 | } |
218 | 218 | |
219 | - return (bool)$response->getProperty('success'); |
|
219 | + return (bool) $response->getProperty('success'); |
|
220 | 220 | } |
221 | 221 | } |
@@ -166,7 +166,7 @@ |
||
166 | 166 | */ |
167 | 167 | public function getValidationUsers() |
168 | 168 | { |
169 | - if (! $this->isValidationBasket()) { |
|
169 | + if (!$this->isValidationBasket()) { |
|
170 | 170 | return null; |
171 | 171 | } |
172 | 172 |
@@ -110,7 +110,7 @@ |
||
110 | 110 | */ |
111 | 111 | public function getValidationChoices() |
112 | 112 | { |
113 | - if (! isset($this->source->validation_choices)) { |
|
113 | + if (!isset($this->source->validation_choices)) { |
|
114 | 114 | $this->validationChoices = new ArrayCollection(); |
115 | 115 | } |
116 | 116 |
@@ -146,7 +146,7 @@ |
||
146 | 146 | */ |
147 | 147 | public function getItems() |
148 | 148 | { |
149 | - if (! isset($this->source->items)) { |
|
149 | + if (!isset($this->source->items)) { |
|
150 | 150 | $this->items = new ArrayCollection(); |
151 | 151 | } |
152 | 152 |