Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| FieldInfo | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Pdf\Toolkit\Form; |
| 6 | |
| 7 | /** |
| 8 | * Read-only snapshot of a form field's properties. |
| 9 | */ |
| 10 | final readonly class FieldInfo |
| 11 | { |
| 12 | /** |
| 13 | * @param string $name Fully qualified field name (dot-separated for hierarchical fields) |
| 14 | * @param FieldType $type Field type (Text, Button, Choice, Signature) |
| 15 | * @param string|null $value Current value as string, or null if unset |
| 16 | * @param int $flags Field flags (/Ff) |
| 17 | * @param float[]|null $rect Widget rectangle [x1, y1, x2, y2], or null if no widget |
| 18 | * @param int|null $maxLen Maximum length for text fields |
| 19 | * @param string[]|null $options Available options for choice fields |
| 20 | */ |
| 21 | public function __construct( |
| 22 | public string $name, |
| 23 | public FieldType $type, |
| 24 | public ?string $value = null, |
| 25 | public int $flags = 0, |
| 26 | public ?array $rect = null, |
| 27 | public ?int $maxLen = null, |
| 28 | public ?array $options = null, |
| 29 | ) {} |
| 30 | } |