GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

MicrodataDOMDocument::getItems()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace YusufKandemir\MicrodataParser;
4
5
class MicrodataDOMDocument extends \DOMDocument
6
{
7
    /** @var \DOMXPath */
8
    public $xpath;
9
10
    /**
11
     * Get top-level items of the document
12
     *
13
     * @see https://www.w3.org/TR/2018/WD-microdata-20180426/#dfn-top-level-microdata-item
14
     *
15
     * @return \DOMNodeList List of top level items as elements
16
     */
17 39
    public function getItems() : \DOMNodeList
18
    {
19 39
        return $this->xpath->query('//*[@itemscope and not(@itemprop)]');
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     * Also assigns $xpath with DOMXPath of freshly loaded DOMDocument
25
     */
26 42
    public function loadHTML($source, $options = 0)
27
    {
28 42
        $return = parent::loadHTML($source, $options);
29
30 42
        $this->xpath = new \DOMXPath($this);
31
32 42
        return $return;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     * Also assigns $xpath with DOMXPath of freshly loaded DOMDocument
38
     */
39 3
    public function loadHTMLFile($filename, $options = 0)
40
    {
41 3
        $return = parent::loadHTMLFile($filename, $options);
42
43 3
        $this->xpath = new \DOMXPath($this);
44
45 3
        return $return;
46
    }
47
}
48