1 | <?php |
||
14 | class FormBuilder |
||
15 | { |
||
16 | /** |
||
17 | * The entity the field is being created for |
||
18 | * @var EntityModel |
||
19 | */ |
||
20 | protected $entity; |
||
21 | |||
22 | /** |
||
23 | * URL to return to |
||
24 | * @var |
||
25 | */ |
||
26 | protected $url; |
||
27 | |||
28 | /** |
||
29 | * Field Types |
||
30 | * @var FieldTypes |
||
31 | */ |
||
32 | protected $types; |
||
33 | |||
34 | /** |
||
35 | * When edit, it should have a model to work with |
||
36 | * @var |
||
37 | */ |
||
38 | protected $model; |
||
39 | |||
40 | /** |
||
41 | * Is the edit form? |
||
42 | * @var bool |
||
43 | */ |
||
44 | protected $isEdit = false; |
||
45 | |||
46 | /** |
||
47 | * Field Type |
||
48 | * @var |
||
49 | */ |
||
50 | protected $type; |
||
51 | |||
52 | /** |
||
53 | * Create a new Object |
||
54 | * @param EntityModel $entity |
||
55 | */ |
||
56 | public function __construct(EntityModel $entity) |
||
57 | { |
||
58 | $this->entity = $entity; |
||
59 | $this->types = app('field.types'); |
||
|
|||
60 | } |
||
61 | |||
62 | /** |
||
63 | * set the return URL after the post |
||
64 | * @param bool $url |
||
65 | */ |
||
66 | public function setReturnUrl($url = false) |
||
70 | |||
71 | /** |
||
72 | * @param FieldModel $model |
||
73 | */ |
||
74 | public function setModel(FieldModel $model) |
||
80 | |||
81 | /** |
||
82 | * render the form to add the field |
||
83 | * @return string |
||
84 | */ |
||
85 | public function render() |
||
106 | |||
107 | /** |
||
108 | * Get the Field Types |
||
109 | * @return array |
||
110 | */ |
||
111 | public function getFieldTypes() |
||
120 | } |
||
121 |
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..