Menu

## Utilities
in package

Utilities.php : 15

These are just helpers to quickly get staff done

##### Tags

author

  Jet - ezrajet9@gmail.com

### Table of Contents

#### Methods

arrayToCommaSepString() : string
  This function converts an array to a comma-separated string
capitalize() : string
  Capitalizes any word eg hello world => Hello World
classify() : string
  Converts a string to a class name eg hello_world => HelloWorld
extends() : bool|string
  This function checks if a class extends another class
formatter() : Inflector
  Gives you a chance to teleport to the core symfony inflector
implements() : bool|string
  This function checks if a class implements an interface
inidelsection() : void
  Removes an entire section from the database.ini file
jsonify() : string
  This function json encodes a value
levelOneKeysOf() : 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
updateSettingsFileSection() : void
  Creates or updates any section of our database.ini file to the values provided

### Methods

#### arrayToCommaSepString()

Utilities.php : 24

This function converts an array to a comma-separated string

`public static arrayToCommaSepString(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

#### capitalize()

Utilities.php : 113

Capitalizes any word eg hello world => Hello World

`public static capitalize(string $word) : string`

##### Parameters

$word : string

##### Return values

string

#### classify()

Utilities.php : 131

Converts a string to a class name eg hello_world => HelloWorld

`public static classify(string $class) : string`

##### Parameters

$class : string

##### Return values

string

#### extends()

Utilities.php : 45

This function checks if a class extends another class

`public static extends(string $klass, string $baseObj) : bool|string`

##### Parameters

$klass : string

  The class to check

$baseObj : string

  The base class to check against

##### Return values

bool|string —

True if the class extends the base class, or 'NO_CLASS' if the class does not exist, or 'DOES_NOT' if the class does not extend the base class

#### formatter()

Utilities.php : 121

Gives you a chance to teleport to the core symfony inflector

`public static formatter() : Inflector`

##### Return values

Inflector

#### implements()

Utilities.php : 64

This function checks if a class implements an interface

`public static implements(string $class, string $interface) : bool|string`

##### Parameters

$class : string

  The class to check

$interface : string

  The interface to check against

##### Return values

bool|string —

True if the class implements the interface, or 'NO_CLASS' if the class does not exist, or 'DOES_NOT' if the class does not implement the interface

#### inidelsection()

Utilities.php : 211

Removes an entire section from the database.ini file

`public static inidelsection(string $section) : void`

##### Parameters

$section : string

#### jsonify()

Utilities.php : 34

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

#### levelOneKeysOf()

Utilities.php : 162

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 levelOneKeysOf(array<string|int, mixed> $array) : array<string|int, mixed>`

##### Parameters

$array : array<string|int, mixed>

##### Return values

array<string|int, mixed>

#### modelize()

Utilities.php : 141

Converts a string to a table name eg HelloWorld => hello_world

`public static modelize(string $class) : string`

##### Parameters

$class : string

##### Return values

string

#### pluralize()

Utilities.php : 103

Converts any word to its plural form

`public static pluralize(string $word) : string`

##### Parameters

$word : string

##### Return values

string

#### singularize()

Utilities.php : 93

Converts any word to its singular form

`public static singularize(string $word) : string`

##### Parameters

$word : string

##### Return values

string

#### slugify()

Utilities.php : 151

Converts a string to a slug eg HelloWorld => hello-world

`public static slugify(string $class) : string`

##### Parameters

$class : string

##### Return values

string

#### toCamelCase()

Utilities.php : 83

Camel cases any string you drop at it

`public static toCamelCase(string $string) : string`

##### Parameters

$string : string

##### Return values

string

#### updateSettingsFileSection()

Utilities.php : 181

Creates or updates any section of our database.ini file to the values provided

`public static updateSettingsFileSection(string $section, array<string|int, mixed> $values) : void`

##### Parameters

$section : string

  The section to update/create

$values : array<string|int, mixed>

  The values to update/create

## Search results