@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Links the relationships with primary model. |
| 28 | - * @param $model ActiveRecordInterface |
|
| 28 | + * @param BaseActiveRecord $model ActiveRecordInterface |
|
| 29 | 29 | * @param array $data |
| 30 | 30 | */ |
| 31 | 31 | protected function linkRelationships($model, array $data = []) |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function parse($rawBody, $contentType) |
| 35 | 35 | { |
| 36 | 36 | $array = parent::parse($rawBody, $contentType); |
| 37 | - $data = ArrayHelper::getValue($array, 'data', []); |
|
| 37 | + $data = ArrayHelper::getValue($array, 'data', []); |
|
| 38 | 38 | if (empty($data)) { |
| 39 | 39 | if ($this->throwException) { |
| 40 | 40 | throw new BadRequestHttpException('The request MUST include a single resource object as primary data.'); |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | { |
| 186 | 186 | $result = []; |
| 187 | 187 | foreach (['id', 'type'] as $key) { |
| 188 | - $getter = 'get' . ucfirst($key); |
|
| 188 | + $getter = 'get'.ucfirst($key); |
|
| 189 | 189 | $value = $identifier->$getter(); |
| 190 | 190 | if ($value === null || is_array($value) || (is_object($value) && !method_exists($value, '__toString'))) { |
| 191 | - throw new InvalidValueException("The value {$key} of resource object " . get_class($identifier) . ' MUST be a string.'); |
|
| 191 | + throw new InvalidValueException("The value {$key} of resource object ".get_class($identifier).' MUST be a string.'); |
|
| 192 | 192 | } |
| 193 | 193 | if ($key === 'type' && $this->pluralize) { |
| 194 | 194 | $value = Inflector::pluralize($value); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | foreach ($relationship as $model) { |
| 224 | 224 | if ($model instanceof ResourceInterface) { |
| 225 | - $uniqueKey = $model->getType() . '/' . $model->getId(); |
|
| 225 | + $uniqueKey = $model->getType().'/'.$model->getId(); |
|
| 226 | 226 | $data[$uniqueKey] = $this->serializeModel($model); |
| 227 | 227 | } |
| 228 | 228 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | if (is_array($value)) { |
| 51 | 51 | $config = ['class' => Filter::className()]; |
| 52 | 52 | if ($this->id !== null) { |
| 53 | - $config['filterParam'] = $this->id . '-filter'; |
|
| 53 | + $config['filterParam'] = $this->id.'-filter'; |
|
| 54 | 54 | } |
| 55 | 55 | $this->_filter = Yii::createObject(array_merge($config, $value)); |
| 56 | 56 | } elseif ($value instanceof Filter || $value === false) { |