Skip to content

NoDefaultValue ​

Rasuvaeff\Understudy\Exception\NoDefaultValue

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

Extends: RuntimeException

Implements: Throwable, Stringable, Exception\UnderstudyError

A loose understudy had to answer a call, but the declared return type has no safe default. Understudy never invents one by calling an arbitrary constructor and never hands back an uninitialised object.

Methods ​

forReturnType() ​

php
static forReturnType(
    non-empty-string $label,
    non-empty-string $method,
    string $type,
): self

Builds the error for a return type with no safe default.