Completed
Pull Request — master (#37)
by Andreas
01:34
created

EventName   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 10 3
1
<?php
2
3
declare(strict_types = 1);
4
5
/**
6
 * Copyright Andrea Heigl <[email protected]>
7
 *
8
 * Licenses under the MIT-license. For details see the included file LICENSE.md
9
 */
10
11
namespace Callingallpapers\Subcommands\Sessionize\Parser;
12
13
use DOMDocument;
14
use DOMXPath;
15
16
class EventName
17
{
18
    public function parse(DOMDocument $dom, DOMXPath $xpath)
0 ignored issues
show
Unused Code introduced by
The parameter $dom is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
19
    {
20
        $confPath = $xpath->query('//h4');
21
22
        if (! $confPath || $confPath->length == 0) {
23
            throw new \InvalidArgumentException('The CfP does not seem to have an eventname');
24
        }
25
26
        return trim($confPath->item(0)->textContent);
27
    }
28
}
29