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.
Completed
Pull Request — master (#2)
by Bekh-Ivanov
05:11 queued 02:31
created

StringContainsIgnoringWhiteSpace::stripSpace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
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
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
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 9
	public static function containsStringIgnoringWhiteSpace($substring)
13
	{
14 9
		return new self($substring);
15
	}
16
17
	/**
18
	 * @param string $item
19
	 *
20
	 * @return bool
21
	 */
22 10
	protected function evalSubstringOf($item)
23
	{
24 10
		return (false !== strpos($this->stripSpace((string) $item), $this->stripSpace($this->_substring)));
25
	}
26
27 1
	protected function relationship()
28
	{
29 1
		return 'containing ignoring whitespace';
30
	}
31
32
	/**
33
	 * @param $string
34
	 *
35
	 * @return string
36
	 */
37 10
	private function stripSpace( $string)
38
	{
39 10
		return trim(preg_replace( "/[\r\n\t ]+/", ' ', $string));
40
	}
41
}
42