1 | <?php |
||
18 | class Refiller implements RefillerInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | const NAME = 'anidb'; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | const TITLE = 'AniDB.net'; |
||
29 | |||
30 | /** |
||
31 | * List of supported fields. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $supported_fields = [ |
||
36 | self::FIELD_DATE_END, |
||
37 | self::FIELD_DATE_PREMIERE, |
||
38 | self::FIELD_EPISODES, |
||
39 | self::FIELD_EPISODES_NUMBER, |
||
40 | self::FIELD_GENRES, |
||
41 | self::FIELD_NAMES, |
||
42 | self::FIELD_SOURCES, |
||
43 | self::FIELD_SUMMARY, |
||
44 | ]; |
||
45 | |||
46 | /** |
||
47 | * @var Browser |
||
48 | */ |
||
49 | private $browser; |
||
50 | |||
51 | /** |
||
52 | * @var Filler |
||
53 | */ |
||
54 | protected $filler; |
||
55 | |||
56 | /** |
||
57 | * @var Search |
||
58 | */ |
||
59 | protected $search; |
||
60 | |||
61 | /** |
||
62 | * @var SummaryCleaner |
||
63 | */ |
||
64 | protected $cleaner; |
||
65 | |||
66 | /** |
||
67 | * @param Browser $browser |
||
68 | * @param Filler $filler |
||
69 | * @param Search $search |
||
70 | * @param SummaryCleaner $cleaner |
||
71 | */ |
||
72 | public function __construct(Browser $browser, Filler $filler, Search $search, SummaryCleaner $cleaner) |
||
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getName() |
||
87 | |||
88 | /** |
||
89 | * @return string |
||
90 | */ |
||
91 | public function getTitle() |
||
95 | |||
96 | /** |
||
97 | * Is can refill item from source. |
||
98 | * |
||
99 | * @param Item $item |
||
100 | * @param string $field |
||
101 | * |
||
102 | * @return bool |
||
103 | */ |
||
104 | public function isCanRefill(Item $item, $field) |
||
108 | |||
109 | /** |
||
110 | * Refill item field from source. |
||
111 | * |
||
112 | * @param Item $item |
||
113 | * @param string $field |
||
114 | * |
||
115 | * @return Item |
||
116 | */ |
||
117 | public function refill(Item $item, $field) |
||
167 | |||
168 | /** |
||
169 | * @param Item $item |
||
170 | * @param string $field |
||
171 | * |
||
172 | * @return bool |
||
173 | */ |
||
174 | public function isCanSearch(Item $item, $field) |
||
191 | |||
192 | /** |
||
193 | * Search items for refill. |
||
194 | * |
||
195 | * @param Item $item |
||
196 | * @param string $field |
||
197 | * |
||
198 | * @return ItemRefiller[] |
||
199 | */ |
||
200 | public function search(Item $item, $field) |
||
249 | |||
250 | /** |
||
251 | * Refill item field from search result. |
||
252 | * |
||
253 | * @param Item $item |
||
254 | * @param string $field |
||
255 | * @param array $data |
||
256 | * |
||
257 | * @return Item |
||
258 | */ |
||
259 | public function refillFromSearchResult(Item $item, $field, array $data) |
||
270 | |||
271 | /** |
||
272 | * @param Item $item |
||
273 | * |
||
274 | * @return string |
||
275 | */ |
||
276 | public function getSourceForFill(Item $item) |
||
287 | } |
||
288 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: