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.
Passed
Pull Request — master (#2)
by no
02:18
created
src/TagMatcher.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@
 block discarded – undo
6 6
 
7 7
 abstract class TagMatcher extends TypeSafeDiagnosingMatcher {
8 8
 
9
-	public function __construct() {
10
-		parent::__construct( self::TYPE_OBJECT, \DOMElement::class );
11
-	}
9
+    public function __construct() {
10
+        parent::__construct( self::TYPE_OBJECT, \DOMElement::class );
11
+    }
12 12
 
13 13
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 abstract class TagMatcher extends TypeSafeDiagnosingMatcher {
8 8
 
9 9
 	public function __construct() {
10
-		parent::__construct( self::TYPE_OBJECT, \DOMElement::class );
10
+		parent::__construct(self::TYPE_OBJECT, \DOMElement::class);
11 11
 	}
12 12
 
13 13
 }
Please login to merge, or discard this patch.
src/XmlNodeRecursiveIterator.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -4,27 +4,27 @@
 block discarded – undo
4 4
 
5 5
 class XmlNodeRecursiveIterator extends \ArrayIterator {
6 6
 
7
-	public function __construct( \DOMNodeList $nodeList ) {
8
-		$queue = $this->addElementsToQueue( [], $nodeList );
9
-		parent::__construct( $queue );
10
-	}
7
+    public function __construct( \DOMNodeList $nodeList ) {
8
+        $queue = $this->addElementsToQueue( [], $nodeList );
9
+        parent::__construct( $queue );
10
+    }
11 11
 
12
-	/**
13
-	 * @param \DOMNode[] $queue
14
-	 * @param \DOMNodeList $nodeList
15
-	 *
16
-	 * @return \DOMNode[] New queue
17
-	 */
18
-	private function addElementsToQueue( array $queue, \DOMNodeList $nodeList ) {
19
-		/** @var \DOMNode $node */
20
-		foreach ( $nodeList as $node ) {
21
-			$queue[] = $node;
22
-			if ( $node->childNodes !== null ) {
23
-				$queue = $this->addElementsToQueue( $queue, $node->childNodes );
24
-			}
25
-		}
12
+    /**
13
+     * @param \DOMNode[] $queue
14
+     * @param \DOMNodeList $nodeList
15
+     *
16
+     * @return \DOMNode[] New queue
17
+     */
18
+    private function addElementsToQueue( array $queue, \DOMNodeList $nodeList ) {
19
+        /** @var \DOMNode $node */
20
+        foreach ( $nodeList as $node ) {
21
+            $queue[] = $node;
22
+            if ( $node->childNodes !== null ) {
23
+                $queue = $this->addElementsToQueue( $queue, $node->childNodes );
24
+            }
25
+        }
26 26
 
27
-		return $queue;
28
-	}
27
+        return $queue;
28
+    }
29 29
 
30 30
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@  discard block
 block discarded – undo
4 4
 
5 5
 class XmlNodeRecursiveIterator extends \ArrayIterator {
6 6
 
7
-	public function __construct( \DOMNodeList $nodeList ) {
8
-		$queue = $this->addElementsToQueue( [], $nodeList );
9
-		parent::__construct( $queue );
7
+	public function __construct(\DOMNodeList $nodeList) {
8
+		$queue = $this->addElementsToQueue([], $nodeList);
9
+		parent::__construct($queue);
10 10
 	}
11 11
 
12 12
 	/**
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
 	 *
16 16
 	 * @return \DOMNode[] New queue
17 17
 	 */
18
-	private function addElementsToQueue( array $queue, \DOMNodeList $nodeList ) {
18
+	private function addElementsToQueue(array $queue, \DOMNodeList $nodeList) {
19 19
 		/** @var \DOMNode $node */
20
-		foreach ( $nodeList as $node ) {
20
+		foreach ($nodeList as $node) {
21 21
 			$queue[] = $node;
22
-			if ( $node->childNodes !== null ) {
23
-				$queue = $this->addElementsToQueue( $queue, $node->childNodes );
22
+			if ($node->childNodes !== null) {
23
+				$queue = $this->addElementsToQueue($queue, $node->childNodes);
24 24
 			}
25 25
 		}
26 26
 
Please login to merge, or discard this patch.
src/AttributeMatcher.php 2 patches
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -8,80 +8,80 @@
 block discarded – undo
8 8
 
9 9
 class AttributeMatcher extends TagMatcher {
10 10
 
11
-	/**
12
-	 * @var Matcher
13
-	 */
14
-	private $attributeNameMatcher;
11
+    /**
12
+     * @var Matcher
13
+     */
14
+    private $attributeNameMatcher;
15 15
 
16
-	/**
17
-	 * @var Matcher|null
18
-	 */
19
-	private $valueMatcher;
16
+    /**
17
+     * @var Matcher|null
18
+     */
19
+    private $valueMatcher;
20 20
 
21
-	/**
22
-	 * @param Matcher|string $attributeName
23
-	 *
24
-	 * @return self
25
-	 */
26
-	public static function withAttribute( $attributeName ) {
27
-		return new static( Util::wrapValueWithIsEqual( $attributeName ) );
28
-	}
21
+    /**
22
+     * @param Matcher|string $attributeName
23
+     *
24
+     * @return self
25
+     */
26
+    public static function withAttribute( $attributeName ) {
27
+        return new static( Util::wrapValueWithIsEqual( $attributeName ) );
28
+    }
29 29
 
30
-	/**
31
-	 * @param Matcher $attributeNameMatcher
32
-	 */
33
-	public function __construct( Matcher $attributeNameMatcher ) {
34
-		parent::__construct();
30
+    /**
31
+     * @param Matcher $attributeNameMatcher
32
+     */
33
+    public function __construct( Matcher $attributeNameMatcher ) {
34
+        parent::__construct();
35 35
 
36
-		$this->attributeNameMatcher = $attributeNameMatcher;
37
-	}
36
+        $this->attributeNameMatcher = $attributeNameMatcher;
37
+    }
38 38
 
39
-	/**
40
-	 * @param Matcher|string $value
41
-	 *
42
-	 * @return AttributeMatcher
43
-	 */
44
-	public function havingValue( $value ) {
45
-		// TODO: Throw exception if value is set
46
-		$result = clone $this;
47
-		$result->valueMatcher = Util::wrapValueWithIsEqual( $value );
39
+    /**
40
+     * @param Matcher|string $value
41
+     *
42
+     * @return AttributeMatcher
43
+     */
44
+    public function havingValue( $value ) {
45
+        // TODO: Throw exception if value is set
46
+        $result = clone $this;
47
+        $result->valueMatcher = Util::wrapValueWithIsEqual( $value );
48 48
 
49
-		return $result;
50
-	}
49
+        return $result;
50
+    }
51 51
 
52
-	public function describeTo( Description $description ) {
53
-		$description->appendText( 'with attribute ' )
54
-			->appendDescriptionOf( $this->attributeNameMatcher );
55
-		if ( $this->valueMatcher ) {
56
-			$description->appendText( ' having value ' )
57
-				->appendDescriptionOf( $this->valueMatcher );
58
-		}
59
-	}
52
+    public function describeTo( Description $description ) {
53
+        $description->appendText( 'with attribute ' )
54
+            ->appendDescriptionOf( $this->attributeNameMatcher );
55
+        if ( $this->valueMatcher ) {
56
+            $description->appendText( ' having value ' )
57
+                ->appendDescriptionOf( $this->valueMatcher );
58
+        }
59
+    }
60 60
 
61
-	/**
62
-	 * @param \DOMElement $item
63
-	 * @param Description $mismatchDescription
64
-	 *
65
-	 * @return bool
66
-	 */
67
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
68
-		/** @var \DOMAttr $attribute */
69
-		foreach ( $item->attributes as $attribute ) {
70
-			if ( $this->valueMatcher ) {
71
-				if (
72
-					$this->attributeNameMatcher->matches( $attribute->name )
73
-					&& $this->valueMatcher->matches( $attribute->value )
74
-				) {
75
-					return true;
76
-				}
77
-			} else {
78
-				if ( $this->attributeNameMatcher->matches( $attribute->name ) ) {
79
-					return true;
80
-				}
81
-			}
82
-		}
61
+    /**
62
+     * @param \DOMElement $item
63
+     * @param Description $mismatchDescription
64
+     *
65
+     * @return bool
66
+     */
67
+    protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
68
+        /** @var \DOMAttr $attribute */
69
+        foreach ( $item->attributes as $attribute ) {
70
+            if ( $this->valueMatcher ) {
71
+                if (
72
+                    $this->attributeNameMatcher->matches( $attribute->name )
73
+                    && $this->valueMatcher->matches( $attribute->value )
74
+                ) {
75
+                    return true;
76
+                }
77
+            } else {
78
+                if ( $this->attributeNameMatcher->matches( $attribute->name ) ) {
79
+                    return true;
80
+                }
81
+            }
82
+        }
83 83
 
84
-		return false;
85
-	}
84
+        return false;
85
+    }
86 86
 
87 87
 }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
 	 *
24 24
 	 * @return self
25 25
 	 */
26
-	public static function withAttribute( $attributeName ) {
27
-		return new static( Util::wrapValueWithIsEqual( $attributeName ) );
26
+	public static function withAttribute($attributeName) {
27
+		return new static(Util::wrapValueWithIsEqual($attributeName));
28 28
 	}
29 29
 
30 30
 	/**
31 31
 	 * @param Matcher $attributeNameMatcher
32 32
 	 */
33
-	public function __construct( Matcher $attributeNameMatcher ) {
33
+	public function __construct(Matcher $attributeNameMatcher) {
34 34
 		parent::__construct();
35 35
 
36 36
 		$this->attributeNameMatcher = $attributeNameMatcher;
@@ -41,20 +41,20 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @return AttributeMatcher
43 43
 	 */
44
-	public function havingValue( $value ) {
44
+	public function havingValue($value) {
45 45
 		// TODO: Throw exception if value is set
46 46
 		$result = clone $this;
47
-		$result->valueMatcher = Util::wrapValueWithIsEqual( $value );
47
+		$result->valueMatcher = Util::wrapValueWithIsEqual($value);
48 48
 
49 49
 		return $result;
50 50
 	}
51 51
 
52
-	public function describeTo( Description $description ) {
53
-		$description->appendText( 'with attribute ' )
54
-			->appendDescriptionOf( $this->attributeNameMatcher );
55
-		if ( $this->valueMatcher ) {
56
-			$description->appendText( ' having value ' )
57
-				->appendDescriptionOf( $this->valueMatcher );
52
+	public function describeTo(Description $description) {
53
+		$description->appendText('with attribute ')
54
+			->appendDescriptionOf($this->attributeNameMatcher);
55
+		if ($this->valueMatcher) {
56
+			$description->appendText(' having value ')
57
+				->appendDescriptionOf($this->valueMatcher);
58 58
 		}
59 59
 	}
60 60
 
@@ -64,18 +64,18 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @return bool
66 66
 	 */
67
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
67
+	protected function matchesSafelyWithDiagnosticDescription($item, Description $mismatchDescription) {
68 68
 		/** @var \DOMAttr $attribute */
69
-		foreach ( $item->attributes as $attribute ) {
70
-			if ( $this->valueMatcher ) {
69
+		foreach ($item->attributes as $attribute) {
70
+			if ($this->valueMatcher) {
71 71
 				if (
72
-					$this->attributeNameMatcher->matches( $attribute->name )
73
-					&& $this->valueMatcher->matches( $attribute->value )
72
+					$this->attributeNameMatcher->matches($attribute->name)
73
+					&& $this->valueMatcher->matches($attribute->value)
74 74
 				) {
75 75
 					return true;
76 76
 				}
77 77
 			} else {
78
-				if ( $this->attributeNameMatcher->matches( $attribute->name ) ) {
78
+				if ($this->attributeNameMatcher->matches($attribute->name)) {
79 79
 					return true;
80 80
 				}
81 81
 			}
Please login to merge, or discard this patch.
src/ClassMatcher.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -8,46 +8,46 @@
 block discarded – undo
8 8
 
9 9
 class ClassMatcher extends TagMatcher {
10 10
 
11
-	/**
12
-	 * @var Matcher
13
-	 */
14
-	private $classMatcher;
15
-
16
-	/**
17
-	 * @param Matcher|string $class
18
-	 *
19
-	 * @return self
20
-	 */
21
-	public static function withClass( $class ) {
22
-		return new static( Util::wrapValueWithIsEqual( $class ) );
23
-	}
24
-
25
-	public function __construct( Matcher $class ) {
26
-		parent::__construct();
27
-		$this->classMatcher = $class;
28
-	}
29
-
30
-	public function describeTo( Description $description ) {
31
-		$description->appendText( 'with class ' )->appendDescriptionOf( $this->classMatcher );
32
-	}
33
-
34
-	/**
35
-	 * @param \DOMElement $item
36
-	 * @param Description $mismatchDescription
37
-	 *
38
-	 * @return bool
39
-	 */
40
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
41
-		$classAttribute = $item->getAttribute( 'class' );
42
-
43
-		$classes = preg_split( '/\s+/u', $classAttribute );
44
-		foreach ( $classes as $class ) {
45
-			if ( $this->classMatcher->matches( $class ) ) {
46
-				return true;
47
-			}
48
-		}
49
-
50
-		return false;
51
-	}
11
+    /**
12
+     * @var Matcher
13
+     */
14
+    private $classMatcher;
15
+
16
+    /**
17
+     * @param Matcher|string $class
18
+     *
19
+     * @return self
20
+     */
21
+    public static function withClass( $class ) {
22
+        return new static( Util::wrapValueWithIsEqual( $class ) );
23
+    }
24
+
25
+    public function __construct( Matcher $class ) {
26
+        parent::__construct();
27
+        $this->classMatcher = $class;
28
+    }
29
+
30
+    public function describeTo( Description $description ) {
31
+        $description->appendText( 'with class ' )->appendDescriptionOf( $this->classMatcher );
32
+    }
33
+
34
+    /**
35
+     * @param \DOMElement $item
36
+     * @param Description $mismatchDescription
37
+     *
38
+     * @return bool
39
+     */
40
+    protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
41
+        $classAttribute = $item->getAttribute( 'class' );
42
+
43
+        $classes = preg_split( '/\s+/u', $classAttribute );
44
+        foreach ( $classes as $class ) {
45
+            if ( $this->classMatcher->matches( $class ) ) {
46
+                return true;
47
+            }
48
+        }
49
+
50
+        return false;
51
+    }
52 52
 
53 53
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return self
20 20
 	 */
21
-	public static function withClass( $class ) {
22
-		return new static( Util::wrapValueWithIsEqual( $class ) );
21
+	public static function withClass($class) {
22
+		return new static(Util::wrapValueWithIsEqual($class));
23 23
 	}
24 24
 
25
-	public function __construct( Matcher $class ) {
25
+	public function __construct(Matcher $class) {
26 26
 		parent::__construct();
27 27
 		$this->classMatcher = $class;
28 28
 	}
29 29
 
30
-	public function describeTo( Description $description ) {
31
-		$description->appendText( 'with class ' )->appendDescriptionOf( $this->classMatcher );
30
+	public function describeTo(Description $description) {
31
+		$description->appendText('with class ')->appendDescriptionOf($this->classMatcher);
32 32
 	}
33 33
 
34 34
 	/**
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @return bool
39 39
 	 */
40
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
41
-		$classAttribute = $item->getAttribute( 'class' );
40
+	protected function matchesSafelyWithDiagnosticDescription($item, Description $mismatchDescription) {
41
+		$classAttribute = $item->getAttribute('class');
42 42
 
43
-		$classes = preg_split( '/\s+/u', $classAttribute );
44
-		foreach ( $classes as $class ) {
45
-			if ( $this->classMatcher->matches( $class ) ) {
43
+		$classes = preg_split('/\s+/u', $classAttribute);
44
+		foreach ($classes as $class) {
45
+			if ($this->classMatcher->matches($class)) {
46 46
 				return true;
47 47
 			}
48 48
 		}
Please login to merge, or discard this patch.
src/TextContentsMatcher.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -8,37 +8,37 @@
 block discarded – undo
8 8
 
9 9
 class TextContentsMatcher extends TagMatcher {
10 10
 
11
-	/**
12
-	 * @var Matcher
13
-	 */
14
-	private $matcher;
15
-
16
-	/**
17
-	 * @param Matcher|string $text
18
-	 *
19
-	 * @return self
20
-	 */
21
-	public static function havingTextContents( $text ) {
22
-		return new static( Util::wrapValueWithIsEqual( $text ) );
23
-	}
24
-
25
-	public function __construct( Matcher $matcher ) {
26
-		parent::__construct();
27
-		$this->matcher = $matcher;
28
-	}
29
-
30
-	public function describeTo( Description $description ) {
31
-		$description->appendText( 'having text contents ' )->appendDescriptionOf( $this->matcher );
32
-	}
33
-
34
-	/**
35
-	 * @param \DOMElement $item
36
-	 * @param Description $mismatchDescription
37
-	 *
38
-	 * @return bool
39
-	 */
40
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
41
-		return $this->matcher->matches( $item->textContent );
42
-	}
11
+    /**
12
+     * @var Matcher
13
+     */
14
+    private $matcher;
15
+
16
+    /**
17
+     * @param Matcher|string $text
18
+     *
19
+     * @return self
20
+     */
21
+    public static function havingTextContents( $text ) {
22
+        return new static( Util::wrapValueWithIsEqual( $text ) );
23
+    }
24
+
25
+    public function __construct( Matcher $matcher ) {
26
+        parent::__construct();
27
+        $this->matcher = $matcher;
28
+    }
29
+
30
+    public function describeTo( Description $description ) {
31
+        $description->appendText( 'having text contents ' )->appendDescriptionOf( $this->matcher );
32
+    }
33
+
34
+    /**
35
+     * @param \DOMElement $item
36
+     * @param Description $mismatchDescription
37
+     *
38
+     * @return bool
39
+     */
40
+    protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
41
+        return $this->matcher->matches( $item->textContent );
42
+    }
43 43
 
44 44
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return self
20 20
 	 */
21
-	public static function havingTextContents( $text ) {
22
-		return new static( Util::wrapValueWithIsEqual( $text ) );
21
+	public static function havingTextContents($text) {
22
+		return new static(Util::wrapValueWithIsEqual($text));
23 23
 	}
24 24
 
25
-	public function __construct( Matcher $matcher ) {
25
+	public function __construct(Matcher $matcher) {
26 26
 		parent::__construct();
27 27
 		$this->matcher = $matcher;
28 28
 	}
29 29
 
30
-	public function describeTo( Description $description ) {
31
-		$description->appendText( 'having text contents ' )->appendDescriptionOf( $this->matcher );
30
+	public function describeTo(Description $description) {
31
+		$description->appendText('having text contents ')->appendDescriptionOf($this->matcher);
32 32
 	}
33 33
 
34 34
 	/**
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @return bool
39 39
 	 */
40
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
41
-		return $this->matcher->matches( $item->textContent );
40
+	protected function matchesSafelyWithDiagnosticDescription($item, Description $mismatchDescription) {
41
+		return $this->matcher->matches($item->textContent);
42 42
 	}
43 43
 
44 44
 }
Please login to merge, or discard this patch.
src/RootElementMatcher.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -8,60 +8,60 @@
 block discarded – undo
8 8
 
9 9
 class RootElementMatcher extends TypeSafeDiagnosingMatcher {
10 10
 
11
-	/**
12
-	 * @var Matcher
13
-	 */
14
-	private $tagMatcher;
11
+    /**
12
+     * @var Matcher
13
+     */
14
+    private $tagMatcher;
15 15
 
16
-	/**
17
-	 * @param Matcher|null $tagMatcher
18
-	 *
19
-	 * @return static
20
-	 */
21
-	public static function havingRootElement( Matcher $tagMatcher = null ) {
22
-		return new static( $tagMatcher );
23
-	}
16
+    /**
17
+     * @param Matcher|null $tagMatcher
18
+     *
19
+     * @return static
20
+     */
21
+    public static function havingRootElement( Matcher $tagMatcher = null ) {
22
+        return new static( $tagMatcher );
23
+    }
24 24
 
25
-	public function __construct( Matcher $tagMatcher = null ) {
26
-		parent::__construct( self::TYPE_OBJECT, \DOMDocument::class );
27
-		$this->tagMatcher = $tagMatcher;
28
-	}
25
+    public function __construct( Matcher $tagMatcher = null ) {
26
+        parent::__construct( self::TYPE_OBJECT, \DOMDocument::class );
27
+        $this->tagMatcher = $tagMatcher;
28
+    }
29 29
 
30
-	public function describeTo( Description $description ) {
31
-		$description->appendText( 'having root element ' );
32
-		if ( $this->tagMatcher ) {
33
-			$description->appendDescriptionOf( $this->tagMatcher );
34
-		}
35
-	}
30
+    public function describeTo( Description $description ) {
31
+        $description->appendText( 'having root element ' );
32
+        if ( $this->tagMatcher ) {
33
+            $description->appendDescriptionOf( $this->tagMatcher );
34
+        }
35
+    }
36 36
 
37
-	/**
38
-	 * @param \DOMDocument $item
39
-	 * @param Description $mismatchDescription
40
-	 *
41
-	 * @return bool
42
-	 */
43
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
44
-		$DOMNodeList = $item->documentElement->childNodes->item( 0 )->childNodes;
45
-		if ( $DOMNodeList->length > 1 ) {
46
-			// TODO Test this description
47
-			$mismatchDescription->appendText( 'having ' . $DOMNodeList->length . ' root elements ' );
48
-			return false;
49
-		}
37
+    /**
38
+     * @param \DOMDocument $item
39
+     * @param Description $mismatchDescription
40
+     *
41
+     * @return bool
42
+     */
43
+    protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
44
+        $DOMNodeList = $item->documentElement->childNodes->item( 0 )->childNodes;
45
+        if ( $DOMNodeList->length > 1 ) {
46
+            // TODO Test this description
47
+            $mismatchDescription->appendText( 'having ' . $DOMNodeList->length . ' root elements ' );
48
+            return false;
49
+        }
50 50
 
51
-		$target = $DOMNodeList->item( 0 );
52
-		if ( !$target ) {
53
-			// TODO Reproduce?
54
-			$mismatchDescription->appendText( 'having no root elements ' );
55
-			return false;
56
-		}
51
+        $target = $DOMNodeList->item( 0 );
52
+        if ( !$target ) {
53
+            // TODO Reproduce?
54
+            $mismatchDescription->appendText( 'having no root elements ' );
55
+            return false;
56
+        }
57 57
 
58
-		if ( $this->tagMatcher ) {
59
-			$mismatchDescription->appendText( 'root element ' );
60
-			$this->tagMatcher->describeMismatch( $target, $mismatchDescription );
61
-			return $this->tagMatcher->matches( $target );
62
-		}
58
+        if ( $this->tagMatcher ) {
59
+            $mismatchDescription->appendText( 'root element ' );
60
+            $this->tagMatcher->describeMismatch( $target, $mismatchDescription );
61
+            return $this->tagMatcher->matches( $target );
62
+        }
63 63
 
64
-		return true;
65
-	}
64
+        return true;
65
+    }
66 66
 
67 67
 }
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -18,19 +18,19 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return static
20 20
 	 */
21
-	public static function havingRootElement( Matcher $tagMatcher = null ) {
22
-		return new static( $tagMatcher );
21
+	public static function havingRootElement(Matcher $tagMatcher = null) {
22
+		return new static($tagMatcher);
23 23
 	}
24 24
 
25
-	public function __construct( Matcher $tagMatcher = null ) {
26
-		parent::__construct( self::TYPE_OBJECT, \DOMDocument::class );
25
+	public function __construct(Matcher $tagMatcher = null) {
26
+		parent::__construct(self::TYPE_OBJECT, \DOMDocument::class);
27 27
 		$this->tagMatcher = $tagMatcher;
28 28
 	}
29 29
 
30
-	public function describeTo( Description $description ) {
31
-		$description->appendText( 'having root element ' );
32
-		if ( $this->tagMatcher ) {
33
-			$description->appendDescriptionOf( $this->tagMatcher );
30
+	public function describeTo(Description $description) {
31
+		$description->appendText('having root element ');
32
+		if ($this->tagMatcher) {
33
+			$description->appendDescriptionOf($this->tagMatcher);
34 34
 		}
35 35
 	}
36 36
 
@@ -40,25 +40,25 @@  discard block
 block discarded – undo
40 40
 	 *
41 41
 	 * @return bool
42 42
 	 */
43
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
44
-		$DOMNodeList = $item->documentElement->childNodes->item( 0 )->childNodes;
45
-		if ( $DOMNodeList->length > 1 ) {
43
+	protected function matchesSafelyWithDiagnosticDescription($item, Description $mismatchDescription) {
44
+		$DOMNodeList = $item->documentElement->childNodes->item(0)->childNodes;
45
+		if ($DOMNodeList->length > 1) {
46 46
 			// TODO Test this description
47
-			$mismatchDescription->appendText( 'having ' . $DOMNodeList->length . ' root elements ' );
47
+			$mismatchDescription->appendText('having ' . $DOMNodeList->length . ' root elements ');
48 48
 			return false;
49 49
 		}
50 50
 
51
-		$target = $DOMNodeList->item( 0 );
52
-		if ( !$target ) {
51
+		$target = $DOMNodeList->item(0);
52
+		if (!$target) {
53 53
 			// TODO Reproduce?
54
-			$mismatchDescription->appendText( 'having no root elements ' );
54
+			$mismatchDescription->appendText('having no root elements ');
55 55
 			return false;
56 56
 		}
57 57
 
58
-		if ( $this->tagMatcher ) {
59
-			$mismatchDescription->appendText( 'root element ' );
60
-			$this->tagMatcher->describeMismatch( $target, $mismatchDescription );
61
-			return $this->tagMatcher->matches( $target );
58
+		if ($this->tagMatcher) {
59
+			$mismatchDescription->appendText('root element ');
60
+			$this->tagMatcher->describeMismatch($target, $mismatchDescription);
61
+			return $this->tagMatcher->matches($target);
62 62
 		}
63 63
 
64 64
 		return true;
Please login to merge, or discard this patch.
src/DirectChildElementMatcher.php 2 patches
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -8,61 +8,61 @@
 block discarded – undo
8 8
 
9 9
 class DirectChildElementMatcher extends TypeSafeDiagnosingMatcher {
10 10
 
11
-	/**
12
-	 * @var Matcher
13
-	 */
14
-	private $matcher;
15
-
16
-	public static function havingDirectChild( Matcher $elementMatcher = null ) {
17
-		return new static( $elementMatcher );
18
-	}
19
-
20
-	public function __construct( Matcher $matcher = null ) {
21
-		parent::__construct( \DOMNode::class );
22
-		$this->matcher = $matcher;
23
-	}
24
-
25
-	public function describeTo( Description $description ) {
26
-		$description->appendText( 'having direct child ' );
27
-		if ( $this->matcher ) {
28
-			$description->appendDescriptionOf( $this->matcher );
29
-		}
30
-	}
31
-
32
-	/**
33
-	 * @param \DOMDocument|\DOMNode $item
34
-	 * @param Description $mismatchDescription
35
-	 *
36
-	 * @return bool
37
-	 */
38
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
39
-		if ( $item instanceof \DOMDocument ) {
40
-			$item = $item->documentElement->childNodes->item( 0 );
41
-		}
42
-		$directChildren = $item->childNodes;
43
-
44
-		if ( $directChildren->length === 0 ) {
45
-			$mismatchDescription->appendText( 'with no direct children' );
46
-			return false;
47
-		}
48
-
49
-		$childWord = $directChildren->length === 1 ? 'child' : 'children';
50
-
51
-		$mismatchDescription->appendText( "with direct {$childWord} " );
52
-
53
-		if ( !$this->matcher ) {
54
-			return $directChildren->length !== 0;
55
-		}
56
-
57
-		foreach ( $directChildren as $child ) {
58
-			if ( $this->matcher->matches( $child ) ) {
59
-				return true;
60
-			}
61
-		}
62
-
63
-		$this->matcher->describeMismatch( $child, $mismatchDescription );
64
-
65
-		return false;
66
-	}
11
+    /**
12
+     * @var Matcher
13
+     */
14
+    private $matcher;
15
+
16
+    public static function havingDirectChild( Matcher $elementMatcher = null ) {
17
+        return new static( $elementMatcher );
18
+    }
19
+
20
+    public function __construct( Matcher $matcher = null ) {
21
+        parent::__construct( \DOMNode::class );
22
+        $this->matcher = $matcher;
23
+    }
24
+
25
+    public function describeTo( Description $description ) {
26
+        $description->appendText( 'having direct child ' );
27
+        if ( $this->matcher ) {
28
+            $description->appendDescriptionOf( $this->matcher );
29
+        }
30
+    }
31
+
32
+    /**
33
+     * @param \DOMDocument|\DOMNode $item
34
+     * @param Description $mismatchDescription
35
+     *
36
+     * @return bool
37
+     */
38
+    protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
39
+        if ( $item instanceof \DOMDocument ) {
40
+            $item = $item->documentElement->childNodes->item( 0 );
41
+        }
42
+        $directChildren = $item->childNodes;
43
+
44
+        if ( $directChildren->length === 0 ) {
45
+            $mismatchDescription->appendText( 'with no direct children' );
46
+            return false;
47
+        }
48
+
49
+        $childWord = $directChildren->length === 1 ? 'child' : 'children';
50
+
51
+        $mismatchDescription->appendText( "with direct {$childWord} " );
52
+
53
+        if ( !$this->matcher ) {
54
+            return $directChildren->length !== 0;
55
+        }
56
+
57
+        foreach ( $directChildren as $child ) {
58
+            if ( $this->matcher->matches( $child ) ) {
59
+                return true;
60
+            }
61
+        }
62
+
63
+        $this->matcher->describeMismatch( $child, $mismatchDescription );
64
+
65
+        return false;
66
+    }
67 67
 
68 68
 }
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -13,19 +13,19 @@  discard block
 block discarded – undo
13 13
 	 */
14 14
 	private $matcher;
15 15
 
16
-	public static function havingDirectChild( Matcher $elementMatcher = null ) {
17
-		return new static( $elementMatcher );
16
+	public static function havingDirectChild(Matcher $elementMatcher = null) {
17
+		return new static($elementMatcher);
18 18
 	}
19 19
 
20
-	public function __construct( Matcher $matcher = null ) {
21
-		parent::__construct( \DOMNode::class );
20
+	public function __construct(Matcher $matcher = null) {
21
+		parent::__construct(\DOMNode::class);
22 22
 		$this->matcher = $matcher;
23 23
 	}
24 24
 
25
-	public function describeTo( Description $description ) {
26
-		$description->appendText( 'having direct child ' );
27
-		if ( $this->matcher ) {
28
-			$description->appendDescriptionOf( $this->matcher );
25
+	public function describeTo(Description $description) {
26
+		$description->appendText('having direct child ');
27
+		if ($this->matcher) {
28
+			$description->appendDescriptionOf($this->matcher);
29 29
 		}
30 30
 	}
31 31
 
@@ -35,32 +35,32 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @return bool
37 37
 	 */
38
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
39
-		if ( $item instanceof \DOMDocument ) {
40
-			$item = $item->documentElement->childNodes->item( 0 );
38
+	protected function matchesSafelyWithDiagnosticDescription($item, Description $mismatchDescription) {
39
+		if ($item instanceof \DOMDocument) {
40
+			$item = $item->documentElement->childNodes->item(0);
41 41
 		}
42 42
 		$directChildren = $item->childNodes;
43 43
 
44
-		if ( $directChildren->length === 0 ) {
45
-			$mismatchDescription->appendText( 'with no direct children' );
44
+		if ($directChildren->length === 0) {
45
+			$mismatchDescription->appendText('with no direct children');
46 46
 			return false;
47 47
 		}
48 48
 
49 49
 		$childWord = $directChildren->length === 1 ? 'child' : 'children';
50 50
 
51
-		$mismatchDescription->appendText( "with direct {$childWord} " );
51
+		$mismatchDescription->appendText("with direct {$childWord} ");
52 52
 
53
-		if ( !$this->matcher ) {
53
+		if (!$this->matcher) {
54 54
 			return $directChildren->length !== 0;
55 55
 		}
56 56
 
57
-		foreach ( $directChildren as $child ) {
58
-			if ( $this->matcher->matches( $child ) ) {
57
+		foreach ($directChildren as $child) {
58
+			if ($this->matcher->matches($child)) {
59 59
 				return true;
60 60
 			}
61 61
 		}
62 62
 
63
-		$this->matcher->describeMismatch( $child, $mismatchDescription );
63
+		$this->matcher->describeMismatch($child, $mismatchDescription);
64 64
 
65 65
 		return false;
66 66
 	}
Please login to merge, or discard this patch.
src/ChildElementMatcher.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -8,57 +8,57 @@
 block discarded – undo
8 8
 
9 9
 class ChildElementMatcher extends TypeSafeDiagnosingMatcher {
10 10
 
11
-	/**
12
-	 * @var Matcher|null
13
-	 */
14
-	private $matcher;
11
+    /**
12
+     * @var Matcher|null
13
+     */
14
+    private $matcher;
15 15
 
16
-	public static function havingChild( Matcher $elementMatcher = null ) {
17
-		return new static( $elementMatcher );
18
-	}
16
+    public static function havingChild( Matcher $elementMatcher = null ) {
17
+        return new static( $elementMatcher );
18
+    }
19 19
 
20
-	public function __construct( Matcher $matcher = null ) {
21
-		parent::__construct( \DOMNode::class );
22
-		$this->matcher = $matcher;
23
-	}
20
+    public function __construct( Matcher $matcher = null ) {
21
+        parent::__construct( \DOMNode::class );
22
+        $this->matcher = $matcher;
23
+    }
24 24
 
25
-	public function describeTo( Description $description ) {
26
-		$description->appendText( 'having child ' );
27
-		if ( $this->matcher ) {
28
-			$description->appendDescriptionOf( $this->matcher );
29
-		}
30
-	}
25
+    public function describeTo( Description $description ) {
26
+        $description->appendText( 'having child ' );
27
+        if ( $this->matcher ) {
28
+            $description->appendDescriptionOf( $this->matcher );
29
+        }
30
+    }
31 31
 
32
-	/**
33
-	 * @param \DOMDocument|\DOMNode $item
34
-	 * @param Description $mismatchDescription
35
-	 *
36
-	 * @return bool
37
-	 */
38
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
39
-		if ( $item instanceof \DOMDocument ) {
40
-			$directChildren = $item->documentElement->childNodes->item( 0 )->childNodes;
41
-		} else {
42
-			$directChildren = $item->childNodes;
43
-		}
32
+    /**
33
+     * @param \DOMDocument|\DOMNode $item
34
+     * @param Description $mismatchDescription
35
+     *
36
+     * @return bool
37
+     */
38
+    protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
39
+        if ( $item instanceof \DOMDocument ) {
40
+            $directChildren = $item->documentElement->childNodes->item( 0 )->childNodes;
41
+        } else {
42
+            $directChildren = $item->childNodes;
43
+        }
44 44
 
45
-		if ( $directChildren->length === 0 ) {
46
-			$mismatchDescription->appendText( 'having no children' );
47
-			return false;
48
-		}
45
+        if ( $directChildren->length === 0 ) {
46
+            $mismatchDescription->appendText( 'having no children' );
47
+            return false;
48
+        }
49 49
 
50
-		if ( !$this->matcher ) {
51
-			return $directChildren->length > 0;
52
-		}
50
+        if ( !$this->matcher ) {
51
+            return $directChildren->length > 0;
52
+        }
53 53
 
54
-		foreach ( new XmlNodeRecursiveIterator( $directChildren ) as $child ) {
55
-			if ( $this->matcher->matches( $child ) ) {
56
-				return true;
57
-			}
58
-		}
54
+        foreach ( new XmlNodeRecursiveIterator( $directChildren ) as $child ) {
55
+            if ( $this->matcher->matches( $child ) ) {
56
+                return true;
57
+            }
58
+        }
59 59
 
60
-		$mismatchDescription->appendText( 'having no children ' )->appendDescriptionOf( $this->matcher );
61
-		return false;
62
-	}
60
+        $mismatchDescription->appendText( 'having no children ' )->appendDescriptionOf( $this->matcher );
61
+        return false;
62
+    }
63 63
 
64 64
 }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -13,19 +13,19 @@  discard block
 block discarded – undo
13 13
 	 */
14 14
 	private $matcher;
15 15
 
16
-	public static function havingChild( Matcher $elementMatcher = null ) {
17
-		return new static( $elementMatcher );
16
+	public static function havingChild(Matcher $elementMatcher = null) {
17
+		return new static($elementMatcher);
18 18
 	}
19 19
 
20
-	public function __construct( Matcher $matcher = null ) {
21
-		parent::__construct( \DOMNode::class );
20
+	public function __construct(Matcher $matcher = null) {
21
+		parent::__construct(\DOMNode::class);
22 22
 		$this->matcher = $matcher;
23 23
 	}
24 24
 
25
-	public function describeTo( Description $description ) {
26
-		$description->appendText( 'having child ' );
27
-		if ( $this->matcher ) {
28
-			$description->appendDescriptionOf( $this->matcher );
25
+	public function describeTo(Description $description) {
26
+		$description->appendText('having child ');
27
+		if ($this->matcher) {
28
+			$description->appendDescriptionOf($this->matcher);
29 29
 		}
30 30
 	}
31 31
 
@@ -35,29 +35,29 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @return bool
37 37
 	 */
38
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
39
-		if ( $item instanceof \DOMDocument ) {
40
-			$directChildren = $item->documentElement->childNodes->item( 0 )->childNodes;
38
+	protected function matchesSafelyWithDiagnosticDescription($item, Description $mismatchDescription) {
39
+		if ($item instanceof \DOMDocument) {
40
+			$directChildren = $item->documentElement->childNodes->item(0)->childNodes;
41 41
 		} else {
42 42
 			$directChildren = $item->childNodes;
43 43
 		}
44 44
 
45
-		if ( $directChildren->length === 0 ) {
46
-			$mismatchDescription->appendText( 'having no children' );
45
+		if ($directChildren->length === 0) {
46
+			$mismatchDescription->appendText('having no children');
47 47
 			return false;
48 48
 		}
49 49
 
50
-		if ( !$this->matcher ) {
50
+		if (!$this->matcher) {
51 51
 			return $directChildren->length > 0;
52 52
 		}
53 53
 
54
-		foreach ( new XmlNodeRecursiveIterator( $directChildren ) as $child ) {
55
-			if ( $this->matcher->matches( $child ) ) {
54
+		foreach (new XmlNodeRecursiveIterator($directChildren) as $child) {
55
+			if ($this->matcher->matches($child)) {
56 56
 				return true;
57 57
 			}
58 58
 		}
59 59
 
60
-		$mismatchDescription->appendText( 'having no children ' )->appendDescriptionOf( $this->matcher );
60
+		$mismatchDescription->appendText('having no children ')->appendDescriptionOf($this->matcher);
61 61
 		return false;
62 62
 	}
63 63
 
Please login to merge, or discard this patch.
src/TagNameMatcher.php 2 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -8,44 +8,44 @@
 block discarded – undo
8 8
 
9 9
 class TagNameMatcher extends TagMatcher {
10 10
 
11
-	/**
12
-	 * @var Matcher
13
-	 */
14
-	private $tagNameMatcher;
15
-
16
-	/**
17
-	 * @param Matcher|string $tagName
18
-	 *
19
-	 * @return self
20
-	 */
21
-	public static function withTagName( $tagName ) {
22
-		return new static( Util::wrapValueWithIsEqual( $tagName ) );
23
-	}
24
-
25
-	public function __construct( Matcher $tagNameMatcher ) {
26
-		parent::__construct();
27
-		$this->tagNameMatcher = $tagNameMatcher;
28
-	}
29
-
30
-	public function describeTo( Description $description ) {
31
-		$description->appendText( 'with tag name ' )
32
-			->appendDescriptionOf( $this->tagNameMatcher );
33
-	}
34
-
35
-	/**
36
-	 * @param \DOMElement $item
37
-	 * @param Description $mismatchDescription
38
-	 *
39
-	 * @return bool
40
-	 */
41
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
42
-		if ( $this->tagNameMatcher->matches( $item->tagName ) ) {
43
-			return true;
44
-		}
45
-
46
-		$mismatchDescription->appendText( 'tag name ' );
47
-		$this->tagNameMatcher->describeMismatch( $item->tagName, $mismatchDescription );
48
-		return false;
49
-	}
11
+    /**
12
+     * @var Matcher
13
+     */
14
+    private $tagNameMatcher;
15
+
16
+    /**
17
+     * @param Matcher|string $tagName
18
+     *
19
+     * @return self
20
+     */
21
+    public static function withTagName( $tagName ) {
22
+        return new static( Util::wrapValueWithIsEqual( $tagName ) );
23
+    }
24
+
25
+    public function __construct( Matcher $tagNameMatcher ) {
26
+        parent::__construct();
27
+        $this->tagNameMatcher = $tagNameMatcher;
28
+    }
29
+
30
+    public function describeTo( Description $description ) {
31
+        $description->appendText( 'with tag name ' )
32
+            ->appendDescriptionOf( $this->tagNameMatcher );
33
+    }
34
+
35
+    /**
36
+     * @param \DOMElement $item
37
+     * @param Description $mismatchDescription
38
+     *
39
+     * @return bool
40
+     */
41
+    protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
42
+        if ( $this->tagNameMatcher->matches( $item->tagName ) ) {
43
+            return true;
44
+        }
45
+
46
+        $mismatchDescription->appendText( 'tag name ' );
47
+        $this->tagNameMatcher->describeMismatch( $item->tagName, $mismatchDescription );
48
+        return false;
49
+    }
50 50
 
51 51
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,18 +18,18 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return self
20 20
 	 */
21
-	public static function withTagName( $tagName ) {
22
-		return new static( Util::wrapValueWithIsEqual( $tagName ) );
21
+	public static function withTagName($tagName) {
22
+		return new static(Util::wrapValueWithIsEqual($tagName));
23 23
 	}
24 24
 
25
-	public function __construct( Matcher $tagNameMatcher ) {
25
+	public function __construct(Matcher $tagNameMatcher) {
26 26
 		parent::__construct();
27 27
 		$this->tagNameMatcher = $tagNameMatcher;
28 28
 	}
29 29
 
30
-	public function describeTo( Description $description ) {
31
-		$description->appendText( 'with tag name ' )
32
-			->appendDescriptionOf( $this->tagNameMatcher );
30
+	public function describeTo(Description $description) {
31
+		$description->appendText('with tag name ')
32
+			->appendDescriptionOf($this->tagNameMatcher);
33 33
 	}
34 34
 
35 35
 	/**
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
 	 *
39 39
 	 * @return bool
40 40
 	 */
41
-	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
42
-		if ( $this->tagNameMatcher->matches( $item->tagName ) ) {
41
+	protected function matchesSafelyWithDiagnosticDescription($item, Description $mismatchDescription) {
42
+		if ($this->tagNameMatcher->matches($item->tagName)) {
43 43
 			return true;
44 44
 		}
45 45
 
46
-		$mismatchDescription->appendText( 'tag name ' );
47
-		$this->tagNameMatcher->describeMismatch( $item->tagName, $mismatchDescription );
46
+		$mismatchDescription->appendText('tag name ');
47
+		$this->tagNameMatcher->describeMismatch($item->tagName, $mismatchDescription);
48 48
 		return false;
49 49
 	}
50 50
 
Please login to merge, or discard this patch.