PHP Class IdiormString, idiorm

Author: Jeff Roberson ([email protected])
Author: Simon Holywell ([email protected])
Show file Open project: j4mie/idiorm Class Usage Examples

Protected Properties

Property Type Description
$replace
$search
$subject

Public Methods

Method Description
__construct ( string $subject ) Set the base string object
replace_outside_quotes ( string $search, string $replace ) : string Replace all occurrences of the search string with the replacement string where they appear outside quotes
str_replace_outside_quotes ( string $search, string $replace, string $subject ) : string Shortcut method: Replace all occurrences of the search string with the replacement string where they appear outside quotes.
value ( string $subject ) : self Get an easy to use instance of the class

Protected Methods

Method Description
_str_replace_outside_quotes ( ) : string Validate an input string and perform a replace on all ocurrences of $this->search with $this->replace
_str_replace_outside_quotes_cb ( array $matches ) : string Process each matching chunk from preg_replace_callback replacing each occurrence of $this->search with $this->replace

Method Details

__construct() public method

Set the base string object
public __construct ( string $subject )
$subject string

_str_replace_outside_quotes() protected method

Validate an input string and perform a replace on all ocurrences of $this->search with $this->replace
Author: Jeff Roberson ([email protected])
protected _str_replace_outside_quotes ( ) : string
return string

_str_replace_outside_quotes_cb() protected method

Process each matching chunk from preg_replace_callback replacing each occurrence of $this->search with $this->replace
Author: Jeff Roberson ([email protected])
protected _str_replace_outside_quotes_cb ( array $matches ) : string
$matches array
return string

replace_outside_quotes() public method

Replace all occurrences of the search string with the replacement string where they appear outside quotes
public replace_outside_quotes ( string $search, string $replace ) : string
$search string
$replace string
return string

str_replace_outside_quotes() public static method

Shortcut method: Replace all occurrences of the search string with the replacement string where they appear outside quotes.
public static str_replace_outside_quotes ( string $search, string $replace, string $subject ) : string
$search string
$replace string
$subject string
return string

value() public static method

Get an easy to use instance of the class
public static value ( string $subject ) : self
$subject string
return self

Property Details

$replace protected property

protected $replace

$subject protected property

protected $subject