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

EventName::parse()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 3
nc 2
nop 2
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