PHP Class JonathanTorres\Construct\Helpers\Str

Datei anzeigen Open project: jonathantorres/construct Class Usage Examples

Protected Properties

Property Type Description
$regEx string Must be: vendor/package

Public Methods

Method 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 method

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

createNamespace() public method

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 \\.
return string

isValid() public method

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

isWindows() public method

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

phpVersionIsValid() public method

Validate php version string
public phpVersionIsValid ( string $version ) : boolean
$version string
return boolean

split() public method

Split project name in a pretty array.
public split ( string $string ) : array
$string string
return array

toCamelCase() public method

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

toLower() public method

Convert string to lower case.
public toLower ( string $string ) : string
$string string
return string

toQuotedKeywords() public method

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

toStudly() public method

Convert string to studly case.
public toStudly ( string $string ) : string
$string string
return string

Property Details

$regEx protected_oe property

Must be: vendor/package
protected string $regEx
return string