PHP Class JonathanTorres\Construct\Helpers\Str

Afficher le fichier Open project: jonathantorres/construct Class Usage Examples

Protected Properties

Свойство Type Description
$regEx string Must be: vendor/package

Méthodes publiques

Méthode Description
contains ( string $name, string $needle ) : boolean Check if the entered project name contains a given string.
createNamespace ( string $namespace, boolean $usesProjectName = false, boolean $useDoubleSlashes = false ) : string Construct a correct project namespace name.
isValid ( string $name ) : boolean Check if the entered project name is valid.
isWindows ( string $os = PHP_OS ) : boolean Check if the operating system is windowsish.
phpVersionIsValid ( string $version ) : boolean Validate php version string
split ( string $string ) : array Split project name in a pretty array.
toCamelCase ( string $string, boolean $capitalizeFirstCharacter = false ) : string Convert string to camel case.
toLower ( string $string ) : string Convert string to lower case.
toQuotedKeywords ( string $keywords ) : string Convert keywords to quoted keywords.
toStudly ( string $string ) : string Convert string to studly case.

Method Details

contains() public méthode

Check if the entered project name contains a given string.
public contains ( string $name, string $needle ) : boolean
$name string
$needle string
Résultat boolean

createNamespace() public méthode

Construct a correct project namespace name.
public createNamespace ( string $namespace, boolean $usesProjectName = false, boolean $useDoubleSlashes = false ) : string
$namespace string The entered namespace.
$usesProjectName boolean Whether or not it's using the project name.
$useDoubleSlashes boolean Whether or not use double slashes \\.
Résultat string

isValid() public méthode

Check if the entered project name is valid.
public isValid ( string $name ) : boolean
$name string
Résultat boolean

isWindows() public méthode

Check if the operating system is windowsish.
public isWindows ( string $os = PHP_OS ) : boolean
$os string
Résultat boolean

phpVersionIsValid() public méthode

Validate php version string
public phpVersionIsValid ( string $version ) : boolean
$version string
Résultat boolean

split() public méthode

Split project name in a pretty array.
public split ( string $string ) : array
$string string
Résultat array

toCamelCase() public méthode

Convert string to camel case.
public toCamelCase ( string $string, boolean $capitalizeFirstCharacter = false ) : string
$string string
$capitalizeFirstCharacter boolean
Résultat string

toLower() public méthode

Convert string to lower case.
public toLower ( string $string ) : string
$string string
Résultat string

toQuotedKeywords() public méthode

Ex: "test,php,vagrant,provision" -> '"test","php","vagrant","provision"'
public toQuotedKeywords ( string $keywords ) : string
$keywords string
Résultat string

toStudly() public méthode

Convert string to studly case.
public toStudly ( string $string ) : string
$string string
Résultat string

Property Details

$regEx protected_oe property

Must be: vendor/package
protected string $regEx
Résultat string