trait ConstraintImplementationTrait

internal  This trait is not covered by the backward compatibility promise
 

Implementation of an inheritance constraint class.

The trait expects the following static attributes to be defined::

private static $verb; // for example $verb = 'extends class'; private static $negatedVerb; // for example $negatedVerb = 'does not extend class'; private static $validation; // for example $validation = ['class_exists', 'a class-string']; private static $inheritance; // for example $validation = 'class_parents'; private static $supports; // for example $supports = ['class_exists'];

Methods

create(string $expected)

No description

string
verb()

Returns short description of what we examine, e.g. 'impements interface'.

string
negatedVerb()

Returns short negated description of what we examine, e.g. 'does not impement interface'.

array
inheritance(string $class)

No description

bool
supports(string $subject)

Checks if $subject may be used as an argument to inheritance().

Details

at line 39
static ConstraintImplementationTrait create(string $expected)

No description

Parameters

string $expected

Return Value

ConstraintImplementationTrait

Exceptions

InvalidArgumentException

at line 49
protected string verb()

Returns short description of what we examine, e.g. 'impements interface'.

Return Value

string

at line 57
protected string negatedVerb()

Returns short negated description of what we examine, e.g. 'does not impement interface'.

Return Value

string

at line 67
protected array inheritance(string $class)

No description

Parameters

string $class

Return Value

array

Exceptions

InvalidReturnValueException

at line 78
protected bool supports(string $subject)

Checks if $subject may be used as an argument to inheritance().

Parameters

string $subject

Return Value

bool