Assert
Table of Contents
Methods
- announceNotImplemented() : mixed
- Method announces that method or action is not implemented
- announceNotSupported() : mixed
- Method announces that method or action is not supported
- castTrimLC() : mixed
- expectArray() : array<string|int, mixed>
- Method checks if the given argument is an array
- expectArrayOfUniqueIntegerNotNull() : array<string|int, int>
- Method checks if the given argument is a non-empty array of unique positive integers (or somehow can be casted to it)
- expectArrayOfUniqueStringNotNull() : array<string|int, string>
- Method checks if the given argument is a non-empty array of unique non-zero-length strings (or somehow can be casted to it)
- expectEnumerationMember() : array<string|int, mixed>
- Method checks if the given argument belongs to a set of elements
- expectInteger() : int
- Method checks if the given argument is an integer value, or can be casted to it
- expectIntegerNonNegative() : int
- Method checks if the given argument is a non-negative integer value, or can be casted to it
- expectIntegerPositive() : int
- Method checks if the given argument is a positive integer value, or can be casted to it
- expectNotEmptyArray() : array<string|int, mixed>
- Method checks if the given argument is a non-empty array
- expectStringNotNull() : string
- Method checks if the given argument is a non-zero-length string value, or can be casted to it
Methods
announceNotImplemented()
Method announces that method or action is not implemented
public
final static announceNotImplemented([string $msg = '' ]) : mixed
Parameters
- $msg : string = ''
-
message to be shown
Tags
announceNotSupported()
Method announces that method or action is not supported
public
final static announceNotSupported([string $msg = '' ]) : mixed
Parameters
- $msg : string = ''
-
message to be shown
Tags
castTrimLC()
public
static castTrimLC(mixed $value) : mixed
Parameters
- $value : mixed
expectArray()
Method checks if the given argument is an array
public
final static expectArray(array<string|int, mixed> $arg[, string $argName = '' ][, string $customMsg = '' ]) : array<string|int, mixed>
Parameters
- $arg : array<string|int, mixed>
-
argument to check
- $argName : string = ''
-
argument name to figure in a error message
- $customMsg : string = ''
-
custom message to be shown instead of a standard one
Tags
Return values
array<string|int, mixed> —value being checked
expectArrayOfUniqueIntegerNotNull()
Method checks if the given argument is a non-empty array of unique positive integers (or somehow can be casted to it)
public
final static expectArrayOfUniqueIntegerNotNull(array<string|int, mixed> $arg[, string $argName = '' ][, string $customMsg = '' ]) : array<string|int, int>
Parameters
- $arg : array<string|int, mixed>
-
argument to check
- $argName : string = ''
-
argument name to figure in a error message
- $customMsg : string = ''
-
custom message to be shown instead of a standard one
Tags
Return values
array<string|int, int> —checked and casted value
expectArrayOfUniqueStringNotNull()
Method checks if the given argument is a non-empty array of unique non-zero-length strings (or somehow can be casted to it)
public
final static expectArrayOfUniqueStringNotNull(array<string|int, mixed> $arg[, string $argName = '' ][, string $customMsg = '' ]) : array<string|int, string>
Parameters
- $arg : array<string|int, mixed>
-
argument to check
- $argName : string = ''
-
argument name to figure in a error message
- $customMsg : string = ''
-
custom message to be shown instead of a standard one
Tags
Return values
array<string|int, string> —checked and casted value
expectEnumerationMember()
Method checks if the given argument belongs to a set of elements
public
final static expectEnumerationMember(array<string|int, mixed> $arg[, array<string|int, mixed> $enum = array() ][, string $argName = '' ][, string $customMsg = '' ]) : array<string|int, mixed>
Parameters
- $arg : array<string|int, mixed>
-
argument to check
- $enum : array<string|int, mixed> = array()
-
enumeration to check argument belong to
- $argName : string = ''
-
argument name to figure in a error message
- $customMsg : string = ''
-
custom message to be shown instead of a standard one
Tags
Return values
array<string|int, mixed> —checked and casted value
expectInteger()
Method checks if the given argument is an integer value, or can be casted to it
public
final static expectInteger(mixed $arg[, string $argName = '' ][, string $customMsg = '' ]) : int
Parameters
- $arg : mixed
-
argument to check
- $argName : string = ''
-
argument name to figure in a error message
- $customMsg : string = ''
-
custom message to be shown instead of a standard one
Tags
Return values
int —checked and casted value
expectIntegerNonNegative()
Method checks if the given argument is a non-negative integer value, or can be casted to it
public
final static expectIntegerNonNegative(mixed $arg[, string $argName = '' ][, string $customMsg = '' ]) : int
Parameters
- $arg : mixed
-
argument to check
- $argName : string = ''
-
argument name to figure in a error message
- $customMsg : string = ''
-
custom message to be shown instead of a standard one
Tags
Return values
int —checked and casted value
expectIntegerPositive()
Method checks if the given argument is a positive integer value, or can be casted to it
public
final static expectIntegerPositive(mixed $arg[, string $argName = '' ][, string $customMsg = '' ]) : int
Parameters
- $arg : mixed
-
argument to check
- $argName : string = ''
-
argument name to figure in a error message
- $customMsg : string = ''
-
custom message to be shown instead of a standard one
Tags
Return values
int —checked and casted value
expectNotEmptyArray()
Method checks if the given argument is a non-empty array
public
final static expectNotEmptyArray(array<string|int, mixed> $arg[, string $argName = '' ][, string $customMsg = '' ]) : array<string|int, mixed>
Parameters
- $arg : array<string|int, mixed>
-
argument to check
- $argName : string = ''
-
argument name to figure in a error message
- $customMsg : string = ''
-
custom message to be shown instead of a standard one
Tags
Return values
array<string|int, mixed> —value being checked
expectStringNotNull()
Method checks if the given argument is a non-zero-length string value, or can be casted to it
public
final static expectStringNotNull(mixed $arg[, string $argName = '' ][, string $customMsg = '' ]) : string
Parameters
- $arg : mixed
-
argument to check
- $argName : string = ''
-
argument name to figure in a error message
- $customMsg : string = ''
-
custom message to be shown instead of a standard one
Tags
Return values
string —checked and casted value