PHP Class Yosymfony\Spress\Core\Support\StringWrapper

Based on https://github.com/laravel/framework/blob/5.0/src/Illuminate/Support/Arr.php and https://github.com/danielstjules/Stringy/blob/master/src/Stringy.php
Author: Victor Puertas ([email protected])
Afficher le fichier Open project: spress/spress Class Usage Examples

Protected Properties

Свойство Type Description
$chars
$str

Méthodes publiques

Méthode Description
__construct ( string $str = '' ) Constructor.
__toString ( ) : string Returns the string wrapped.
deletePrefix ( string $prefix ) : string Deletes a prefix of the string.
deleteSufix ( string $sufix ) : string Deletes a sufix of the string.
endWith ( string $value ) : boolean Determine if a the string ends with a given substring.
getFirstEndMatch ( array $strings ) : string Gets the first element of the argument matching with the ends of the string.
lower ( ) : string Convert the given string to lower-case.
setString ( string $str ) : Yosymfony\Spress\Core\Support Sets the string.
slug ( string $separator = '-' ) : string Generate a URL friendly "slug".
startWith ( string $value ) : boolean Determine if a the string starts with a given substring.
toAscii ( boolean $removeUnsupported = true ) : string Transliterate a UTF-8 value to ASCII.
upper ( ) : string Convert the given string to upper-case.

Méthodes protégées

Méthode Description
getChars ( ) : array Gets the conversion table.

Method Details

__construct() public méthode

Constructor.
public __construct ( string $str = '' )
$str string The string

__toString() public méthode

Returns the string wrapped.
public __toString ( ) : string
Résultat string The current value of the wrapper

deletePrefix() public méthode

Deletes a prefix of the string.
public deletePrefix ( string $prefix ) : string
$prefix string The prefix
Résultat string The string without prefix

deleteSufix() public méthode

Deletes a sufix of the string.
public deleteSufix ( string $sufix ) : string
$sufix string The sufix
Résultat string The string without sufix

endWith() public méthode

Determine if a the string ends with a given substring.
public endWith ( string $value ) : boolean
$value string
Résultat boolean

getChars() protected méthode

Gets the conversion table.
protected getChars ( ) : array
Résultat array

getFirstEndMatch() public méthode

Gets the first element of the argument matching with the ends of the string.
public getFirstEndMatch ( array $strings ) : string
$strings array List of strings
Résultat string The first element or empty string if no matching found

lower() public méthode

Convert the given string to lower-case.
public lower ( ) : string
Résultat string

setString() public méthode

Sets the string.
public setString ( string $str ) : Yosymfony\Spress\Core\Support
$str string The string
Résultat Yosymfony\Spress\Core\Support This instance

slug() public méthode

Generate a URL friendly "slug".
public slug ( string $separator = '-' ) : string
$separator string
Résultat string

startWith() public méthode

Determine if a the string starts with a given substring.
public startWith ( string $value ) : boolean
$value string
Résultat boolean

toAscii() public méthode

Transliterate a UTF-8 value to ASCII.
public toAscii ( boolean $removeUnsupported = true ) : string
$removeUnsupported boolean Whether or not to remove the unsupported characters
Résultat string

upper() public méthode

Convert the given string to upper-case.
public upper ( ) : string
Résultat string

Property Details

$chars protected_oe property

protected $chars

$str protected_oe property

protected $str