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.

DOMList   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 95.65%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 13
lcom 1
cbo 0
dl 0
loc 62
ccs 22
cts 23
cp 0.9565
rs 10
c 1
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A __get() 0 11 3
A key() 0 3 1
A item() 0 6 2
A count() 0 3 1
A rewind() 0 3 1
A current() 0 3 1
A next() 0 3 1
A valid() 0 3 1
1
<?php namespace BetterDOMDocument;
2
3
// A BetterDOMNodeList object, which is very similar to a DOMNodeList, but it iterates in a reasonable way.
4
// Specifically, replacing or removing a node in the list won't screw up the index.
5
class DOMList implements \Countable, \Iterator {
6
  
7
  private $array = array();
8
  private $position = 0;
9
  
10
  private $length = 0;
11
  private $dom;
12
  
13 18
  public function __construct(\DOMNodeList $DOMNodeList, DOMDoc $dom) {
14 18
    foreach ($DOMNodeList as $item) {
15 18
      $this->array[] = $item;
16
    }
17
    
18 18
    $this->dom = $dom;
19 18
    $this->length = count($this->array);
20 18
    $this->position = 0;
21 18
  }
22
  
23
  // Provides read-only access to $length and $dom
24
  public function __get ($prop) {
25
    if ($prop == 'length') {
26
      return $this->length;
27
    }
28
    else if ($prop == 'dom') {
29
      return $this->dom;
30
    }
31
    else {
32
      return null;
33
    }
34
  }
35
36 1
  public function rewind() {
37 1
    $this->position = 0;
38 1
  }
39
40 1
  public function current() {
41 1
    return $this->array[$this->position];
42
  }
43
44
  public function key() {
45
    return $this->position;
46
  }
47
48 1
  public function next() {
49 1
    ++$this->position;
50 1
  }
51
52 1
  public function valid() {
53 1
    return isset($this->array[$this->position]);
54
  }
55
  
56 17
  public function item($index) {
57 17
    if (isset($this->array[$index])) {
58 17
      return $this->array[$index];
59
    }
60
    else return FALSE;
61
  }
62
  
63 18
  public function count() {
64 18
    return count($this->array);
65
  }
66
}