Support
in package
Table of Contents
Methods
- arrayToString() : string
- This function converts an array to a comma-separated string
- arrFlatten() : array<string|int, mixed>
- Flattens an array
- capitalize() : string
- Capitalizes any word eg hello world => Hello World
- classify() : string
- Converts a string to a class name eg hello_world => HelloWorld
- escapeArgument() : string
- Escapes a string to be used as a shell argument.
- extends() : bool
- This function checks if a class extends another class
- formatter() : Inflector
- Gives you a chance to teleport to the core symfony inflector
- implements() : bool
- This function checks if a class implements an interface
- inidelsection() : void
- Removes an entire section from the database.ini file
- isValidIniFile() : bool
- Checks if a file is a valid ini file
- jsonify() : string
- This function json encodes a value
- levelOneKeys() : array<string|int, mixed>
- Grabs all keys of an array. But ignores nested keys Converts ['name' => 'John', 'age' => 20, 'address' => ['city' => 'Lagos', 'state' => 'Lagos']] to ['name', 'age', 'address']
- modelize() : string
- Converts a string to a table name eg HelloWorld => hello_world
- pluralize() : string
- Converts any word to its plural form
- singularize() : string
- Converts any word to its singular form
- slugify() : string
- Converts a string to a slug eg HelloWorld => hello-world
- toCamelCase() : string
- Camel cases any string you drop at it
- toSnakeCase() : string
- Converts any word to its snake case form
- updateSettingsFileSection() : void
- Creates or updates any section of our database.ini file to the values provided
- isSurroundedBy() : bool
- Is the given string surrounded by the given character?
Methods
arrayToString()
This function converts an array to a comma-separated string
public
static arrayToString(array<string|int, mixed> $array[, string $separator = ',' ]) : string
Parameters
- $array : array<string|int, mixed>
-
The array to convert
- $separator : string = ','
-
The separator to use
Return values
string —The comma-separated string
arrFlatten()
Flattens an array
public
static arrFlatten(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>
Return values
array<string|int, mixed>capitalize()
Capitalizes any word eg hello world => Hello World
public
static capitalize(string $word) : string
Parameters
- $word : string
Return values
stringclassify()
Converts a string to a class name eg hello_world => HelloWorld
public
static classify(string $class) : string
Parameters
- $class : string
Return values
stringescapeArgument()
Escapes a string to be used as a shell argument.
public
static escapeArgument(string $argument) : string
Parameters
- $argument : string
Return values
stringextends()
This function checks if a class extends another class
public
static extends(string $klass, string $baseObj) : bool
Parameters
- $klass : string
-
The class to check
- $baseObj : string
-
The base class to check against
Return values
boolformatter()
Gives you a chance to teleport to the core symfony inflector
public
static formatter() : Inflector
Return values
Inflectorimplements()
This function checks if a class implements an interface
public
static implements(string $class, string $interface) : bool
Parameters
- $class : string
-
The class to check
- $interface : string
-
The interface to check against
Return values
boolinidelsection()
Removes an entire section from the database.ini file
public
static inidelsection(string $filePath, string $section, PioniaApplication|null $application) : void
Parameters
- $filePath : string
- $section : string
- $application : PioniaApplication|null
isValidIniFile()
Checks if a file is a valid ini file
public
static isValidIniFile(string $filePath) : bool
Parameters
- $filePath : string
Return values
booljsonify()
This function json encodes a value
public
static jsonify(mixed $value) : string
Parameters
- $value : mixed
-
The value to encode
Return values
string —The json encoded value
levelOneKeys()
Grabs all keys of an array. But ignores nested keys Converts ['name' => 'John', 'age' => 20, 'address' => ['city' => 'Lagos', 'state' => 'Lagos']] to ['name', 'age', 'address']
public
static levelOneKeys(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>
Return values
array<string|int, mixed>modelize()
Converts a string to a table name eg HelloWorld => hello_world
public
static modelize(string $class) : string
Parameters
- $class : string
Return values
stringpluralize()
Converts any word to its plural form
public
static pluralize(string $word) : string
Parameters
- $word : string
Return values
stringsingularize()
Converts any word to its singular form
public
static singularize(string $word) : string
Parameters
- $word : string
Return values
stringslugify()
Converts a string to a slug eg HelloWorld => hello-world
public
static slugify(string $class) : string
Parameters
- $class : string
Return values
stringtoCamelCase()
Camel cases any string you drop at it
public
static toCamelCase(string $string) : string
Parameters
- $string : string
Return values
stringtoSnakeCase()
Converts any word to its snake case form
public
static toSnakeCase(string $string) : string
Parameters
- $string : string
Return values
stringupdateSettingsFileSection()
Creates or updates any section of our database.ini file to the values provided
public
static updateSettingsFileSection(string $filePath, string $section, array<string|int, mixed> $values[, PioniaApplication|null $application = null ]) : void
Parameters
- $filePath : string
- $section : string
-
The section to update/create
- $values : array<string|int, mixed>
-
The values to update/create
- $application : PioniaApplication|null = null
isSurroundedBy()
Is the given string surrounded by the given character?
protected
static isSurroundedBy(string $arg, string $char) : bool
Parameters
- $arg : string
- $char : string