Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| DeprecatedPdfFeature | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Pdf\Core; |
| 6 | |
| 7 | /** |
| 8 | * Marks a PDF object class or property as deprecated in the PDF specification. |
| 9 | * |
| 10 | * When {@see $removedIn} is set, strict deprecation mode and ceiling mode |
| 11 | * will reject the feature at or above that version. |
| 12 | */ |
| 13 | #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY)] |
| 14 | final class DeprecatedPdfFeature |
| 15 | { |
| 16 | public readonly ?PdfVersion $removedInVersion; |
| 17 | |
| 18 | public function __construct( |
| 19 | public readonly string $since, |
| 20 | public readonly ?string $replacement = null, |
| 21 | public readonly ?string $removedIn = null, |
| 22 | ) { |
| 23 | $this->removedInVersion = $removedIn !== null |
| 24 | ? PdfVersion::from($removedIn) |
| 25 | : null; |
| 26 | } |
| 27 | } |