OpenGraphDescriptionParser   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 13
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A find() 0 10 3
1
<?php
2
3
namespace Fetcher\Parser;
4
5
use Fetcher\DataParser;
6
use Symfony\Component\DomCrawler\Crawler;
7
8
class OpenGraphDescriptionParser implements DataParser
9
{
10 3
    public function find(Crawler $crawler)
11
    {
12
        try {
13 3
            $description = $crawler->filterXPath('//meta[@property="og:description"]')->attr('content');
14
15 1
            return empty($description) ? null : $description;
16 2
        } catch (\InvalidArgumentException $e) {
17 2
            return null;
18
        }
19
    }
20
}
21