Documentation

ArrayCountToken
in package
implements TokenInterface

Array elements count token.

Tags
author

Boris Mikhaylov kaguxmail@gmail.com

Interfaces, Classes and Traits

TokenInterface
Argument token interface.

Table of Contents

$count  : mixed
__construct()  : mixed
__toString()  : string
Returns string representation for token.
isLast()  : bool
Returns false.
scoreArgument()  : bool|int
Scores 6 when argument has preset number of elements.
hasProperCount()  : bool
Returns true if $argument has expected number of elements
isCountable()  : bool
Returns true if object is either array or instance of \Countable

Properties

Methods

__construct()

public __construct(int $value) : mixed
Parameters
$value : int
Return values
mixed

__toString()

Returns string representation for token.

public __toString() : string
Return values
string

isLast()

Returns false.

public isLast() : bool
Return values
bool

scoreArgument()

Scores 6 when argument has preset number of elements.

public scoreArgument( $argument) : bool|int
Parameters
$argument :
Return values
bool|int

hasProperCount()

Returns true if $argument has expected number of elements

private hasProperCount(array<string|int, mixed>|Countable $argument) : bool
Parameters
$argument : array<string|int, mixed>|Countable
Return values
bool

isCountable()

Returns true if object is either array or instance of \Countable

private isCountable( $argument) : bool
Parameters
$argument :
Return values
bool

Search results