public static function fromRepository($repository)
    {
        $message = sprintf(
            'Could not add invalid OptionRepository of type "%1$s" to AggregateOptionRepository.',
            is_object($repository)
                ? get_class($repository)
                : gettype($repository)
        );

        return new static($message);
    }
public static function fromRepository($repository)
    {
        $message = sprintf(
            'Could not add invalid OptionRepository of type "%1$s" to AggregateOptionRepository.',
            is_object($repository)
                ? get_class($repository)
                : gettype($repository)
        );

        return new static($message);
    }
public static function fromRepository ( $ repository ) { $ message = sprintf ( 'Could not add invalid OptionRepository of type "%1$s" to AggregateOptionRepository.' , is_object ( $ repository ) ? get_class ( $ repository ) : gettype ( $ repository ) ) ; return new static ( $ message ) ; }
Get a new exception based on the type of an invalid repository.

@since 0.1.0

@param mixed $repository Repository that was tried to be added.

@return static
Get a new exception based on the type of an invalid repository .