@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | * add attach an attachment to this model |
| 187 | 187 | * |
| 188 | 188 | * @param string $field |
| 189 | - * @param One\Model\Model $item |
|
| 190 | - * @return One\Model\Article |
|
| 189 | + * @param Model $item |
|
| 190 | + * @return Article |
|
| 191 | 191 | */ |
| 192 | 192 | public function attach($field, Model $item) |
| 193 | 193 | { |
@@ -261,6 +261,11 @@ discard block |
||
| 261 | 261 | ); |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | + /** |
|
| 265 | + * @param string $type |
|
| 266 | + * |
|
| 267 | + * @return Model |
|
| 268 | + */ |
|
| 264 | 269 | private function ensureOrder($attachment, $type) |
| 265 | 270 | { |
| 266 | 271 | if (empty($attachment->get('order'))) { |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace One\Model; |
| 4 | 4 | |
| 5 | 5 | use Psr\Http\Message\UriInterface; |
| 6 | -use One\Uri; |
|
| 7 | 6 | use One\Collection; |
| 8 | 7 | |
| 9 | 8 | /** |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | * source taken from photo url if not available |
| 49 | 49 | * |
| 50 | 50 | * @param \Psr\Http\Message\UriInterface|string $source |
| 51 | - * @param \Psr\Http\Message\UriInterface|string|null $photo |
|
| 51 | + * @param UriInterface|null $photo |
|
| 52 | 52 | * @return \Psr\Http\Message\UriInterface |
| 53 | 53 | */ |
| 54 | 54 | private function fillSource($source, $photo) |
@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use One\Model\Article; |
| 8 | 8 | use Guzzle\Http\Client; |
| 9 | 9 | use Guzzle\Http\Message\Request; |
| 10 | -use Guzzle\Http\Message\Response; |
|
| 11 | 10 | use Guzzle\Http\Exception\BadResponseException; |
| 12 | 11 | use Guzzle\Http\Exception\ClientErrorResponseException; |
| 13 | 12 | |
@@ -133,6 +133,6 @@ |
||
| 133 | 133 | return call_user_func_array([$this->getCollection(), $name], $arguments); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - throw new \Exception("Method $name not exist"); |
|
| 136 | + throw new \Exception("method $name not exist"); |
|
| 137 | 137 | } |
| 138 | 138 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | ) { |
| 38 | 38 | $url = $this->filterUriInstance($url); |
| 39 | 39 | if (!in_array($ratio, self::ALLOWED_RATIO)) { |
| 40 | - throw new \Exception("Ratio $ratio not allowed, allowed ratio are " . implode(', ', self::ALLOWED_RATIO)); |
|
| 40 | + throw new \Exception("ratio $ratio not allowed, allowed ratio are " . implode(', ', self::ALLOWED_RATIO)); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $this->collection = new Collection( |