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

StringContainsIgnoringWhiteSpace::relationship()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace WMDE\HamcrestHtml;
4
5
use Hamcrest\Text\SubstringMatcher;
6
7
class StringContainsIgnoringWhiteSpace extends SubstringMatcher {
8
9
	/**
10
	 * Matches if value is a string that contains $substring consider all whitespace as single space
11
	 *
12
	 * @param string $substring
13
	 *
14
	 * @return self
15
	 */
16 9
	public static function containsStringIgnoringWhiteSpace( $substring ) {
17 9
		return new self( $substring );
18
	}
19
20
	/**
21
	 * @param string $item
22
	 *
23
	 * @return bool
24
	 */
25 10
	protected function evalSubstringOf( $item ) {
26 10
		return strpos( $this->stripSpace( $item ), $this->stripSpace( $this->_substring ) ) !== false;
27
	}
28
29 1
	protected function relationship() {
30 1
		return 'containing ignoring whitespace';
31
	}
32
33
	/**
34
	 * @param string $string
35
	 *
36
	 * @return string
37
	 */
38 10
	private function stripSpace( $string ) {
39 10
		return trim( preg_replace( '/\s+/', ' ', $string ) );
40
	}
41
42
}
43