public function getFlagsOfType($type)
    {
        if ($this->flags === null) {
            return [];
        }

        $matches = [];

        foreach ($this->flags as $flag) {
            if ($flag->type == $type) {
                $matches []= $flag;
            }
        }

        return $matches;
    }