Skip to content

Commit efb421e

Browse files
committed
stripping superfluous whitespace
1 parent e8b5041 commit efb421e

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

VerbalExpressions.php

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class VerEx {
5555
* @param string $value the to be added
5656
* @return string escaped value
5757
*/
58-
public function sanitize($value)
58+
public function sanitize($value)
5959
{
6060
if(!$value) {
6161
return $value;
@@ -66,13 +66,13 @@ public function sanitize($value)
6666
/**
6767
* Add
6868
*
69-
* Add stuff to the expression
69+
* Add stuff to the expression
7070
*
7171
* @access public
7272
* @param string $value the stuff to be added
7373
* @return VerEx
7474
*/
75-
public function add($value)
75+
public function add($value)
7676
{
7777
$this->source .= $value;
7878
return $this;
@@ -102,7 +102,7 @@ public function startOfLine($enable = true)
102102
* @param boolean $enable Enables or disables the line ending. Default value: true
103103
* @return VerEx
104104
*/
105-
public function endOfLine($enable = true)
105+
public function endOfLine($enable = true)
106106
{
107107
$this->suffixes = $enable ? "$" : "";
108108
return $this;
@@ -117,7 +117,7 @@ public function endOfLine($enable = true)
117117
* @param string $value The string to be looked for
118118
* @return VerEx
119119
*/
120-
public function then($value)
120+
public function then($value)
121121
{
122122
$this->add("(".$this->sanitize($value).")");
123123
return $this;
@@ -127,7 +127,7 @@ public function then($value)
127127
* alias for then()
128128
* @param string $value The string to be looked for
129129
*/
130-
public function find($value)
130+
public function find($value)
131131
{
132132
return $this->then($value);
133133
}
@@ -141,7 +141,7 @@ public function find($value)
141141
* @param string $value The string to be looked for
142142
* @return VerEx
143143
*/
144-
public function maybe($value)
144+
public function maybe($value)
145145
{
146146
$this->add("(".$this->sanitize($value).")?");
147147
return $this;
@@ -153,9 +153,9 @@ public function maybe($value)
153153
* Accept any string
154154
*
155155
* @access public
156-
* @return VerEx
156+
* @return VerEx
157157
*/
158-
public function anything()
158+
public function anything()
159159
{
160160
$this->add("(.*)");
161161
return $this;
@@ -170,7 +170,7 @@ public function anything()
170170
* @param string $value The unaccepted chars
171171
* @return VerEx
172172
*/
173-
public function anythingBut($value)
173+
public function anythingBut($value)
174174
{
175175
$this->add("([^". $this->sanitize($value) ."]*)");
176176
return $this;
@@ -179,12 +179,12 @@ public function anythingBut($value)
179179
/**
180180
* Something
181181
*
182-
* Accept any non-empty string
182+
* Accept any non-empty string
183183
*
184184
* @access public
185185
* @return VerEx
186186
*/
187-
public function something()
187+
public function something()
188188
{
189189
$this->add("(.+)");
190190
return $this;
@@ -199,7 +199,7 @@ public function something()
199199
* @param string $value The unaccepted chars
200200
* @return VerEx
201201
*/
202-
public function somethingBut($value)
202+
public function somethingBut($value)
203203
{
204204
$this->add("([^". $this->sanitize($value) ."]+)");
205205
return $this;
@@ -215,13 +215,13 @@ public function somethingBut($value)
215215
* @param string $value the replacement
216216
* @return VerEx
217217
*/
218-
public function replace($source, $value)
218+
public function replace($source, $value)
219219
{
220220
// php doesn't have g modifier so we remove it if it's there and we remove limit param
221221
if (strpos($this->modifiers, 'g') !== false) {
222222
$this->modifiers = str_replace('g', '', $this->modifiers);
223223
return preg_replace($this->getRegex(), $value, $source);
224-
}
224+
}
225225

226226
return preg_replace($this->getRegex(), $value, $source, $this->replaceLimit);
227227
}
@@ -234,7 +234,7 @@ public function replace($source, $value)
234234
* @access public
235235
* @return VerEx
236236
*/
237-
public function lineBreak()
237+
public function lineBreak()
238238
{
239239
$this->add("(\\n|(\\r\\n))");
240240
return $this;
@@ -248,7 +248,7 @@ public function lineBreak()
248248
* @access public
249249
* return object
250250
*/
251-
public function br()
251+
public function br()
252252
{
253253
return $this->lineBreak();
254254
}
@@ -261,7 +261,7 @@ public function br()
261261
* @access public
262262
* @return VerEx
263263
*/
264-
public function tab()
264+
public function tab()
265265
{
266266
$this->add("\\t");
267267
return $this;
@@ -275,7 +275,7 @@ public function tab()
275275
* @access public
276276
* @return VerEx
277277
*/
278-
public function word()
278+
public function word()
279279
{
280280
$this->add("\\w+");
281281
return $this;
@@ -290,7 +290,7 @@ public function word()
290290
* @param string $value The chars looked for
291291
* @return VerEx
292292
*/
293-
public function anyOf($value)
293+
public function anyOf($value)
294294
{
295295
$this->add("[". $value ."]");
296296
return $this;
@@ -305,7 +305,7 @@ public function anyOf($value)
305305
* @param string $value The chars looked for
306306
* @return VerEx
307307
*/
308-
public function any($value)
308+
public function any($value)
309309
{
310310
return $this->anyOf($value);
311311
}
@@ -318,7 +318,7 @@ public function any($value)
318318
* @access public
319319
* @return VerEx
320320
*/
321-
public function range()
321+
public function range()
322322
{
323323

324324
$arg_num = func_num_args();
@@ -346,7 +346,7 @@ public function range()
346346
* Add a modifier
347347
*
348348
* Adds a modifier
349-
*
349+
*
350350
* @access public
351351
* @param str $modifier
352352
* @return VerEx
@@ -406,7 +406,7 @@ public function withAnyCase($enable = true)
406406
* @param boolean $enable Enables or disables g modifier. Default true
407407
* @return VerEx
408408
*/
409-
public function stopAtFirst($enable = true)
409+
public function stopAtFirst($enable = true)
410410
{
411411
if($enable) {
412412
$this->addModifier('g');
@@ -427,7 +427,7 @@ public function stopAtFirst($enable = true)
427427
* @param boolean $enable Enables or disables m modifier. Default true
428428
* @return VerEx
429429
*/
430-
public function searchOneLine($enable = true)
430+
public function searchOneLine($enable = true)
431431
{
432432
if($enable===true) {
433433
$this->addModifier('m');
@@ -448,7 +448,7 @@ public function searchOneLine($enable = true)
448448
* @param string $value Your expresion
449449
* @return VerEx
450450
*/
451-
public function multiple($value)
451+
public function multiple($value)
452452
{
453453
$value = $this->sanitize($value);
454454

@@ -457,7 +457,7 @@ public function multiple($value)
457457
case '+':
458458
case '*':
459459
break;
460-
460+
461461
default:
462462
$value += '+';
463463
break;
@@ -504,7 +504,7 @@ public function _or($value)
504504
* @access public
505505
* @return string
506506
*/
507-
public function __toString()
507+
public function __toString()
508508
{
509509
return $this->getRegex();
510510
}
@@ -517,7 +517,7 @@ public function __toString()
517517
* @access public
518518
* @return string The final regex
519519
*/
520-
public function getRegex()
520+
public function getRegex()
521521
{
522522
return "/".$this->prefixes.$this->source.$this->suffixes."/".$this->modifiers;
523523
}
@@ -545,14 +545,14 @@ public function test($value)
545545

546546
/**
547547
* Clean
548-
*
548+
*
549549
* deletes the current regex for a fresh start
550550
*
551551
* @access public
552552
* @param array $options
553553
* @return VerEx
554554
*/
555-
public function clean($options = array())
555+
public function clean($options = array())
556556
{
557557
$options = array_merge(array("prefixes"=> "", "source"=>"", "suffixes"=>"", "modifiers"=>"gm","replaceLimit"=>"1"), $options);
558558
$this->prefixes = $options['prefixes'];

0 commit comments

Comments
 (0)