Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | public function transform(FieldModel $field) |
||
11 | { |
||
12 | $fieldTypes = app('field.types'); |
||
13 | $type = $fieldTypes->getFieldClass($field->type); |
||
14 | return [ |
||
15 | 'id' => $field->id, |
||
16 | 'namespace' => $field->namespace, |
||
17 | 'name' => $field->name, |
||
18 | 'description' => $field->description, |
||
19 | 'slug' => $field->slug, |
||
20 | 'type' => $field->type, |
||
21 | 'options' => unserialize($field->options), |
||
22 | 'locked' => (bool) $field->locked, |
||
23 | 'hidden' => (bool) $field->hidden, |
||
|
|||
24 | 'order' => $field->order, |
||
25 | 'default' => $field->default, |
||
26 | 'required' => (string)$field->required, |
||
27 | 'fieldType' => [ |
||
28 | 'name' => $type->name |
||
29 | ] |
||
30 | ]; |
||
31 | } |
||
32 | } |
||
33 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.