1 | <?php |
||
10 | class AttributeCollection extends Collection |
||
11 | { |
||
12 | /** |
||
13 | * The items contained in the collection. |
||
14 | * |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $items = []; |
||
18 | |||
19 | /** |
||
20 | * Field Manager Instance. |
||
21 | * |
||
22 | * @var \LaravelFlare\Fields\FieldManager |
||
23 | */ |
||
24 | protected $fields; |
||
25 | |||
26 | /** |
||
27 | * ModelAdmin which contains this Attribute Collection. |
||
28 | * |
||
29 | * @var \LaravelFlare\Flare\Admin\Models\ModelAdmin |
||
30 | */ |
||
31 | public $modelManager; |
||
32 | |||
33 | /** |
||
34 | * Create a new collection. |
||
35 | * |
||
36 | * @param mixed $items |
||
37 | */ |
||
38 | public function __construct($items = [], $modelManager = null) |
||
46 | |||
47 | /** |
||
48 | * Attempt to reformat the current attribute items array |
||
49 | * into the most usable format (an Attribute Collection). |
||
50 | */ |
||
51 | public function formatFields() |
||
64 | |||
65 | /** |
||
66 | * Allows adding fields to the Attribute Collection. |
||
67 | * |
||
68 | * @param array $items |
||
69 | */ |
||
70 | public function add($items = []) |
||
78 | |||
79 | /** |
||
80 | * Format an Inner Field which can either be in the format |
||
81 | * of an Array, an instance of BaseAttribute or even an |
||
82 | * AttributeCollection object (which contains more!). |
||
83 | * |
||
84 | * @param mixed $name |
||
85 | * @param mixed $inner |
||
86 | * |
||
87 | * @return mixed |
||
88 | */ |
||
89 | protected function formatInnerField($name = null, $inner = []) |
||
126 | |||
127 | /** |
||
128 | * Create and return a Field Instance |
||
129 | * |
||
130 | * @param mixed $type |
||
131 | * @param string $name |
||
132 | * @param string $value |
||
133 | * @param mixed $inner |
||
134 | * |
||
135 | * @return |
||
136 | */ |
||
137 | private function createField($type, $name, $value, $inner) |
||
145 | |||
146 | /** |
||
147 | * Get any dynamic options for an attribute |
||
148 | * |
||
149 | * @param string $name |
||
150 | * |
||
151 | * @return mixed |
||
152 | */ |
||
153 | private function getOptions($name) |
||
159 | |||
160 | /** |
||
161 | * Determine if an options method exists for an attribute. |
||
162 | * |
||
163 | * @param string $key |
||
164 | * |
||
165 | * @return bool |
||
166 | */ |
||
167 | public function hasOptionsMethod($key) |
||
171 | |||
172 | /** |
||
173 | * Get the value of an attribute for the field. |
||
174 | * |
||
175 | * @param string $name |
||
176 | * |
||
177 | * @return mixed |
||
178 | */ |
||
179 | private function getValue($name) |
||
187 | } |
||
188 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..