Bouss /
boussimmo
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace App\Parser; |
||||
| 4 | |||||
| 5 | use App\Enum\Provider; |
||||
| 6 | use Symfony\Component\DomCrawler\Crawler; |
||||
| 7 | |||||
| 8 | class SeLogerParser extends AbstractParser |
||||
| 9 | { |
||||
| 10 | protected const PROVIDER = Provider::SELOGER; |
||||
| 11 | |||||
| 12 | protected const SELECTOR_AD_WRAPPER = '.two-column > a[_category="Bloc annonce"]'; // Ignore "Recommendation" ads |
||||
| 13 | protected const SELECTOR_LOCATION = '.contents tr:nth-child(2) a'; |
||||
| 14 | |||||
| 15 | /** |
||||
| 16 | * {@inheritDoc} |
||||
| 17 | */ |
||||
| 18 | 1 | protected function parseLocation(Crawler $crawler): ?string |
|||
| 19 | { |
||||
| 20 | 1 | $description = parent::parseLocation($crawler); |
|||
|
0 ignored issues
–
show
|
|||||
| 21 | |||||
| 22 | 1 | if (1 === preg_match('/m²\s([-\w\s]+\s\(\d+\))/u', $description,$matches)) { |
|||
|
0 ignored issues
–
show
$description of type null is incompatible with the type string expected by parameter $subject of preg_match().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 23 | 1 | return trim($matches[1]); |
|||
| 24 | } |
||||
| 25 | |||||
| 26 | return null; |
||||
| 27 | } |
||||
| 28 | } |
||||
| 29 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.