Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
21 / 21
100.00% covered (success)
100.00%
14 / 14
CRAP
100.00% covered (success)
100.00%
1 / 1
PolicyLayer
100.00% covered (success)
100.00%
21 / 21
100.00% covered (success)
100.00%
14 / 14
14
100.00% covered (success)
100.00%
1 / 1
 setScope
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getScope
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setValue
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getValue
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAllowChildOverride
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 isAllowChildOverride
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setVisibleToChild
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 isVisibleToChild
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAllowedValues
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getAllowedValues
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setCreatedBySystemAdmin
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 isCreatedBySystemAdmin
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setDelegatedFromSystemCreatedSeed
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 isDelegatedFromSystemCreatedSeed
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4/**
5 * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
6 * SPDX-License-Identifier: AGPL-3.0-or-later
7 */
8
9namespace OCA\Libresign\Service\Policy\Model;
10
11final class PolicyLayer {
12    private string $scope = '';
13    private mixed $value = null;
14    private bool $allowChildOverride = false;
15    private bool $visibleToChild = true;
16    /** @var list<mixed> */
17    private array $allowedValues = [];
18    private bool $createdBySystemAdmin = false;
19    private bool $delegatedFromSystemCreatedSeed = false;
20
21    public function setScope(string $scope): self {
22        $this->scope = $scope;
23        return $this;
24    }
25
26    public function getScope(): string {
27        return $this->scope;
28    }
29
30    public function setValue(mixed $value): self {
31        $this->value = $value;
32        return $this;
33    }
34
35    public function getValue(): mixed {
36        return $this->value;
37    }
38
39    public function setAllowChildOverride(bool $allowChildOverride): self {
40        $this->allowChildOverride = $allowChildOverride;
41        return $this;
42    }
43
44    public function isAllowChildOverride(): bool {
45        return $this->allowChildOverride;
46    }
47
48    public function setVisibleToChild(bool $visibleToChild): self {
49        $this->visibleToChild = $visibleToChild;
50        return $this;
51    }
52
53    public function isVisibleToChild(): bool {
54        return $this->visibleToChild;
55    }
56
57    /** @param list<mixed> $allowedValues */
58    public function setAllowedValues(array $allowedValues): self {
59        $this->allowedValues = $allowedValues;
60        return $this;
61    }
62
63    /** @return list<mixed> */
64    public function getAllowedValues(): array {
65        return $this->allowedValues;
66    }
67
68    public function setCreatedBySystemAdmin(bool $value): self {
69        $this->createdBySystemAdmin = $value;
70        return $this;
71    }
72
73    public function isCreatedBySystemAdmin(): bool {
74        return $this->createdBySystemAdmin;
75    }
76
77    public function setDelegatedFromSystemCreatedSeed(bool $value): self {
78        $this->delegatedFromSystemCreatedSeed = $value;
79        return $this;
80    }
81
82    public function isDelegatedFromSystemCreatedSeed(): bool {
83        return $this->delegatedFromSystemCreatedSeed;
84    }
85}