Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
CeilingVersionException
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\Pdf\Core\File;
6
7use Phpdftk\Pdf\Core\PdfVersion;
8
9/**
10 * Thrown when ceiling version mode is active and an object's class-level
11 * version requirement exceeds the ceiling. Property-level incompatibilities
12 * are stripped silently; class-level ones cannot be.
13 */
14class CeilingVersionException extends \RuntimeException
15{
16    public function __construct(
17        public readonly string $objectClass,
18        public readonly PdfVersion $requiredVersion,
19        public readonly PdfVersion $ceilingVersion,
20    ) {
21        parent::__construct(sprintf(
22            '%s requires PDF %s, which exceeds the ceiling version %s. '
23            . 'This object cannot be included — remove it or raise the ceiling.',
24            $objectClass,
25            $requiredVersion->value,
26            $ceilingVersion->value,
27        ));
28    }
29}