Documentation

predicates.php

This file is part of the Parsica library.

Copyright (c) 2020 Mathias Verraes mathias@verraes.net

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

Table of Contents

Functions

isEqual()  : callable
Creates an equality predicate
notPred()  : callable
Negates a predicate.
andPred()  : callable
Boolean And predicate.
orPred()  : callable
Boolean Or predicate.
isCharCode()  : callable
Predicate that checks if a character is in an array of character codes.
isSpace()  : callable
Returns true for a space character, and the control characters \t, \n, \r, \f, \v.
isHSpace()  : callable
Like 'isSpace', but does not accept newlines and carriage returns.
isDigit()  : callable
True for 0-9
isControl()  : callable
Control character predicate (a non-printing character of the Latin-1 subset of Unicode).
isBlank()  : callable
Returns true for a space or a tab character
isWhitespace()  : callable
Returns true for a space character, and \t, \n, \r, \f, \v.
isUpper()  : callable
Returns true for an uppercase character A-Z.
isLower()  : mixed
Returns true for a lowercase character a-z.
isAlpha()  : callable
Returns true for an uppercase or lowercase character A-Z, a-z.
isAlphaNum()  : callable
Returns true for an alpha or numeric character A-Z, a-z, 0-9.
isHexDigit()  : callable
Returns true if the given character is a hexadecimal numeric character 0123456789abcdefABCDEF.
isPrintable()  : callable
Returns true if the given character is a printable ASCII char.
isPunctuation()  : callable
Returns true if the given character is a punctuation character !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

Functions

isEqual()

Creates an equality predicate

isEqual(string $x) : callable
Parameters
$x : string
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

notPred()

Negates a predicate.

notPred(callable $predicate) : callable
Parameters
$predicate : callable
Tags
psalm-param

pure-callable(string) : bool $predicate

psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

andPred()

Boolean And predicate.

andPred(callable $first, callable $second) : callable
Parameters
$first : callable
$second : callable
Tags
psalm-param

pure-callable(string) : bool $first

psalm-param

pure-callable(string) : bool $second

psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

orPred()

Boolean Or predicate.

orPred(callable $first, callable $second) : callable
Parameters
$first : callable
$second : callable
Tags
psalm-param

pure-callable(string) : bool $first

psalm-param

pure-callable(string) : bool $second

psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isSpace()

Returns true for a space character, and the control characters \t, \n, \r, \f, \v.

isSpace() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isHSpace()

Like 'isSpace', but does not accept newlines and carriage returns.

isHSpace() : callable
Tags
psalm-return

pure-callable(string) : bool

see
isSpace
psalm-pure
Return values
callable

isDigit()

True for 0-9

isDigit() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isControl()

Control character predicate (a non-printing character of the Latin-1 subset of Unicode).

isControl() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isBlank()

Returns true for a space or a tab character

isBlank() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isWhitespace()

Returns true for a space character, and \t, \n, \r, \f, \v.

isWhitespace() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isUpper()

Returns true for an uppercase character A-Z.

isUpper() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isLower()

Returns true for a lowercase character a-z.

isLower() : mixed
Tags
psalm-return

pure-callable(string) : bool

psalm-pure

isAlpha()

Returns true for an uppercase or lowercase character A-Z, a-z.

isAlpha() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isAlphaNum()

Returns true for an alpha or numeric character A-Z, a-z, 0-9.

isAlphaNum() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isHexDigit()

Returns true if the given character is a hexadecimal numeric character 0123456789abcdefABCDEF.

isHexDigit() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isPrintable()

Returns true if the given character is a printable ASCII char.

isPrintable() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

isPunctuation()

Returns true if the given character is a punctuation character !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

isPunctuation() : callable
Tags
psalm-return

pure-callable(string) : bool

psalm-pure
Return values
callable

        
On this page

Search results