Helper
- Full name:
\Qubus\Validation\Helper
Methods
strIs
Determine if a given string matches a given pattern.
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$pattern | string | |
$value | string |
arrayHas
Check if an item or items exist in an array using "dot" notation.
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$array | array | |
$key | string |
arrayGet
Get an item from an array using "dot" notation.
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$array | array | |
$key | string|null | |
$default | mixed|null |
Throws:
arrayDot
Flatten a multi-dimensional associative array with dots.
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$array | array | |
$prepend | string |
arraySet
Set an item on an array or object using dot notation.
public static arraySet(mixed& $target, array|string|null $key, mixed $value, bool $overwrite = true): mixed
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$target | mixed | |
$key | array|string|null | |
$value | mixed | |
$overwrite | bool |
arrayUnset
Unset an item on an array or object using dot notation.
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$target | mixed | |
$key | array|string |
snakeCase
Get snake_case format from given string
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$value | string | |
$delimiter | string |
join
Join string[] to string with given $separator and $lastSeparator.
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$pieces | array | |
$separator | string | |
$lastSeparator | string|null |
wraps
Wrap string[] by given $prefix and $suffix
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$strings | array | |
$prefix | string | |
$suffix | string|null |