1 | <?php |
||
34 | class Slug extends Forms\Controls\TextInput |
||
35 | { |
||
36 | /** |
||
37 | * @var string|NULL |
||
38 | */ |
||
39 | private $templateFile; |
||
40 | |||
41 | /** |
||
42 | * @var UI\ITemplate |
||
43 | */ |
||
44 | private $template; |
||
45 | |||
46 | /** |
||
47 | * @var UI\ITemplateFactory |
||
48 | */ |
||
49 | private $templateFactory; |
||
50 | |||
51 | /** |
||
52 | * @var Forms\Controls\BaseControl[] |
||
53 | */ |
||
54 | private $fields = []; |
||
55 | |||
56 | /** |
||
57 | * Toggle box selector |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | private $toggleBox = '.ipub-slug-box'; |
||
62 | |||
63 | /** |
||
64 | * @var bool |
||
65 | */ |
||
66 | private static $registered = FALSE; |
||
67 | |||
68 | /** |
||
69 | * Enable or disable one time auto updating slug field from watched fields |
||
70 | * |
||
71 | * @var bool |
||
72 | */ |
||
73 | private $onetimeAutoUpdate = TRUE; |
||
74 | |||
75 | /** |
||
76 | * @param UI\ITemplateFactory $templateFactory |
||
77 | * @param string|NULL $label |
||
78 | * @param int|NULL $maxLength |
||
79 | */ |
||
80 | public function __construct(UI\ITemplateFactory $templateFactory, string $label = NULL, int $maxLength = NULL) |
||
86 | |||
87 | /** |
||
88 | * Add filed from which slug will be created |
||
89 | * |
||
90 | * @param Forms\Controls\BaseControl $field |
||
91 | * |
||
92 | * @return self |
||
93 | */ |
||
94 | public function addField(Forms\Controls\BaseControl $field) |
||
101 | |||
102 | /** |
||
103 | * Generates control's HTML element |
||
104 | */ |
||
105 | public function getControl() : FormSlug\Utils\Html |
||
141 | |||
142 | /** |
||
143 | * @return UI\ITemplate|Bridges\ApplicationLatte\Template |
||
144 | */ |
||
145 | public function getTemplate() : UI\ITemplate |
||
154 | |||
155 | /** |
||
156 | * Change default control template path |
||
157 | * |
||
158 | * @param string $templateFile |
||
159 | * |
||
160 | * @return void |
||
161 | * |
||
162 | * @throws Exceptions\FileNotFoundException |
||
163 | */ |
||
164 | public function setTemplateFile(string $templateFile) |
||
180 | |||
181 | /** |
||
182 | * @return string |
||
183 | */ |
||
184 | private function getTemplateFile() : string |
||
188 | |||
189 | /** |
||
190 | * @param UI\ITemplateFactory $templateFactory |
||
191 | * @param string $method |
||
192 | * |
||
193 | * @return void |
||
194 | */ |
||
195 | public static function register(UI\ITemplateFactory $templateFactory, $method = 'addSlug') |
||
214 | } |
||
215 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: