@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | private function initStartsWith($startsWith) { |
64 | 64 | $startsWith = rtrim($startsWith, '*'); |
65 | 65 | $startsWithFunc = $this->helpers['startsWith']; |
66 | - $this->func = function ($string) use ($startsWith, $startsWithFunc) { |
|
66 | + $this->func = function($string) use ($startsWith, $startsWithFunc) { |
|
67 | 67 | return $startsWithFunc($string, $startsWith); |
68 | 68 | }; |
69 | 69 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | private function initEndsWith($endsWith) { |
76 | 76 | $endsWith = ltrim($endsWith, '*'); |
77 | 77 | $endsWithFunc = $this->helpers['endsWith']; |
78 | - $this->func = function ($string) use ($endsWith, $endsWithFunc) { |
|
78 | + $this->func = function($string) use ($endsWith, $endsWithFunc) { |
|
79 | 79 | return $endsWithFunc($string, $endsWith); |
80 | 80 | }; |
81 | 81 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | list($startsWith, $endsWith) = explode('*', $pattern); |
89 | 89 | $startsWithFunc = $this->helpers['startsWith']; |
90 | 90 | $endsWithFunc = $this->helpers['endsWith']; |
91 | - $this->func = function ($string) use ($startsWith, $startsWithFunc, $endsWith, $endsWithFunc) { |
|
91 | + $this->func = function($string) use ($startsWith, $startsWithFunc, $endsWith, $endsWithFunc) { |
|
92 | 92 | $stringLength = strlen($string); |
93 | 93 | $bothLength = strlen($startsWith) + strlen($endsWith); |
94 | 94 | if ($bothLength > $stringLength) { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | } |
118 | 118 | $pattern = join('', $parts); |
119 | - $this->func = function ($string) use ($pattern) { |
|
119 | + $this->func = function($string) use ($pattern) { |
|
120 | 120 | return !!preg_match("/^{$pattern}$/", $string); |
121 | 121 | }; |
122 | 122 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @param string $needle |
131 | 131 | * @return bool |
132 | 132 | */ |
133 | - $this->helpers['startsWith'] = function ($haystack, $needle) { |
|
133 | + $this->helpers['startsWith'] = function($haystack, $needle) { |
|
134 | 134 | $needleLen = strlen($needle); |
135 | 135 | return substr($haystack, 0, $needleLen) == $needle; |
136 | 136 | }; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @param string $needle |
141 | 141 | * @return bool |
142 | 142 | */ |
143 | - $this->helpers['endsWith'] = function ($haystack, $needle) { |
|
143 | + $this->helpers['endsWith'] = function($haystack, $needle) { |
|
144 | 144 | $haystackLen = strlen($haystack); |
145 | 145 | $needleLen = strlen($needle); |
146 | 146 | return substr($haystack, $haystackLen - $needleLen, $needleLen) == $needle; |