public function hasFlags(array $flags, bool $matchAll = false) : bool
    {
        $matched = false;
        $userFlags = $this->getUserFlags();

        foreach ($flags as $flag) {
            if (in_array($flag, $userFlags)) {
                if ($matchAll) {
                    $matched = true;
                    continue;
                }

                $matched = true;
            } else {
                if ($matchAll) {
                    return false;
                }

                $matched = false;
            }
        }

        return $matched;
    }
public function hasFlags(array $flags, bool $matchAll = false) : bool
    {
        $matched = false;
        $userFlags = $this->getUserFlags();

        foreach ($flags as $flag) {
            if (in_array($flag, $userFlags)) {
                if ($matchAll) {
                    $matched = true;
                    continue;
                }

                $matched = true;
            } else {
                if ($matchAll) {
                    return false;
                }

                $matched = false;
            }
        }

        return $matched;
    }
public function hasFlags ( array $ flags , bool $ matchAll = false ) : bool { $ matched = false ; $ userFlags = $ this -> getUserFlags ( ) ; foreach ( $ flags as $ flag ) { if ( in_array ( $ flag , $ userFlags ) ) { if ( $ matchAll ) { $ matched = true ; continue ; } $ matched = true ; } else { if ( $ matchAll ) { return false ; } $ matched = false ; } } return $ matched ; }
Check if user has flags

@param array $flags
@param bool  $matchAll
@return bool
Check if user has flags