| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | function scraping_imdb($url) |
||
| 6 | { |
||
| 7 | // init |
||
| 8 | $return = []; |
||
| 9 | |||
| 10 | // create HTML DOM |
||
| 11 | $dom = \voku\helper\HtmlDomParser::file_get_html($url); |
||
| 12 | |||
| 13 | // get title |
||
| 14 | $return['Title'] = $dom->find('title', 0)->innertext; |
||
| 15 | |||
| 16 | // get rating |
||
| 17 | $return['Rating'] = $dom->find('.ratingValue strong', 0)->getAttribute('title'); |
||
|
|
|||
| 18 | |||
| 19 | return $return; |
||
| 20 | } |
||
| 21 | |||
| 28 | } |
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: