Skip to content

CannotWire ​

Rasuvaeff\Understudy\Exception\CannotWire

Class — Package: rasuvaeff/understudy — Source — Version: v1.1.0-1-g6ed023f

Extends: InvalidArgumentException

Implements: Stringable, Throwable, Exception\UnderstudyError

wire() cannot build the subject, or cannot decide what to pass it.

Methods ​

notAConcreteClass() ​

php
static notAConcreteClass(string $sut, string $reason): self

Builds the error for a subject that cannot be wired as a concrete class.

Takes a plain string, not a class-string: "there is no such class" is one of the reasons it reports.

inaccessibleConstructor() ​

php
static inaccessibleConstructor(class-string $sut, string $visibility): self

Builds the error for an inaccessible subject constructor.

unknownOverride() ​

php
static unknownOverride(
    class-string $sut,
    string $name,
    string $known,
): self

Builds the error for an unknown constructor override.

incompatibleOverride() ​

php
static incompatibleOverride(
    class-string $sut,
    string $name,
    string $expected,
    string $given,
): self

Builds the error for an override with an incompatible type.

undecidableParameter() ​

php
static undecidableParameter(
    class-string $sut,
    string $name,
    string $type,
    string $reason,
): self

Builds the error for a constructor parameter with no safe answer.

referenceParameter() ​

php
static referenceParameter(class-string $sut, string $name): self

Builds the error for a by-reference constructor parameter.