@@ -5,48 +5,48 @@ |
||
5 | 5 | |
6 | 6 | class StringContainsIgnoringWhiteSpace extends SubstringMatcher |
7 | 7 | { |
8 | - public function __construct($substring) |
|
9 | - { |
|
10 | - parent::__construct($this->_stripSpace($substring)); |
|
11 | - } |
|
8 | + public function __construct($substring) |
|
9 | + { |
|
10 | + parent::__construct($this->_stripSpace($substring)); |
|
11 | + } |
|
12 | 12 | |
13 | - /** |
|
14 | - * Matches if value is a string that contains $substring consider all whitespace as single space |
|
15 | - */ |
|
16 | - public static function containsStringIgnoringWhiteSpace($substring) |
|
17 | - { |
|
18 | - return new self($substring); |
|
19 | - } |
|
13 | + /** |
|
14 | + * Matches if value is a string that contains $substring consider all whitespace as single space |
|
15 | + */ |
|
16 | + public static function containsStringIgnoringWhiteSpace($substring) |
|
17 | + { |
|
18 | + return new self($substring); |
|
19 | + } |
|
20 | 20 | |
21 | - /** |
|
22 | - * @param \DOMElement $item |
|
23 | - * |
|
24 | - * @return bool |
|
25 | - */ |
|
26 | - protected function evalSubstringOf($item) |
|
27 | - { |
|
28 | - return (false !== strpos($this->_stripSpace((string) $item), $this->_substring)); |
|
29 | - } |
|
21 | + /** |
|
22 | + * @param \DOMElement $item |
|
23 | + * |
|
24 | + * @return bool |
|
25 | + */ |
|
26 | + protected function evalSubstringOf($item) |
|
27 | + { |
|
28 | + return (false !== strpos($this->_stripSpace((string) $item), $this->_substring)); |
|
29 | + } |
|
30 | 30 | |
31 | - protected function relationship() |
|
32 | - { |
|
33 | - return 'containing'; |
|
34 | - } |
|
31 | + protected function relationship() |
|
32 | + { |
|
33 | + return 'containing'; |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * Copied from IsEqualIgnoringWhiteSpace |
|
38 | - * |
|
39 | - * @param $string |
|
40 | - * |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - private function _stripSpace($string) |
|
44 | - { |
|
45 | - $parts = preg_split("/[\r\n\t ]+/", $string); |
|
46 | - foreach ($parts as $i => $part) { |
|
47 | - $parts[$i] = trim($part, " \r\n\t"); |
|
48 | - } |
|
36 | + /** |
|
37 | + * Copied from IsEqualIgnoringWhiteSpace |
|
38 | + * |
|
39 | + * @param $string |
|
40 | + * |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + private function _stripSpace($string) |
|
44 | + { |
|
45 | + $parts = preg_split("/[\r\n\t ]+/", $string); |
|
46 | + foreach ($parts as $i => $part) { |
|
47 | + $parts[$i] = trim($part, " \r\n\t"); |
|
48 | + } |
|
49 | 49 | |
50 | - return trim(implode(' ', $parts), " \r\n\t"); |
|
51 | - } |
|
50 | + return trim(implode(' ', $parts), " \r\n\t"); |
|
51 | + } |
|
52 | 52 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | protected function evalSubstringOf($item) |
27 | 27 | { |
28 | - return (false !== strpos($this->_stripSpace((string) $item), $this->_substring)); |
|
28 | + return (false !== strpos($this->_stripSpace((string)$item), $this->_substring)); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | protected function relationship() |