public static function fromDirectory(string $directory): self
    {
        $exception = new self(\sprintf(
            'Directory "%s" does not exist.',
            $directory
        ));

        $exception->directory = $directory;

        return $exception;
    }
public static function fromDirectory(string $directory): self
    {
        $exception = new self(\sprintf(
            'Directory "%s" does not exist.',
            $directory
        ));

        $exception->directory = $directory;

        return $exception;
    }
public static function fromDirectory ( string $ directory ) : self { $ exception = new self ( \ sprintf ( 'Directory "%s" does not exist.' , $ directory ) ) ; $ exception -> directory = $ directory ; return $ exception ; }
Returns a new exception from a directory.

@param string $directory

@return self
Returns a new exception from a directory .