private function parseVisibility(string $path, string $visibility = null): ?int
    {
        $type = '';

        if (\is_file($path)) {
            $type = 'file';
        } elseif (\is_dir($path)) {
            $type = 'dir';
        }

        if ($visibility === null || $type === '') {
            return null;
        }

        if ($visibility === FilesystemContract::VISIBILITY_PUBLIC) {
            return $this->permissions[$type]['public'];
        }

        if ($visibility === FilesystemContract::VISIBILITY_PRIVATE) {
            return $this->permissions[$type]['private'];
        }

        throw new InvalidArgumentException('Unknown visibility: ' . $visibility);
    }
private function parseVisibility(string $path, string $visibility = null): ?int
    {
        $type = '';

        if (\is_file($path)) {
            $type = 'file';
        } elseif (\is_dir($path)) {
            $type = 'dir';
        }

        if ($visibility === null || $type === '') {
            return null;
        }

        if ($visibility === FilesystemContract::VISIBILITY_PUBLIC) {
            return $this->permissions[$type]['public'];
        }

        if ($visibility === FilesystemContract::VISIBILITY_PRIVATE) {
            return $this->permissions[$type]['private'];
        }

        throw new InvalidArgumentException('Unknown visibility: ' . $visibility);
    }
private function parseVisibility ( string $ path , string $ visibility = null ) : ? int { $ type = '' ; if ( \ is_file ( $ path ) ) { $ type = 'file' ; } elseif ( \ is_dir ( $ path ) ) { $ type = 'dir' ; } if ( $ visibility === null || $ type === '' ) { return null ; } if ( $ visibility === FilesystemContract :: VISIBILITY_PUBLIC ) { return $ this -> permissions [ $ type ] [ 'public' ] ; } if ( $ visibility === FilesystemContract :: VISIBILITY_PRIVATE ) { return $ this -> permissions [ $ type ] [ 'private' ] ; } throw new InvalidArgumentException ( 'Unknown visibility: ' . $ visibility ) ; }
Parse the given visibility value.

@param string      $path
@param null|string $visibility

@throws \Viserio\Component\Contract\Filesystem\Exception\InvalidArgumentException

@return null|int
Parse the given visibility value .