Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
RequireSignRequestUuid
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 skipIfAuthenticated
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 redirectIfSignedToValidation
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 allowIdDocs
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: 2020-2024 LibreCode coop and contributors
6 * SPDX-License-Identifier: AGPL-3.0-or-later
7 */
8
9namespace OCA\Libresign\Middleware\Attribute;
10
11use Attribute;
12
13#[Attribute(Attribute::TARGET_METHOD)]
14class RequireSignRequestUuid {
15    public function __construct(
16        protected bool $skipIfAuthenticated = false,
17        protected bool $redirectIfSignedToValidation = false,
18        protected bool $allowIdDocs = false,
19    ) {
20    }
21
22    public function skipIfAuthenticated(): bool {
23        return $this->skipIfAuthenticated;
24    }
25
26    public function redirectIfSignedToValidation(): bool {
27        return $this->redirectIfSignedToValidation;
28    }
29
30    public function allowIdDocs(): bool {
31        return $this->allowIdDocs;
32    }
33}