public static function castFrom($value): InputStream
    {
        if ($value instanceof InputStream) {
            return $value;
        }

        if (is_string($value)) {
            return new self($value);
        }

        throw new \InvalidArgumentException(
                'Given value is neither an instance of' . InputStream::class
                . ' nor a string denoting a file'
        );
    }
public static function castFrom($value): InputStream
    {
        if ($value instanceof InputStream) {
            return $value;
        }

        if (is_string($value)) {
            return new self($value);
        }

        throw new \InvalidArgumentException(
                'Given value is neither an instance of' . InputStream::class
                . ' nor a string denoting a file'
        );
    }
public static function castFrom ( $ value ) : InputStream { if ( $ value instanceof InputStream ) { return $ value ; } if ( is_string ( $ value ) ) { return new self ( $ value ) ; } throw new \ InvalidArgumentException ( 'Given value is neither an instance of' . InputStream :: class . ' nor a string denoting a file' ) ; }
casts given value to an input stream

@param   \stubbles\streams\InputStream|string  $value
@return  \stubbles\streams\InputStream
@throws  \InvalidArgumentException
@since   5.2.0
casts given value to an input stream