@@ -6,36 +6,36 @@ |
||
| 6 | 6 | |
| 7 | 7 | class StringContainsIgnoringWhiteSpace extends SubstringMatcher |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Matches if value is a string that contains $substring consider all whitespace as single space |
|
| 11 | - */ |
|
| 12 | - public static function containsStringIgnoringWhiteSpace($substring) |
|
| 13 | - { |
|
| 14 | - return new self($substring); |
|
| 15 | - } |
|
| 9 | + /** |
|
| 10 | + * Matches if value is a string that contains $substring consider all whitespace as single space |
|
| 11 | + */ |
|
| 12 | + public static function containsStringIgnoringWhiteSpace($substring) |
|
| 13 | + { |
|
| 14 | + return new self($substring); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * @param \DOMElement $item |
|
| 19 | - * |
|
| 20 | - * @return bool |
|
| 21 | - */ |
|
| 22 | - protected function evalSubstringOf($item) |
|
| 23 | - { |
|
| 24 | - return (false !== strpos($this->stripSpace((string) $item), $this->stripSpace($this->_substring))); |
|
| 25 | - } |
|
| 17 | + /** |
|
| 18 | + * @param \DOMElement $item |
|
| 19 | + * |
|
| 20 | + * @return bool |
|
| 21 | + */ |
|
| 22 | + protected function evalSubstringOf($item) |
|
| 23 | + { |
|
| 24 | + return (false !== strpos($this->stripSpace((string) $item), $this->stripSpace($this->_substring))); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - protected function relationship() |
|
| 28 | - { |
|
| 29 | - return 'containing ignoring whitespace'; |
|
| 30 | - } |
|
| 27 | + protected function relationship() |
|
| 28 | + { |
|
| 29 | + return 'containing ignoring whitespace'; |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @param $string |
|
| 34 | - * |
|
| 35 | - * @return string |
|
| 36 | - */ |
|
| 37 | - private function stripSpace( $string) |
|
| 38 | - { |
|
| 39 | - return trim(preg_replace( "/[\r\n\t ]+/", ' ', $string)); |
|
| 40 | - } |
|
| 32 | + /** |
|
| 33 | + * @param $string |
|
| 34 | + * |
|
| 35 | + * @return string |
|
| 36 | + */ |
|
| 37 | + private function stripSpace( $string) |
|
| 38 | + { |
|
| 39 | + return trim(preg_replace( "/[\r\n\t ]+/", ' ', $string)); |
|
| 40 | + } |
|
| 41 | 41 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | protected function evalSubstringOf($item) |
| 23 | 23 | { |
| 24 | - return (false !== strpos($this->stripSpace((string) $item), $this->stripSpace($this->_substring))); |
|
| 24 | + return (false !== strpos($this->stripSpace((string)$item), $this->stripSpace($this->_substring))); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | protected function relationship() |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @return string |
| 36 | 36 | */ |
| 37 | - private function stripSpace( $string) |
|
| 37 | + private function stripSpace($string) |
|
| 38 | 38 | { |
| 39 | - return trim(preg_replace( "/[\r\n\t ]+/", ' ', $string)); |
|
| 39 | + return trim(preg_replace("/[\r\n\t ]+/", ' ', $string)); |
|
| 40 | 40 | } |
| 41 | 41 | } |