protected function validateDirectory($directory, $writable = false)
    {
        if (!is_dir($directory)) {
            throw new \InvalidArgumentException(sprintf('Directory not found: %s', $directory));
        } elseif (!is_readable($directory)) {
            throw new \InvalidArgumentException(sprintf('Directory not readable: %s', $directory));
        } elseif ($writable && !is_writable($directory)) {
            throw new \InvalidArgumentException(sprintf('Directory not writable: %s', $directory));
        }
    }
protected function validateDirectory($directory, $writable = false)
    {
        if (!is_dir($directory)) {
            throw new \InvalidArgumentException(sprintf('Directory not found: %s', $directory));
        } elseif (!is_readable($directory)) {
            throw new \InvalidArgumentException(sprintf('Directory not readable: %s', $directory));
        } elseif ($writable && !is_writable($directory)) {
            throw new \InvalidArgumentException(sprintf('Directory not writable: %s', $directory));
        }
    }
protected function validateDirectory ( $ directory , $ writable = false ) { if ( ! is_dir ( $ directory ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Directory not found: %s' , $ directory ) ) ; } elseif ( ! is_readable ( $ directory ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Directory not readable: %s' , $ directory ) ) ; } elseif ( $ writable && ! is_writable ( $ directory ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Directory not writable: %s' , $ directory ) ) ; } }
Validate a directory argument.

@param string $directory
@param bool   $writable
Validate a directory argument .