FtpClient\FtpClient::rawToType PHP Method

rawToType() public method

..) to type (file, directory, link, unknown). Only the first char is used for resolving.
public rawToType ( string $permission ) : string
$permission string Example : drwx---r-x
return string The file type (file, directory, link, unknown)
    public function rawToType($permission)
    {
        if (!is_string($permission)) {
            throw new FtpException('The "$permission" argument must be a string, "' . gettype($permission) . '" given.');
        }
        if (empty($permission[0])) {
            return 'unknown';
        }
        switch ($permission[0]) {
            case '-':
                return 'file';
            case 'd':
                return 'directory';
            case 'l':
                return 'link';
            default:
                return 'unknown';
        }
    }