Bouss /
boussimmo
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace App\Parser; |
||||
| 4 | |||||
| 5 | use App\Enum\Provider; |
||||
| 6 | use Symfony\Component\DomCrawler\Crawler; |
||||
| 7 | |||||
| 8 | class SuperimmoNeufParser extends AbstractParser |
||||
| 9 | { |
||||
| 10 | protected const PROVIDER = Provider::SUPERIMMO_NEUF; |
||||
| 11 | |||||
| 12 | protected const SELECTOR_AD_WRAPPER = 'td[style="width: 540px;"]'; |
||||
| 13 | protected const SELECTOR_LOCATION = 'table:nth-child(2) tr:nth-child(2) span'; |
||||
| 14 | protected const SELECTOR_TITLE = 'table:nth-child(2) tr:nth-child(1) span'; |
||||
| 15 | protected const SELECTOR_DESCRIPTION = 'table:nth-child(2) tr:nth-child(5) span'; |
||||
| 16 | |||||
| 17 | /** |
||||
| 18 | * {@inheritDoc} |
||||
| 19 | */ |
||||
| 20 | 1 | protected function parsePhoto(Crawler $crawler): ?string |
|||
| 21 | { |
||||
| 22 | 1 | $photo = parent::parsePhoto($crawler); |
|||
| 23 | 1 | $photo = substr($photo, strpos($photo, '#')); |
|||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
It seems like
$photo can also be of type null; however, parameter $string of substr() does only seem to accept string, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 24 | |||||
| 25 | 1 | return str_replace('wide', 'biggest', $photo); |
|||
| 26 | } |
||||
| 27 | } |
||||
| 28 |