jf/assert

PHP Assertions library

3.1.2 2023-02-01 07:41 UTC

This package is auto-updated.

Last update: 2024-04-29 10:10:18 UTC


README

PHP Assertions library.

Installation

Composer

This project uses as dependency manager Composer which can be installed following the instructions specified in the official documentation of the project.

To install the jf/assert package using this package manager, run:

composer require jf/assert

Version control

This project can be installed using git. First you must clone the project and then install the dependencies:

git clone https://www.gitlab.com/jfphp/jfAssert.git
cd jfAssert
composer install

Files

Classes

NameDescription
jf\assert\AssertClass used to do validations and throw exceptions if they are not met.
jf\assert\dict\MessagesClass for handling library messages.
jf\assert\http\AHttpClass base for HTTP exceptions.
jf\assert\http\BadGatewayAssertions that return the HTTP status code 502 (Bad Gateway).
jf\assert\http\BadRequestAssertions that return the HTTP status code 400 (Bad Request).
jf\assert\http\ConflictAssertions that return the HTTP status code 409 (Conflict).
jf\assert\http\ExpectationFailedAssertions that return the HTTP status code 417 (Expectation Failed).
jf\assert\http\FailedDependencyAssertions that return the HTTP status code 424 (Failed Dependency).
jf\assert\http\ForbiddenAssertions that return the HTTP status code 403 (Forbidden).
jf\assert\http\FoundAssertions that return the HTTP status code 302 (Found).
jf\assert\http\GatewayTimeoutAssertions that return the HTTP status code 504 (Gateway Timeout).
jf\assert\http\GoneAssertions that return the HTTP status code 410 (Gone).
jf\assert\http\ImATeapotAssertions that return the HTTP status code 418 (Im A Teapot).
jf\assert\http\InsufficientStorageAssertions that return the HTTP status code 507 (Insufficient Storage).
jf\assert\http\InternalServerErrorAssertions that return the HTTP status code 500 (Internal Server Error).
jf\assert\http\LengthRequiredAssertions that return the HTTP status code 411 (Length Required).
jf\assert\http\LockedAssertions that return the HTTP status code 423 (Locked).
jf\assert\http\LoopDetectedAssertions that return the HTTP status code 508 (Loop Detected).
jf\assert\http\MethodNotAllowedAssertions that return the HTTP status code 405 (Method Not Allowed).
jf\assert\http\MisdirectedRequestAssertions that return the HTTP status code 421 (Misdirected Request).
jf\assert\http\MovedPermanentlyAssertions that return the HTTP status code 301 (Moved Permanently).
jf\assert\http\MultipleChoicesAssertions that return the HTTP status code 300 (Multiple Choices).
jf\assert\http\NetworkAuthenticationRequiredAssertions that return the HTTP status code 511 (Network Authentication Required).
jf\assert\http\NotAcceptableAssertions that return the HTTP status code 406 (Not Acceptable).
jf\assert\http\NotExtendedAssertions that return the HTTP status code 510 (Not Extended).
jf\assert\http\NotFoundAssertions that return the HTTP status code 404 (Not Found).
jf\assert\http\NotImplementedAssertions that return the HTTP status code 501 (Not Implemented).
jf\assert\http\NotModifiedAssertions that return the HTTP status code 304 (Not Modified).
jf\assert\http\PayloadTooLargeAssertions that return the HTTP status code 413 (Payload Too Large).
jf\assert\http\PaymentRequiredAssertions that return the HTTP status code 402 (Payment Required).
jf\assert\http\PermanentRedirectAssertions that return the HTTP status code 308 (Permanent Redirect).
jf\assert\http\PreconditionFailedAssertions that return the HTTP status code 412 (Precondition Failed).
jf\assert\http\PreconditionRequiredAssertions that return the HTTP status code 428 (Precondition Required).
jf\assert\http\ProxyAuthenticationRequiredAssertions that return the HTTP status code 407 (Proxy Authentication Required).
jf\assert\http\RangeNotSatisfiableAssertions that return the HTTP status code 416 (Range Not Satisfiable).
jf\assert\http\RequestHeaderFieldsTooLargeAssertions that return the HTTP status code 431 (Request Header Fields Too Large).
jf\assert\http\RequestTimeoutAssertions that return the HTTP status code 408 (Request Timeout).
jf\assert\http\ReservedAssertions that return the HTTP status code 306 (Reserved).
jf\assert\http\SeeOtherAssertions that return the HTTP status code 303 (See Other).
jf\assert\http\ServiceUnavailableAssertions that return the HTTP status code 503 (Service Unavailable).
jf\assert\http\TemporaryRedirectAssertions that return the HTTP status code 307 (Temporary Redirect).
jf\assert\http\TooEarlyAssertions that return the HTTP status code 425 (Too Early).
jf\assert\http\TooManyRequestsAssertions that return the HTTP status code 429 (Too Many Requests).
jf\assert\http\UnauthorizedAssertions that return the HTTP status code 401 (Unauthorized).
jf\assert\http\UnavailableForLegalReasonsAssertions that return the HTTP status code 451 (Unavailable For Legal Reasons).
jf\assert\http\UnprocessableEntityAssertions that return the HTTP status code 422 (Unprocessable Entity).
jf\assert\http\UnsupportedMediaTypeAssertions that return the HTTP status code 415 (Unsupported Media Type).
jf\assert\http\UpgradeRequiredAssertions that return the HTTP status code 426 (Upgrade Required).
jf\assert\http\UriTooLongAssertions that return the HTTP status code 414 (Uri Too Long).
jf\assert\http\UseProxyAssertions that return the HTTP status code 305 (Use Proxy).
jf\assert\http\VariantAlsoNegotiatesAssertions that return the HTTP status code 506 (Variant Also Negotiates).
jf\assert\http\VersionNotSupportedAssertions that return the HTTP status code 505 (Version Not Supported).
jf\assert\php\ArgumentCountErrorArgumentCountError is thrown when too few arguments are passed to a user-defined function or method.
jf\assert\php\ArithmeticErrorArithmeticError is thrown when an error occurs while performing mathematical operations. These errors include attempting to perform a bitshift by a negative amount, and any call to intdiv() that would result in a value outside the possible bounds of an int.
jf\assert\php\AssertionErrorAssertionError is thrown when an assertion made via assert() fails.
jf\assert\php\BadFunctionCallExceptionException thrown if a callback refers to an undefined function or if some arguments are missing.
jf\assert\php\BadMethodCallExceptionException thrown if a callback refers to an undefined method or if some arguments are missing.
jf\assert\php\CompileErrorCompileError is thrown for some compilation errors, which formerly issued a fatal error.
jf\assert\php\DivisionByZeroErrorDivisionByZeroError is thrown when an attempt is made to divide a number by zero.
jf\assert\php\DomainExceptionException thrown if a value does not adhere to a defined valid data domain.
jf\assert\php\ErrorError is the base class for all internal PHP errors.
jf\assert\php\ErrorExceptionAn Error Exception.
jf\assert\php\ExceptionException is the base class for all user exceptions.
jf\assert\php\IntlExceptionThis class is used for generating exceptions when errors occur inside intl functions. Such exceptions are only generated when intl.use_exceptions is enabled.
jf\assert\php\InvalidArgumentExceptionException thrown if an argument is not of the expected type.
jf\assert\php\JsonExceptionException thrown if JSON_THROW_ON_ERROR option is set for json_encode() or json_decode(). code contains the error type, for possible values see json_last_error().
jf\assert\php\LengthExceptionException thrown if a length is invalid.
jf\assert\php\LogicExceptionException that represents error in the program logic. This kind of exception should lead directly to a fix in your code.
jf\assert\php\OutOfBoundsExceptionException thrown if a value is not a valid key. This represents errors that cannot be detected at compile time.
jf\assert\php\OutOfRangeExceptionException thrown when an illegal index was requested. This represents errors that should be detected at compile time.
jf\assert\php\OverflowExceptionException thrown when adding an element to a full container.
jf\assert\php\PDOExceptionRepresents an error raised by PDO. You should not throw a PDOException from your own code. See Exceptions for more information about Exceptions in PHP.
jf\assert\php\ParseErrorParseError is thrown when an error occurs while parsing PHP code, such as when eval() is called.
jf\assert\php\PharExceptionThe PharException class provides a phar-specific exception class for try/catch blocks.
jf\assert\php\RangeExceptionException thrown to indicate range errors during program execution. Normally this means there was an arithmetic error other than under/overflow. This is the runtime version of DomainException.
jf\assert\php\ReflectionExceptionThe ReflectionException class.
jf\assert\php\RuntimeExceptionException thrown if an error which can only be found on runtime occurs.
jf\assert\php\SodiumExceptionExceptions thrown by the sodium functions.
jf\assert\php\TypeErrorA TypeError may be thrown when.
jf\assert\php\UnderflowExceptionException thrown when performing an invalid operation on an empty container, such as removing an element.
jf\assert\php\UnexpectedValueExceptionException thrown if a value does not match with a set of values. Typically this happens when a function calls another function and expects the return value to be of a certain type or value not including arithmetic or buffer related errors.
jf\assert\php\UnhandledMatchErrorAn UnhandledMatchError is thrown when the subject passed to a match expression is not handled by any arm of the match expression.
jf\assert\php\ValueErrorA ValueError is thrown when the type of an argument is correct but the value of it is incorrect. For example, passing a negative integer when the function expects a positive one, or passing an empty string/array when the function expects it to not be empty.

Traits

NameDescription
jf\assert\TAllTrait that includes all traits in the package.
jf\assert\TArrayTrait for assertions using functions from PHP module array.
jf\assert\TAssertTrait used to do validations and throw exceptions if they are not met.
jf\assert\TClassObjTrait for assertions using functions from PHP module classobj.
jf\assert\TCtypeTrait for assertions using functions from PHP module ctype.
jf\assert\TFileSystemTrait for assertions using functions from PHP module filesystem.
jf\assert\TFilterTrait for assertions using functions from PHP module filter.
jf\assert\TFloatTrait for comparisons between floats.
jf\assert\TFuncHandTrait for assertions using functions from PHP module funchand.
jf\assert\TInfoTrait for assertions using functions from PHP module info.
jf\assert\TIntegerTrait for comparisons between integers.
jf\assert\TLogicalTrait for logical comparisons between mixed types.
jf\assert\TMathTrait for assertions using functions from PHP module math.
jf\assert\TMessageTrait for building the error messages.
jf\assert\TStringsTrait for assertions using functions from PHP module strings.
jf\assert\TVarTrait for assertions using functions from PHP module var.

Assertions

jf\assert\TArray

Trait for assertions using functions from PHP module array, see docs.

MethodDescription
arrayCountBetweenAndCheck that the number of elements in an array or in a Countable object is in the given range.
arrayCountGreaterOrEqualCheck that the number of elements in an array or in a Countable object is greater than or equal to another.
arrayCountGreaterThanCheck that the number of elements in an array or in a Countable object is greater than another.
arrayCountIdenticalCheck that the number of elements in an array or in a Countable object is identical (===) to another.
arrayCountLessOrEqualCheck that the number of elements in an array or in a Countable object is less than or equal to another.
arrayCountLessThanCheck that the number of elements in an array or in a Countable object is less than another.
arrayIsListChecks whether a given array is a list.
arrayKeyExistsChecks if the given key or index exists in the array.
inArrayChecks if a value exists in an array.
notArrayCountBetweenAndEvaluates the inverse condition of the method static::arrayCountBetweenAnd.
notArrayCountGreaterOrEqualEvaluates the inverse condition of the method static::arrayCountGreaterOrEqual.
notArrayCountGreaterThanEvaluates the inverse condition of the method static::arrayCountGreaterThan.
notArrayCountIdenticalEvaluates the inverse condition of the method static::arrayCountIdentical.
notArrayCountLessOrEqualEvaluates the inverse condition of the method static::arrayCountLessOrEqual.
notArrayCountLessThanEvaluates the inverse condition of the method static::arrayCountLessThan.
notArrayIsListEvaluates the inverse condition of the method static::arrayIsList.
notArrayKeyExistsEvaluates the inverse condition of the method static::arrayKeyExists.
notInArrayEvaluates the inverse condition of the method static::inArray.

jf\assert\TAssert

Trait used to do validations and throw exceptions if they are not met.

MethodDescription
assertCheck if the assertion is met.
emptyCheck if value is empty.
isFalseVerify that the contents of a variable is FALSE.
isTrueVerify that the contents of a variable is TRUE.
notEmptyCheck if value is not empty.
notIsFalseVerify that the contents of a variable is not FALSE.
notIsTrueVerify that the contents of a variable is not TRUE.

jf\assert\TClassObj

Trait for assertions using functions from PHP module classobj, see docs.

MethodDescription
classAliasCreates an alias for a class.
classExistsChecks if the class has been defined.
enumExistsChecks if the enum has been defined.
interfaceExistsChecks if the interface has been defined.
isAChecks if the object is of this class or has this class as one of its parents.
isSubclassOfChecks if the object has this class as one of its parents or implements it.
methodExistsChecks if the class method exists.
notClassAliasEvaluates the inverse condition of the method static::classAlias.
notClassExistsEvaluates the inverse condition of the method static::classExists.
notEnumExistsEvaluates the inverse condition of the method static::enumExists.
notInterfaceExistsEvaluates the inverse condition of the method static::interfaceExists.
notIsAEvaluates the inverse condition of the method static::isA.
notIsSubclassOfEvaluates the inverse condition of the method static::isSubclassOf.
notMethodExistsEvaluates the inverse condition of the method static::methodExists.
notPropertyExistsEvaluates the inverse condition of the method static::propertyExists.
notTraitExistsEvaluates the inverse condition of the method static::traitExists.
propertyExistsChecks if the object or class has a property.
traitExistsChecks if the trait exists.

jf\assert\TCtype

Trait for assertions using functions from PHP module ctype, see docs.

MethodDescription
isAlnumCheck for alphanumeric character(s).
isAlphaCheck for alphabetic character(s).
isCntrlCheck for control character(s).
isDigitCheck for numeric character(s).
isGraphCheck for any printable character(s) except space.
isLowerCheck for lowercase character(s).
isPrintCheck for printable character(s).
isPunctCheck for any printable character which is not whitespace or an alphanumeric character.
isSpaceCheck for whitespace character(s).
isUpperCheck for uppercase character(s).
isXdigitCheck for character(s) representing a hexadecimal digit.
notIsAlnumEvaluates the inverse condition of the method static::isAlnum.
notIsAlphaEvaluates the inverse condition of the method static::isAlpha.
notIsCntrlEvaluates the inverse condition of the method static::isCntrl.
notIsDigitEvaluates the inverse condition of the method static::isDigit.
notIsGraphEvaluates the inverse condition of the method static::isGraph.
notIsLowerEvaluates the inverse condition of the method static::isLower.
notIsPrintEvaluates the inverse condition of the method static::isPrint.
notIsPunctEvaluates the inverse condition of the method static::isPunct.
notIsSpaceEvaluates the inverse condition of the method static::isSpace.
notIsUpperEvaluates the inverse condition of the method static::isUpper.
notIsXdigitEvaluates the inverse condition of the method static::isXdigit.

jf\assert\TFileSystem

Trait for assertions using functions from PHP module filesystem, see docs.

MethodDescription
chgrpChanges file group.
chmodChanges file mode.
chownChanges file owner.
copyCopies file.
fcloseCloses an open file pointer.
fdatasyncSynchronizes data (but not meta-data) to the file.
feofTests for end-of-file on a file pointer.
fflushFlushes the output to a file.
fileExistsChecks whether a file or directory exists.
flockPortable advisory file locking.
fnmatchMatch filename against a pattern.
fsyncSynchronizes changes to the file (including meta-data).
ftruncateTruncates a file to a given length.
isDirTells whether the filename is a directory.
isExecutableTells whether the filename is executable.
isFileTells whether the filename is a regular file.
isLinkTells whether the filename is a symbolic link.
isReadableTells whether a file exists and is readable.
isUploadedFileTells whether the file was uploaded via HTTP POST.
isWritableTells whether the filename is writable.
lchgrpChanges group ownership of symlink.
lchownChanges user ownership of symlink.
linkCreate a hard link.
mkdirMakes directory.
moveUploadedFileMoves an uploaded file to a new location.
notChgrpEvaluates the inverse condition of the method static::chgrp.
notChmodEvaluates the inverse condition of the method static::chmod.
notChownEvaluates the inverse condition of the method static::chown.
notCopyEvaluates the inverse condition of the method static::copy.
notFcloseEvaluates the inverse condition of the method static::fclose.
notFdatasyncEvaluates the inverse condition of the method static::fdatasync.
notFeofEvaluates the inverse condition of the method static::feof.
notFflushEvaluates the inverse condition of the method static::fflush.
notFileExistsEvaluates the inverse condition of the method static::fileExists.
notFlockEvaluates the inverse condition of the method static::flock.
notFnmatchEvaluates the inverse condition of the method static::fnmatch.
notFsyncEvaluates the inverse condition of the method static::fsync.
notFtruncateEvaluates the inverse condition of the method static::ftruncate.
notIsDirEvaluates the inverse condition of the method static::isDir.
notIsExecutableEvaluates the inverse condition of the method static::isExecutable.
notIsFileEvaluates the inverse condition of the method static::isFile.
notIsLinkEvaluates the inverse condition of the method static::isLink.
notIsReadableEvaluates the inverse condition of the method static::isReadable.
notIsUploadedFileEvaluates the inverse condition of the method static::isUploadedFile.
notIsWritableEvaluates the inverse condition of the method static::isWritable.
notLchgrpEvaluates the inverse condition of the method static::lchgrp.
notLchownEvaluates the inverse condition of the method static::lchown.
notLinkEvaluates the inverse condition of the method static::link.
notMkdirEvaluates the inverse condition of the method static::mkdir.
notMoveUploadedFileEvaluates the inverse condition of the method static::moveUploadedFile.
notRenameEvaluates the inverse condition of the method static::rename.
notRewindEvaluates the inverse condition of the method static::rewind.
notRmdirEvaluates the inverse condition of the method static::rmdir.
notSymlinkEvaluates the inverse condition of the method static::symlink.
notTouchEvaluates the inverse condition of the method static::touch.
notUnlinkEvaluates the inverse condition of the method static::unlink.
renameRenames a file or directory.
rewindRewind the position of a file pointer.
rmdirRemoves directory.
symlinkCreates a symbolic link.
touchSets access and modification time of file.
unlinkDeletes a file.

jf\assert\TFilter

Trait for assertions using functions from PHP module filter, see docs.

MethodDescription
filterHasVarChecks if variable of specified type exists.
filterValidateBoolReturns true for 1, true, on and yes. Returns false otherwise.
filterValidateDomainValidates whether the domain name label lengths are valid.
filterValidateEmailValidates whether the value is a valid e-mail address.
filterValidateFloatValidates value as float, optionally from the specified range, and converts to float on success.
filterValidateIntValidates value as integer, optionally from the specified range, and converts to int on success.
filterValidateIpValidates value as IP address, optionally only IPv4 or IPv6 or not from private or reserved ranges.
filterValidateMacValidates value as MAC address.
filterValidateRegexpValidates value against regexp, a Perl-compatible regular expression.
filterValidateUrlValidates value as URL (according to http://www.faqs.org/rfcs/rfc2396), optionally with required components.
filterVarFilters a variable with a specified filter.
notFilterHasVarEvaluates the inverse condition of the method static::filterHasVar.
notFilterValidateBoolEvaluates the inverse condition of the method static::filterValidateBool.
notFilterValidateDomainEvaluates the inverse condition of the method static::filterValidateDomain.
notFilterValidateEmailEvaluates the inverse condition of the method static::filterValidateEmail.
notFilterValidateFloatEvaluates the inverse condition of the method static::filterValidateFloat.
notFilterValidateIntEvaluates the inverse condition of the method static::filterValidateInt.
notFilterValidateIpEvaluates the inverse condition of the method static::filterValidateIp.
notFilterValidateMacEvaluates the inverse condition of the method static::filterValidateMac.
notFilterValidateRegexpEvaluates the inverse condition of the method static::filterValidateRegexp.
notFilterValidateUrlEvaluates the inverse condition of the method static::filterValidateUrl.
notFilterVarEvaluates the inverse condition of the method static::filterVar.

jf\assert\TFloat

Trait for comparisons between floats.

MethodDescription
floatBetweenAndCheck that a value of type float is in the given range.
floatGreaterOrEqualCheck that a value of type float is greater than or equal to another.
floatGreaterThanCheck that a value of type float is greater than another.
floatIdenticalCheck that a value of type float is identical (===) to another.
floatLessOrEqualCheck that a value of type float is less than or equal to another.
floatLessThanCheck that a value of type float is less than another.
notFloatBetweenAndEvaluates the inverse condition of the method static::floatBetweenAnd.
notFloatGreaterOrEqualEvaluates the inverse condition of the method static::floatGreaterOrEqual.
notFloatGreaterThanEvaluates the inverse condition of the method static::floatGreaterThan.
notFloatIdenticalEvaluates the inverse condition of the method static::floatIdentical.
notFloatLessOrEqualEvaluates the inverse condition of the method static::floatLessOrEqual.
notFloatLessThanEvaluates the inverse condition of the method static::floatLessThan.

jf\assert\TFuncHand

Trait for assertions using functions from PHP module funchand, see docs.

MethodDescription
functionExistsReturn true if the given function has been defined.
notFunctionExistsEvaluates the inverse condition of the method static::functionExists.

jf\assert\TInfo

Trait for assertions using functions from PHP module info, see docs.

MethodDescription
extensionLoadedFind out whether an extension is loaded.
notExtensionLoadedEvaluates the inverse condition of the method static::extensionLoaded.
notVersionCompareEvaluates the inverse condition of the method static::versionCompare.
versionCompareCompares two "PHP-standardized" version number strings.

jf\assert\TInteger

Trait for comparisons between integers.

MethodDescription
intBetweenAndCheck that a value of type int is in the given range.
intGreaterOrEqualCheck that a value of type int is greater than or equal to another.
intGreaterThanCheck that a value of type int is greater than another.
intIdenticalCheck that a value of type int is identical (===) to another.
intLessOrEqualCheck that a value of type int is less than or equal to another.
intLessThanCheck that a value of type int is less than another.
notIntBetweenAndEvaluates the inverse condition of the method static::intBetweenAnd.
notIntGreaterOrEqualEvaluates the inverse condition of the method static::intGreaterOrEqual.
notIntGreaterThanEvaluates the inverse condition of the method static::intGreaterThan.
notIntIdenticalEvaluates the inverse condition of the method static::intIdentical.
notIntLessOrEqualEvaluates the inverse condition of the method static::intLessOrEqual.
notIntLessThanEvaluates the inverse condition of the method static::intLessThan.

jf\assert\TLogical

Trait for logical comparisons between mixed types.

MethodDescription
betweenAndCheck that a value is in the given range.
equalCheck that a value is equal (==) to another.
greaterOrEqualCheck that a value is greater than or equal to another.
greaterThanCheck that a value is greater than another.
identicalCheck that a value is identical (===) to another.
lessOrEqualCheck that a value is less than or equal to another.
lessThanCheck that a value is less than another.
notBetweenAndEvaluates the inverse condition of the method static::betweenAnd.
notEqualEvaluates the inverse condition of the method static::equal.
notGreaterOrEqualEvaluates the inverse condition of the method static::greaterOrEqual.
notGreaterThanEvaluates the inverse condition of the method static::greaterThan.
notIdenticalEvaluates the inverse condition of the method static::identical.
notLessOrEqualEvaluates the inverse condition of the method static::lessOrEqual.
notLessThanEvaluates the inverse condition of the method static::lessThan.

jf\assert\TMath

Trait for assertions using functions from PHP module math, see docs.

MethodDescription
isFiniteFinds whether a value is a legal finite number.
isInfiniteFinds whether a value is infinite.
isNanFinds whether a value is not a number.
notIsFiniteEvaluates the inverse condition of the method static::isFinite.
notIsInfiniteEvaluates the inverse condition of the method static::isInfinite.
notIsNanEvaluates the inverse condition of the method static::isNan.

jf\assert\TStrings

Trait for assertions using functions from PHP module strings, see docs.

MethodDescription
notRegexEvaluates the inverse condition of the method static::regex.
notStrContainsEvaluates the inverse condition of the method static::strContains.
notStrEndsWithEvaluates the inverse condition of the method static::strEndsWith.
notStrLengthBetweenAndEvaluates the inverse condition of the method static::strLengthBetweenAnd.
notStrLengthGreaterOrEqualEvaluates the inverse condition of the method static::strLengthGreaterOrEqual.
notStrLengthGreaterThanEvaluates the inverse condition of the method static::strLengthGreaterThan.
notStrLengthIdenticalEvaluates the inverse condition of the method static::strLengthIdentical.
notStrLengthLessOrEqualEvaluates the inverse condition of the method static::strLengthLessOrEqual.
notStrLengthLessThanEvaluates the inverse condition of the method static::strLengthLessThan.
notStrStartsWithEvaluates the inverse condition of the method static::strStartsWith.
regexCheck that a string matches a regular expression.
strContainsDetermine if a string contains a given substring.
strEndsWithChecks if a string ends with a given substring.
strLengthBetweenAndCheck that the length of string is in the given range.
strLengthGreaterOrEqualCheck that the length of string is greater than or equal to another.
strLengthGreaterThanCheck that the length of string is greater than another.
strLengthIdenticalCheck that the length of string is identical (===) to another.
strLengthLessOrEqualCheck that the length of string is less than or equal to another.
strLengthLessThanCheck that the length of string is less than another.
strStartsWithChecks if a string starts with a given substring.

jf\assert\TVar

Trait for assertions using functions from PHP module var, see docs.

MethodDescription
isArrayFinds whether a variable is an array.
isBoolFinds out whether a variable is a boolean.
isCallableVerify that a value can be called as a function from the current scope.
isCountableVerify that the contents of a variable is a countable value.
isFloatFinds whether the type of a variable is float.
isInstanceOfCheck that a value is an instance of specified class.
isIntFind whether the type of a variable is integer.
isIterableVerify that the contents of a variable is an iterable value.
isNullFinds whether a variable is null.
isNumericFinds whether a variable is a number or a numeric string.
isObjectFinds whether a variable is an object.
isResourceFinds whether a variable is a resource.
isScalarFinds whether a variable is a scalar.
isStringFind whether the type of a variable is string.
isTraversableCheck that a value is an array or an instance of \Traversable.
notIsArrayEvaluates the inverse condition of the method static::isArray.
notIsBoolEvaluates the inverse condition of the method static::isBool.
notIsCallableEvaluates the inverse condition of the method static::isCallable.
notIsCountableEvaluates the inverse condition of the method static::isCountable.
notIsFloatEvaluates the inverse condition of the method static::isFloat.
notIsInstanceOfEvaluates the inverse condition of the method static::isInstanceOf.
notIsIntEvaluates the inverse condition of the method static::isInt.
notIsIterableEvaluates the inverse condition of the method static::isIterable.
notIsNullEvaluates the inverse condition of the method static::isNull.
notIsNumericEvaluates the inverse condition of the method static::isNumeric.
notIsObjectEvaluates the inverse condition of the method static::isObject.
notIsResourceEvaluates the inverse condition of the method static::isResource.
notIsScalarEvaluates the inverse condition of the method static::isScalar.
notIsStringEvaluates the inverse condition of the method static::isString.
notIsTraversableEvaluates the inverse condition of the method static::isTraversable.