PHP 클래스 Assert\Assertion

저자: Benjamin Eberlei ([email protected])
파일 보기 프로젝트 열기: beberlei/assert 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$exceptionClass string Exception to throw when an assertion failed.

공개 메소드들

메소드 설명
__callStatic ( string $method, array $args ) : boolean | mixed static call handler to implement: - "null or assertion" delegation - "all" delegation
alnum ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is alphanumeric.
between ( mixed $value, mixed $lowerLimit, mixed $upperLimit, string $message = null, string $propertyPath = null ) : boolean Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit.
betweenExclusive ( mixed $value, mixed $lowerLimit, mixed $upperLimit, string $message = null, string $propertyPath = null ) : boolean Assert that a value is greater than a lower limit, and less than an upper limit.
betweenLength ( mixed $value, integer $minLength, integer $maxLength, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean Assert that string length is between min,max lengths.
boolean ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is php boolean
choice ( mixed $value, array $choices, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is in array of choices.
choicesNotEmpty ( array $values, array $choices, null $message = null, null $propertyPath = null ) : boolean Determines if the values array has every choice as key and that this choice has content.
classExists ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the class exists.
contains ( mixed $string, string $needle, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean Assert that string contains a sequence of chars.
count ( array | Countable $countable, integer $count, string $message = null, string $propertyPath = null ) : boolean Assert that the count of countable is equal to count.
date ( string $value, string $format, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that date is valid and corresponds to the given format.
digit ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Validates if an integer or integerish is a digit.
directory ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that a directory exists
e164 ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the given string is a valid E164 Phone Number
email ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is an email adress (using input_filter/FILTER_VALIDATE_EMAIL).
endsWith ( mixed $string, string $needle, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean Assert that string ends with a sequence of chars.
eq ( mixed $value, mixed $value2, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that two values are equal (using == ).
false ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the value is boolean False.
file ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that a file exists
float ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is a php float.
greaterOrEqualThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean Determines if the value is greater or equal than given limit.
greaterThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean Determines if the value is greater than given limit.
implementsInterface ( mixed $class, string $interfaceName, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the class implements the interface
inArray ( mixed $value, array $choices, string | null $message = null, string | null $propertyPath = null ) : boolean Alias of {@see choice()}
integer ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is a php integer.
integerish ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is a php integer'ish.
interfaceExists ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the interface exists.
ip ( string $value, null | integer $flag = null, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is an IPv4 or IPv6 address (using input_filter/FILTER_VALIDATE_IP).
ipv4 ( string $value, null | integer $flag = null, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is an IPv4 address (using input_filter/FILTER_VALIDATE_IP).
ipv6 ( string $value, null | integer $flag = null, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is an IPv6 address (using input_filter/FILTER_VALIDATE_IP).
isArray ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is an array.
isArrayAccessible ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is an array or an array-accessible object.
isCallable ( mixed $value, null $message = null, null $propertyPath = null ) : boolean Determines that the provided value is callable.
isInstanceOf ( mixed $value, string $className, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is instance of given class-name.
isJsonString ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the given string is a valid json string.
isObject ( mixed $value, null $message = null, null $propertyPath = null ) : boolean Determines that the provided value is an object.
isTraversable ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is an array or a traversable object.
keyExists ( mixed $value, string | integer $key, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that key exists in an array
keyIsset ( mixed $value, string | integer $key, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that key exists in an array/array-accessible object using isset()
keyNotExists ( mixed $value, string | integer $key, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that key does not exist in an array
length ( mixed $value, integer $length, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean Assert that string has a given length.
lessOrEqualThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean Determines if the value is less or than given limit.
lessThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean Determines if the value is less than given limit.
max ( mixed $value, mixed $maxValue, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that a number is smaller as a given limit
maxLength ( mixed $value, integer $maxLength, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean Assert that string value is not longer than $maxLength chars.
methodExists ( string $value, mixed $object, null $message = null, null $propertyPath = null ) : boolean Determines that the named method is defined in the provided object.
min ( mixed $value, mixed $minValue, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that a value is at least as big as a given limit
minLength ( mixed $value, integer $minLength, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean Assert that a string is at least $minLength chars long.
noContent ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is empty
notBlank ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is not blank
notEmpty ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is not empty
notEmptyKey ( mixed $value, string | integer $key, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that key exists in an array/array-accessible object and it's value is not empty.
notEq ( mixed $value1, mixed $value2, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that two values are not equal (using == ).
notInArray ( mixed $value, array $choices, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is not in array of choices.
notIsInstanceOf ( mixed $value, string $className, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is not instance of given class-name.
notNull ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is not null
notSame ( mixed $value1, mixed $value2, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that two values are not the same (using === ).
null ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is null
numeric ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is numeric.
range ( mixed $value, integer $minValue, integer $maxValue, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is in range of numbers.
readable ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the value is something readable
regex ( mixed $value, string $pattern, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value matches a regex
same ( mixed $value, mixed $value2, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that two values are the same (using ===).
satisfy ( mixed $value, callable $callback, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the provided value is valid according to a callback.
scalar ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is a PHP scalar
startsWith ( mixed $string, string $needle, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean Assert that string starts with a sequence of chars.
string ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is a string
subclassOf ( mixed $value, string $className, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is subclass of given class-name.
true ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the value is boolean True.
url ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that value is an URL.
uuid ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the given string is a valid UUID
writeable ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean Assert that the value is something writeable

보호된 메소드들

메소드 설명
createException ( mixed $value, string $message, integer $code, string | null $propertyPath, array $constraints = [] ) : mixed Helper method that handles building the assertion failure exceptions.
stringify ( mixed $value ) : string Make a string version of a value.

메소드 상세

__callStatic() 공개 정적인 메소드

static call handler to implement: - "null or assertion" delegation - "all" delegation
public static __callStatic ( string $method, array $args ) : boolean | mixed
$method string
$args array
리턴 boolean | mixed

alnum() 공개 정적인 메소드

Assert that value is alphanumeric.
public static alnum ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

between() 공개 정적인 메소드

Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit.
public static between ( mixed $value, mixed $lowerLimit, mixed $upperLimit, string $message = null, string $propertyPath = null ) : boolean
$value mixed
$lowerLimit mixed
$upperLimit mixed
$message string
$propertyPath string
리턴 boolean

betweenExclusive() 공개 정적인 메소드

Assert that a value is greater than a lower limit, and less than an upper limit.
public static betweenExclusive ( mixed $value, mixed $lowerLimit, mixed $upperLimit, string $message = null, string $propertyPath = null ) : boolean
$value mixed
$lowerLimit mixed
$upperLimit mixed
$message string
$propertyPath string
리턴 boolean

betweenLength() 공개 정적인 메소드

Assert that string length is between min,max lengths.
public static betweenLength ( mixed $value, integer $minLength, integer $maxLength, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean
$value mixed
$minLength integer
$maxLength integer
$message string | null
$propertyPath string | null
$encoding string
리턴 boolean

boolean() 공개 정적인 메소드

Assert that value is php boolean
public static boolean ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

choice() 공개 정적인 메소드

Assert that value is in array of choices.
public static choice ( mixed $value, array $choices, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$choices array
$message string | null
$propertyPath string | null
리턴 boolean

choicesNotEmpty() 공개 정적인 메소드

Determines if the values array has every choice as key and that this choice has content.
public static choicesNotEmpty ( array $values, array $choices, null $message = null, null $propertyPath = null ) : boolean
$values array
$choices array
$message null
$propertyPath null
리턴 boolean

classExists() 공개 정적인 메소드

Assert that the class exists.
public static classExists ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

contains() 공개 정적인 메소드

Assert that string contains a sequence of chars.
public static contains ( mixed $string, string $needle, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean
$string mixed
$needle string
$message string | null
$propertyPath string | null
$encoding string
리턴 boolean

count() 공개 정적인 메소드

Assert that the count of countable is equal to count.
public static count ( array | Countable $countable, integer $count, string $message = null, string $propertyPath = null ) : boolean
$countable array | Countable
$count integer
$message string
$propertyPath string
리턴 boolean

createException() 보호된 정적인 메소드

They are returned from this method so that the stack trace still shows the assertions method.
protected static createException ( mixed $value, string $message, integer $code, string | null $propertyPath, array $constraints = [] ) : mixed
$value mixed
$message string
$code integer
$propertyPath string | null
$constraints array
리턴 mixed

date() 공개 정적인 메소드

Assert that date is valid and corresponds to the given format.
public static date ( string $value, string $format, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$format string supports all of the options date(), except for the following: N, w, W, t, L, o, B, a, A, g, h, I, O, P, Z, c, r.
$message string | null
$propertyPath string | null
리턴 boolean

digit() 공개 정적인 메소드

Validates if an integer or integerish is a digit.
public static digit ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

directory() 공개 정적인 메소드

Assert that a directory exists
public static directory ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$message string | null
$propertyPath string | null
리턴 boolean

e164() 공개 정적인 메소드

Assert that the given string is a valid E164 Phone Number
public static e164 ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$message string | null
$propertyPath string | null
리턴 boolean

email() 공개 정적인 메소드

Assert that value is an email adress (using input_filter/FILTER_VALIDATE_EMAIL).
public static email ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

endsWith() 공개 정적인 메소드

Assert that string ends with a sequence of chars.
public static endsWith ( mixed $string, string $needle, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean
$string mixed
$needle string
$message string | null
$propertyPath string | null
$encoding string
리턴 boolean

eq() 공개 정적인 메소드

Assert that two values are equal (using == ).
public static eq ( mixed $value, mixed $value2, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$value2 mixed
$message string | null
$propertyPath string | null
리턴 boolean

false() 공개 정적인 메소드

Assert that the value is boolean False.
public static false ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

file() 공개 정적인 메소드

Assert that a file exists
public static file ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$message string | null
$propertyPath string | null
리턴 boolean

float() 공개 정적인 메소드

Assert that value is a php float.
public static float ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

greaterOrEqualThan() 공개 정적인 메소드

Determines if the value is greater or equal than given limit.
public static greaterOrEqualThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean
$value mixed
$limit mixed
$message null
$propertyPath null
리턴 boolean

greaterThan() 공개 정적인 메소드

Determines if the value is greater than given limit.
public static greaterThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean
$value mixed
$limit mixed
$message null
$propertyPath null
리턴 boolean

implementsInterface() 공개 정적인 메소드

Assert that the class implements the interface
public static implementsInterface ( mixed $class, string $interfaceName, string | null $message = null, string | null $propertyPath = null ) : boolean
$class mixed
$interfaceName string
$message string | null
$propertyPath string | null
리턴 boolean

inArray() 공개 정적인 메소드

Alias of {@see choice()}
public static inArray ( mixed $value, array $choices, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$choices array
$message string | null
$propertyPath string | null
리턴 boolean

integer() 공개 정적인 메소드

Assert that value is a php integer.
public static integer ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

integerish() 공개 정적인 메소드

Assert that value is a php integer'ish.
public static integerish ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

interfaceExists() 공개 정적인 메소드

Assert that the interface exists.
public static interfaceExists ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

ip() 공개 정적인 메소드

Assert that value is an IPv4 or IPv6 address (using input_filter/FILTER_VALIDATE_IP).
public static ip ( string $value, null | integer $flag = null, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$flag null | integer
$message string | null
$propertyPath string | null
리턴 boolean

ipv4() 공개 정적인 메소드

Assert that value is an IPv4 address (using input_filter/FILTER_VALIDATE_IP).
public static ipv4 ( string $value, null | integer $flag = null, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$flag null | integer
$message string | null
$propertyPath string | null
리턴 boolean

ipv6() 공개 정적인 메소드

Assert that value is an IPv6 address (using input_filter/FILTER_VALIDATE_IP).
public static ipv6 ( string $value, null | integer $flag = null, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$flag null | integer
$message string | null
$propertyPath string | null
리턴 boolean

isArray() 공개 정적인 메소드

Assert that value is an array.
public static isArray ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

isArrayAccessible() 공개 정적인 메소드

Assert that value is an array or an array-accessible object.
public static isArrayAccessible ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

isCallable() 공개 정적인 메소드

Determines that the provided value is callable.
public static isCallable ( mixed $value, null $message = null, null $propertyPath = null ) : boolean
$value mixed
$message null
$propertyPath null
리턴 boolean

isInstanceOf() 공개 정적인 메소드

Assert that value is instance of given class-name.
public static isInstanceOf ( mixed $value, string $className, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$className string
$message string | null
$propertyPath string | null
리턴 boolean

isJsonString() 공개 정적인 메소드

NOTICE: Since this does a json_decode to determine its validity you probably should consider, when using the variable content afterwards, just to decode and check for yourself instead of using this assertion.
public static isJsonString ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

isObject() 공개 정적인 메소드

Determines that the provided value is an object.
public static isObject ( mixed $value, null $message = null, null $propertyPath = null ) : boolean
$value mixed
$message null
$propertyPath null
리턴 boolean

isTraversable() 공개 정적인 메소드

Assert that value is an array or a traversable object.
public static isTraversable ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

keyExists() 공개 정적인 메소드

Assert that key exists in an array
public static keyExists ( mixed $value, string | integer $key, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$key string | integer
$message string | null
$propertyPath string | null
리턴 boolean

keyIsset() 공개 정적인 메소드

Assert that key exists in an array/array-accessible object using isset()
public static keyIsset ( mixed $value, string | integer $key, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$key string | integer
$message string | null
$propertyPath string | null
리턴 boolean

keyNotExists() 공개 정적인 메소드

Assert that key does not exist in an array
public static keyNotExists ( mixed $value, string | integer $key, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$key string | integer
$message string | null
$propertyPath string | null
리턴 boolean

length() 공개 정적인 메소드

Assert that string has a given length.
public static length ( mixed $value, integer $length, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean
$value mixed
$length integer
$message string | null
$propertyPath string | null
$encoding string
리턴 boolean

lessOrEqualThan() 공개 정적인 메소드

Determines if the value is less or than given limit.
public static lessOrEqualThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean
$value mixed
$limit mixed
$message null
$propertyPath null
리턴 boolean

lessThan() 공개 정적인 메소드

Determines if the value is less than given limit.
public static lessThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean
$value mixed
$limit mixed
$message null
$propertyPath null
리턴 boolean

max() 공개 정적인 메소드

Assert that a number is smaller as a given limit
public static max ( mixed $value, mixed $maxValue, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$maxValue mixed
$message string | null
$propertyPath string | null
리턴 boolean

maxLength() 공개 정적인 메소드

Assert that string value is not longer than $maxLength chars.
public static maxLength ( mixed $value, integer $maxLength, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean
$value mixed
$maxLength integer
$message string | null
$propertyPath string | null
$encoding string
리턴 boolean

methodExists() 공개 정적인 메소드

Determines that the named method is defined in the provided object.
public static methodExists ( string $value, mixed $object, null $message = null, null $propertyPath = null ) : boolean
$value string
$object mixed
$message null
$propertyPath null
리턴 boolean

min() 공개 정적인 메소드

Assert that a value is at least as big as a given limit
public static min ( mixed $value, mixed $minValue, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$minValue mixed
$message string | null
$propertyPath string | null
리턴 boolean

minLength() 공개 정적인 메소드

Assert that a string is at least $minLength chars long.
public static minLength ( mixed $value, integer $minLength, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean
$value mixed
$minLength integer
$message string | null
$propertyPath string | null
$encoding string
리턴 boolean

noContent() 공개 정적인 메소드

Assert that value is empty
public static noContent ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

notBlank() 공개 정적인 메소드

Assert that value is not blank
public static notBlank ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

notEmpty() 공개 정적인 메소드

Assert that value is not empty
public static notEmpty ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

notEmptyKey() 공개 정적인 메소드

Assert that key exists in an array/array-accessible object and it's value is not empty.
public static notEmptyKey ( mixed $value, string | integer $key, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$key string | integer
$message string | null
$propertyPath string | null
리턴 boolean

notEq() 공개 정적인 메소드

Assert that two values are not equal (using == ).
public static notEq ( mixed $value1, mixed $value2, string | null $message = null, string | null $propertyPath = null ) : boolean
$value1 mixed
$value2 mixed
$message string | null
$propertyPath string | null
리턴 boolean

notInArray() 공개 정적인 메소드

Assert that value is not in array of choices.
public static notInArray ( mixed $value, array $choices, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$choices array
$message string | null
$propertyPath string | null
리턴 boolean

notIsInstanceOf() 공개 정적인 메소드

Assert that value is not instance of given class-name.
public static notIsInstanceOf ( mixed $value, string $className, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$className string
$message string | null
$propertyPath string | null
리턴 boolean

notNull() 공개 정적인 메소드

Assert that value is not null
public static notNull ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

notSame() 공개 정적인 메소드

Assert that two values are not the same (using === ).
public static notSame ( mixed $value1, mixed $value2, string | null $message = null, string | null $propertyPath = null ) : boolean
$value1 mixed
$value2 mixed
$message string | null
$propertyPath string | null
리턴 boolean

null() 공개 정적인 메소드

Assert that value is null
public static null ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

numeric() 공개 정적인 메소드

Assert that value is numeric.
public static numeric ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

range() 공개 정적인 메소드

Assert that value is in range of numbers.
public static range ( mixed $value, integer $minValue, integer $maxValue, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$minValue integer
$maxValue integer
$message string | null
$propertyPath string | null
리턴 boolean

readable() 공개 정적인 메소드

Assert that the value is something readable
public static readable ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$message string | null
$propertyPath string | null
리턴 boolean

regex() 공개 정적인 메소드

Assert that value matches a regex
public static regex ( mixed $value, string $pattern, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$pattern string
$message string | null
$propertyPath string | null
리턴 boolean

same() 공개 정적인 메소드

Assert that two values are the same (using ===).
public static same ( mixed $value, mixed $value2, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$value2 mixed
$message string | null
$propertyPath string | null
리턴 boolean

satisfy() 공개 정적인 메소드

If the callback returns false the assertion will fail.
public static satisfy ( mixed $value, callable $callback, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$callback callable
$message string | null
$propertyPath string | null
리턴 boolean

scalar() 공개 정적인 메소드

Assert that value is a PHP scalar
public static scalar ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

startsWith() 공개 정적인 메소드

Assert that string starts with a sequence of chars.
public static startsWith ( mixed $string, string $needle, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean
$string mixed
$needle string
$message string | null
$propertyPath string | null
$encoding string
리턴 boolean

string() 공개 정적인 메소드

Assert that value is a string
public static string ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

stringify() 보호된 정적인 메소드

Make a string version of a value.
protected static stringify ( mixed $value ) : string
$value mixed
리턴 string

subclassOf() 공개 정적인 메소드

Assert that value is subclass of given class-name.
public static subclassOf ( mixed $value, string $className, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$className string
$message string | null
$propertyPath string | null
리턴 boolean

true() 공개 정적인 메소드

Assert that the value is boolean True.
public static true ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

url() 공개 정적인 메소드

This code snipped was taken from the Symfony project and modified to the special demands of this method.
public static url ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
리턴 boolean

uuid() 공개 정적인 메소드

Uses code from {@link https://github.com/ramsey/uuid} that is MIT licensed.
public static uuid ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$message string | null
$propertyPath string | null
리턴 boolean

writeable() 공개 정적인 메소드

Assert that the value is something writeable
public static writeable ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$message string | null
$propertyPath string | null
리턴 boolean

프로퍼티 상세

$exceptionClass 보호되어 있는 정적으로 프로퍼티

Exception to throw when an assertion failed.
protected static string $exceptionClass
리턴 string