1 | <?php namespace Mascame\Artificer\Fields; |
||
9 | class FieldWrapper |
||
10 | { |
||
11 | use Filterable; |
||
12 | |||
13 | public static $widgets = array(); |
||
14 | |||
15 | /** |
||
16 | * Sometimes ajax limits output, setting this to true will return all |
||
17 | * |
||
18 | * @var bool |
||
19 | */ |
||
20 | public $showFullField = false; |
||
21 | |||
22 | /** |
||
23 | * @var FieldInterface|TypeInterface |
||
24 | */ |
||
25 | protected $field; |
||
26 | |||
27 | /** |
||
28 | * Field constructor. |
||
29 | * @param FieldInterface|TypeInterface $field |
||
30 | * @param null $relation |
||
|
|||
31 | */ |
||
32 | public function __construct(FieldInterface $field) |
||
38 | |||
39 | /** |
||
40 | * @param $widget |
||
41 | * @return bool |
||
42 | */ |
||
43 | public function addWidget(AbstractWidget $widget) |
||
53 | |||
54 | |||
55 | /** |
||
56 | * Used to load custom assets, widgets, ... |
||
57 | * |
||
58 | */ |
||
59 | public function boot() |
||
75 | |||
76 | /** |
||
77 | * @param null $value |
||
78 | * @return null |
||
79 | */ |
||
80 | public function show($value = null) |
||
92 | |||
93 | /** |
||
94 | * @return bool|mixed|null|string |
||
95 | */ |
||
96 | public function output() |
||
104 | |||
105 | /** |
||
106 | * @param $array |
||
107 | * @return bool |
||
108 | */ |
||
109 | protected function isAll($array) |
||
113 | |||
114 | /** |
||
115 | * @param string $visibility [visible|hidden] |
||
116 | * @return bool |
||
117 | */ |
||
118 | protected function isListedAs($visibility, $action) |
||
130 | |||
131 | /** |
||
132 | * list, edit, create |
||
133 | * |
||
134 | * Hidden fields have preference. |
||
135 | * |
||
136 | * @return bool |
||
137 | */ |
||
138 | public function isListable($action = null) |
||
146 | |||
147 | /** |
||
148 | * @param $value |
||
149 | * @param $array |
||
150 | * @return bool |
||
151 | */ |
||
152 | public function isInArray($value, $array) |
||
156 | |||
157 | |||
158 | /** |
||
159 | * @return string |
||
160 | */ |
||
161 | public function guarded() |
||
165 | |||
166 | /** |
||
167 | * @return bool |
||
168 | */ |
||
169 | public function isGuarded() |
||
170 | { |
||
171 | $guarded = Artificer::getModel()->getOption('guarded', []); |
||
172 | |||
173 | return $this->isInArray($this->field->getName(), $guarded); |
||
174 | } |
||
175 | |||
176 | /** |
||
177 | * @return bool |
||
178 | */ |
||
179 | public function isHidden() |
||
180 | { |
||
181 | $hidden = Artificer::getModel()->getOption('hidden', []); |
||
182 | |||
183 | return $this->isInArray($this->field->getName(), $hidden); |
||
184 | } |
||
185 | |||
186 | public static function get($name) |
||
190 | |||
191 | public function __get($name) { |
||
200 | |||
201 | public function __call($method, $args) { |
||
208 | } |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.