TitleParser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
ccs 4
cts 4
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A find() 0 8 2
1
<?php
2
3
namespace Fetcher\Parser;
4
5
use Fetcher\DataParser;
6
use Symfony\Component\DomCrawler\Crawler;
7
8
class TitleParser implements DataParser
9
{
10 3
    public function find(Crawler $crawler)
11
    {
12
        try {
13 3
            return trim($crawler->filterXPath('//head/title')->text());
14 2
        } catch (\InvalidArgumentException $e) {
15 2
            return null;
16
        }
17
    }
18
}
19