Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| PdfReference | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toPdf | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Pdf\Core; |
| 6 | |
| 7 | /** |
| 8 | * Represents an indirect reference to another PDF object: X 0 R |
| 9 | */ |
| 10 | class PdfReference implements Serializable |
| 11 | { |
| 12 | public function __construct( |
| 13 | public readonly int $objectNumber, |
| 14 | public readonly int $generationNumber = 0, |
| 15 | ) {} |
| 16 | |
| 17 | public function toPdf(): string |
| 18 | { |
| 19 | return sprintf('%d %d R', $this->objectNumber, $this->generationNumber); |
| 20 | } |
| 21 | } |