@@ -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 |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function getId() |
| 99 | 99 | { |
| 100 | - return $this->getDataboxId().'_'.$this->getStoryId(); |
|
| 100 | + return $this->getDataboxId() . '_' . $this->getStoryId(); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function getThumbnail() |
| 127 | 127 | { |
| 128 | - if (! isset($this->source->thumbnail)) { |
|
| 128 | + if (!isset($this->source->thumbnail)) { |
|
| 129 | 129 | return null; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | public function getRecords() |
| 179 | 179 | { |
| 180 | - if (! isset($this->source->records)) { |
|
| 180 | + if (!isset($this->source->records)) { |
|
| 181 | 181 | $this->records = new ArrayCollection(); |
| 182 | 182 | } |
| 183 | 183 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public function getMetadata() |
| 191 | 191 | { |
| 192 | - if (! isset($this->source->metadata)) { |
|
| 192 | + if (!isset($this->source->metadata)) { |
|
| 193 | 193 | $this->metadata = new ArrayCollection(); |
| 194 | 194 | } |
| 195 | 195 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function getStatus() |
| 203 | 203 | { |
| 204 | - if (! isset($this->status)) { |
|
| 204 | + if (!isset($this->status)) { |
|
| 205 | 205 | $this->status = $this->entityManager->getRepository('recordStatus')->findByRecord( |
| 206 | 206 | $this->getDataboxId(), |
| 207 | 207 | $this->getStoryId() |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function getCaption() |
| 218 | 218 | { |
| 219 | - if (! isset($this->caption)) { |
|
| 219 | + if (!isset($this->caption)) { |
|
| 220 | 220 | $this->caption = $this->entityManager->getRepository('caption')->findByRecord( |
| 221 | 221 | $this->getDataboxId(), |
| 222 | 222 | $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 |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | throw new RuntimeException('Missing "token" property in response content'); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - return (string)$response->getProperty('reset_token'); |
|
| 84 | + return (string) $response->getProperty('reset_token'); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | throw new RuntimeException('Missing "success" property in response content'); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - return (bool)$response->getProperty('success'); |
|
| 104 | + return (bool) $response->getProperty('success'); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | public function updatePassword($currentPassword, $newPassword) |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | throw new RuntimeException('Missing "success" property in response content'); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - return (bool)$response->getProperty('success'); |
|
| 121 | + return (bool) $response->getProperty('success'); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | throw new \RuntimeException('Missing "token" property in response content'); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - return (string)$response->getProperty('token'); |
|
| 167 | + return (string) $response->getProperty('token'); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | public function updateUser(\PhraseanetSDK\Entity\User $user) |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | throw new RuntimeException('Missing "success" property in response content'); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - return (bool)$response->getProperty('success'); |
|
| 196 | + return (bool) $response->getProperty('success'); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | public function deleteAccount() |
@@ -215,6 +215,6 @@ discard block |
||
| 215 | 215 | throw new \RuntimeException('Missing "success" property in response content'); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - return (bool)$response->getProperty('success'); |
|
| 218 | + return (bool) $response->getProperty('success'); |
|
| 219 | 219 | } |
| 220 | 220 | } |
@@ -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 | |