Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
ChoiceFieldOptions
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
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
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\Pdf\Writer\Form;
6
7/**
8 * Options for {@see \Phpdftk\Pdf\Writer\PdfDoc::addChoiceField()}.
9 *
10 * `$choices` is a list of `[value, displayLabel]` pairs (or plain
11 * strings, in which case the same value is used for both). `combo`
12 * controls whether the field renders as a drop-down combo box (true)
13 * or a scrolling list box (false).
14 */
15final class ChoiceFieldOptions
16{
17    /**
18     * @param list<string|array{0:string,1:string}> $choices
19     */
20    public function __construct(
21        public readonly array $choices,
22        public readonly ?string $defaultValue = null,
23        public readonly bool $combo = true,
24        public readonly bool $editable = false,
25        public readonly bool $sort = false,
26        public readonly bool $multiSelect = false,
27        public readonly bool $required = false,
28        public readonly bool $readOnly = false,
29    ) {}
30}