aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-07-01 16:00:02 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-07-01 16:00:02 +0200
commit044d48e4e0faa2bc9416c6ce08c8e43a5b03f11d (patch)
tree72e35c6049d283400adf284fffb3c4e3432305e5
parent1b25c70c7a9dd801f217a2feb658c791af58034e (diff)
downloadUstring-044d48e4e0faa2bc9416c6ce08c8e43a5b03f11d.zip
Ustring-044d48e4e0faa2bc9416c6ce08c8e43a5b03f11d.tar.gz
Ustring-044d48e4e0faa2bc9416c6ce08c8e43a5b03f11d.tar.bz2
The safePattern() method is now static.
-rw-r--r--String.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/String.php b/String.php
index aeab8c5..ad4f4b7 100644
--- a/String.php
+++ b/String.php
@@ -258,7 +258,7 @@ class String implements \ArrayAccess, \Countable, \IteratorAggregate {
* @param string $pattern Pattern.
* @return string
*/
- public function safePattern ( $pattern ) {
+ public static function safePattern ( $pattern ) {
$delimiter = mb_substr($pattern, 0, 1);
$options = mb_substr(
@@ -288,7 +288,7 @@ class String implements \ArrayAccess, \Countable, \IteratorAggregate {
public function match ( $pattern, &$matches = null, $flags = 0,
$offset = 0, $global = false ) {
- $pattern = $this->safePattern($pattern);
+ $pattern = static::safePattern($pattern);
if(true === $global)
$flags = PREG_PATTERN_ORDER;
@@ -320,7 +320,7 @@ class String implements \ArrayAccess, \Countable, \IteratorAggregate {
*/
public function replace ( $pattern, $replacement, $limit = -1 ) {
- $pattern = $this->safePattern($pattern);
+ $pattern = static::safePattern($pattern);
if(false === is_callable($replacement))
$this->_string = preg_replace(
@@ -354,7 +354,7 @@ class String implements \ArrayAccess, \Countable, \IteratorAggregate {
public function split ( $pattern, $limit = -1, $flags = 0 ) {
return preg_split(
- $this->safePattern($pattern),
+ static::safePattern($pattern),
$this->_string,
$limit,
$flags