protected function maybeInstantiateFindable($findable, $arguments = null): Findable
    {
        if (is_string($findable)) {
            $findable = $this->instantiateFindableFromString($findable, $arguments);
        }

        if (is_callable($findable)) {
            $findable = $this->instantiateFindableFromCallable($findable, $arguments);
        }

        if (! $findable instanceof Findable) {
            throw new FailedToInstantiateFindable(
                sprintf(
                    _('Could not instantiate Findable "%s".'),
                    serialize($findable)
                )
            );
        }

        return $findable;
    }
protected function maybeInstantiateFindable($findable, $arguments = null): Findable
    {
        if (is_string($findable)) {
            $findable = $this->instantiateFindableFromString($findable, $arguments);
        }

        if (is_callable($findable)) {
            $findable = $this->instantiateFindableFromCallable($findable, $arguments);
        }

        if (! $findable instanceof Findable) {
            throw new FailedToInstantiateFindable(
                sprintf(
                    _('Could not instantiate Findable "%s".'),
                    serialize($findable)
                )
            );
        }

        return $findable;
    }
protected function maybeInstantiateFindable ( $ findable , $ arguments = null ) : Findable { if ( is_string ( $ findable ) ) { $ findable = $ this -> instantiateFindableFromString ( $ findable , $ arguments ) ; } if ( is_callable ( $ findable ) ) { $ findable = $ this -> instantiateFindableFromCallable ( $ findable , $ arguments ) ; } if ( ! $ findable instanceof Findable ) { throw new FailedToInstantiateFindable ( sprintf ( _ ( 'Could not instantiate Findable "%s".' ) , serialize ( $ findable ) ) ) ; } return $ findable ; }
Maybe instantiate a Findable if it is not yet an object.

@since 0.1.1

@param mixed $findable  Findable to instantiate.
@param mixed $arguments Optional. Arguments to use.

@return Findable Instantiated findable.
@throws FailedToInstantiateFindable If the findable could not be instantiated.
Maybe instantiate a Findable if it is not yet an object .