Skip to content

Commit f9d4e0b

Browse files
committed
Merge pull request #13 from 4d47/master
Add limit method visibility
2 parents eb88200 + 6f2a9f3 commit f9d4e0b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/VerbalExpressions/PHPVerbalExpressions/VerbalExpressions.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function endOfLine($enable = true)
9090
*/
9191
public function then($value)
9292
{
93-
return $this->add("(".$this->sanitize($value).")");
93+
return $this->add("(?:".self::sanitize($value).")");
9494
}
9595

9696
/**
@@ -114,7 +114,7 @@ public function find($value)
114114
*/
115115
public function maybe($value)
116116
{
117-
return $this->add("(".$this->sanitize($value).")?");
117+
return $this->add("(?:".self::sanitize($value).")?");
118118
}
119119

120120
/**
@@ -127,7 +127,7 @@ public function maybe($value)
127127
*/
128128
public function anything()
129129
{
130-
return $this->add("(.*)");
130+
return $this->add("(?:.*)");
131131
}
132132

133133
/**
@@ -141,7 +141,7 @@ public function anything()
141141
*/
142142
public function anythingBut($value)
143143
{
144-
return $this->add("([^". $this->sanitize($value) ."]*)");
144+
return $this->add("(?:[^". self::sanitize($value) ."]*)");
145145
}
146146

147147
/**
@@ -154,7 +154,7 @@ public function anythingBut($value)
154154
*/
155155
public function something()
156156
{
157-
return $this->add("(.+)");
157+
return $this->add("(?:.+)");
158158
}
159159

160160
/**
@@ -168,7 +168,7 @@ public function something()
168168
*/
169169
public function somethingBut($value)
170170
{
171-
return $this->add("([^". $this->sanitize($value) ."]+)");
171+
return $this->add("(?:[^". self::sanitize($value) ."]+)");
172172
}
173173

174174
/**
@@ -203,7 +203,7 @@ public function replace($source, $value)
203203
*/
204204
public function lineBreak()
205205
{
206-
return $this->add("(\\n|(\\r\\n))");
206+
return $this->add("(?:\\n|(\\r\\n))");
207207
}
208208

209209
/**
@@ -295,7 +295,7 @@ public function range()
295295
$arg_list = func_get_args();
296296

297297
for ($i = 0; $i < $arg_num;) {
298-
$value .= $this->sanitize($arg_list[$i++]) . "-" . $this->sanitize($arg_list[$i++]);
298+
$value .= self::sanitize($arg_list[$i++]) . "-" . self::sanitize($arg_list[$i++]);
299299
}
300300

301301
$value .= "]";
@@ -390,7 +390,7 @@ public function searchOneLine($enable = true)
390390
*/
391391
public function multiple($value)
392392
{
393-
$value = $this->sanitize($value);
393+
$value = self::sanitize($value);
394394

395395
switch (substr($value, -1)) {
396396
case '+':
@@ -417,14 +417,14 @@ public function multiple($value)
417417
public function _or($value)
418418
{
419419
if (strpos($this->prefixes,"(")===false) {
420-
$this->prefixes .= "(";
420+
$this->prefixes .= "(?:";
421421
}
422422

423423
if (strpos($this->suffixes, ")")===false) {
424424
$this->suffixes .= ")";
425425
}
426426

427-
$this->add(")|(");
427+
$this->add(")|(?:");
428428

429429
if ($value) {
430430
$this->add($value);
@@ -514,7 +514,7 @@ public function clean($options = array())
514514
* @param integer $max
515515
* @return VerbalExpressions
516516
*/
517-
function limit($min, $max = 0) {
517+
public function limit($min, $max = 0) {
518518
if($max == 0)
519519
$value = "{".$min."}";
520520

0 commit comments

Comments
 (0)