Passed
Pull Request — master (#686)
by Vitor
04:21
created

FieldDefinition   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 1
dl 0
loc 20
ccs 1
cts 1
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 19 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7
 * SPDX-License-Identifier: AGPL-3.0-or-later
8
 */
9
10
namespace OCA\TwoFactorGateway\Provider;
11
12
class FieldDefinition {
13 6
	public function __construct(
14
		/**
15
		 * The key that will store the value into database. Mandatory to have this item.
16
		 */
17
		public string $field,
18
		/**
19
		 * The label that will be displayed. Mandatory
20
		 */
21
		public string $prompt,
22
		/**
23
		 * The default value when the value isn't provided.
24
		 * Not mandatory to have this item
25
		 */
26
		public string $default = '',
27
		/**
28
		 * Default: false. Not mandatory to have this item
29
		 */
30
		public bool $optional = false,
31
	) {
32 6
	}
33
}
34