aboutsummaryrefslogtreecommitdiff
path: root/Psso/Context.php
blob: ed1e6f9e582b0f3a509a420d8990ee28ae2b1898 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
namespace Psso;

class Context {
    public protected(set) array $results = [];
    public ?string $user = null;
    public array $groups = [];
    public protected(set) array $tags = [];
    public array $extras = [];

    public function addResult(ChallengeResult $result): void {
        $this->results[] = $result;
    }

    public function setTag(string $tag): void {
        if (!$this->hasTag($tag)) $this->tags[] = $tag;
    }

    public function hasTag(string $tag): bool {
        return in_array($tag, $this->tags);
    }
}