class Utils (View source)

Methods

static string
getPart(string $optionValue, string $string)

Gets upper case word among a string from the end or from the beginning part

static string
getContentFromUrl(string $url, string $basicAuthLogin = null, string $basicAuthPassword = null, string $proxyHost = null, string $proxyPort = null, string $proxyLogin = null, string $proxyPassword = null, array $contextOptions = [])

Get content from url using a proxy or not

static string[]
getStreamContextOptions(string $basicAuthLogin = null, string $basicAuthPassword = null, string $proxyHost = null, string $proxyPort = null, string $proxyLogin = null, string $proxyPassword = null, array $contextOptions = [])

No description

static mixed
getValueWithinItsType(mixed $value, string $knownType = null)

Returns the value with good type

static string
resolveCompletePath(string $origin, string $destination)

No description

static string
cleanComment(string $comment, string $glueSeparator = ',', bool $uniqueValues = true)

Clean comment

static string
cleanString(string $string, bool $keepMultipleUnderscores = true)

Clean a string to make it valid as PHP variable See more about the used regular expression at {@link http://www.regular-expressions.info/unicode.html}: - \p{L} for any valid letter - \p{N} for any valid number - /u for supporting unicode

static string
removeNamespace(string $namespacedClassName)

No description

static bool
createDirectory(string $directory, int $permissions = 0775)

No description

static string
saveSchemas(string $destinationFolder, string $schemasFolder, string $schemasUrl, string $content)

Save schemas to schemasFolder Filename will be extracted from schemasUrl or default schema.wsdl will be used

Details

static string getPart(string $optionValue, string $string)

Gets upper case word among a string from the end or from the beginning part

Parameters

string $optionValue
string $string the string from which we can extract the part

Return Value

string

static string getContentFromUrl(string $url, string $basicAuthLogin = null, string $basicAuthPassword = null, string $proxyHost = null, string $proxyPort = null, string $proxyLogin = null, string $proxyPassword = null, array $contextOptions = [])

Get content from url using a proxy or not

Parameters

string $url
string $basicAuthLogin
string $basicAuthPassword
string $proxyHost
string $proxyPort
string $proxyLogin
string $proxyPassword
array $contextOptions

Return Value

string

static string[] getStreamContextOptions(string $basicAuthLogin = null, string $basicAuthPassword = null, string $proxyHost = null, string $proxyPort = null, string $proxyLogin = null, string $proxyPassword = null, array $contextOptions = [])

Parameters

string $basicAuthLogin
string $basicAuthPassword
string $proxyHost
string $proxyPort
string $proxyLogin
string $proxyPassword
array $contextOptions

Return Value

string[]

static mixed getValueWithinItsType(mixed $value, string $knownType = null)

Returns the value with good type

Parameters

mixed $value the value
string $knownType the value

Return Value

mixed

static string resolveCompletePath(string $origin, string $destination)

Parameters

string $origin
string $destination

Return Value

string

static string cleanComment(string $comment, string $glueSeparator = ',', bool $uniqueValues = true)

Clean comment

Parameters

string $comment the comment to clean
string $glueSeparator ths string to use when gathering values
bool $uniqueValues indicates if comment values must be unique or not

Return Value

string

static string cleanString(string $string, bool $keepMultipleUnderscores = true)

Clean a string to make it valid as PHP variable See more about the used regular expression at {@link http://www.regular-expressions.info/unicode.html}: - \p{L} for any valid letter - \p{N} for any valid number - /u for supporting unicode

Parameters

string $string the string to clean
bool $keepMultipleUnderscores optional, allows to keep the multiple consecutive underscores

Return Value

string

static string removeNamespace(string $namespacedClassName)

Parameters

string $namespacedClassName

Return Value

string

static bool createDirectory(string $directory, int $permissions = 0775)

Parameters

string $directory
int $permissions

Return Value

bool

static string saveSchemas(string $destinationFolder, string $schemasFolder, string $schemasUrl, string $content)

Save schemas to schemasFolder Filename will be extracted from schemasUrl or default schema.wsdl will be used

Parameters

string $destinationFolder
string $schemasFolder
string $schemasUrl
string $content

Return Value

string