LogicImmoPartnerParser   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 7
c 0
b 0
f 0
dl 0
loc 16
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A parseLocation() 0 5 1
1
<?php
2
3
namespace App\Parser;
4
5
use App\Enum\Provider;
6
use Symfony\Component\DomCrawler\Crawler;
7
8
class LogicImmoPartnerParser extends AbstractParser
9
{
10
    protected const PROVIDER = Provider::LOGIC_IMMO;
11
12
    protected const SELECTOR_AD_WRAPPER  = 'table[bgcolor="#f1f1f1"] > tr:nth-child(n+6):not(:nth-last-child(-n+8)) table[width=600][bgcolor="#ffffff"]';
13
    protected const SELECTOR_LOCATION    = 'td.mea_txt_ad3';
14
    protected const SELECTOR_DESCRIPTION = 'td[style*="font-size:12px"]';
15
16
    /**
17
     * {@inheritDoc}
18
     */
19 1
    protected function parseLocation(Crawler $crawler): ?string
20
    {
21 1
        $data = parent::parseLocation($crawler);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $data is correct as parent::parseLocation($crawler) targeting App\Parser\AbstractParser::parseLocation() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

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.

Loading history...
22
23 1
        return trim(explode('|', $data)[0]);
0 ignored issues
show
Bug introduced by
$data of type null is incompatible with the type string expected by parameter $string of explode(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

23
        return trim(explode('|', /** @scrutinizer ignore-type */ $data)[0]);
Loading history...
24
    }
25
}
26