Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| AbstractParser | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| getFile | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getData | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| parse | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| 1 | <?php |
| 2 | declare(strict_types=1); |
| 3 | /** |
| 4 | * Pop PHP Framework (https://www.popphp.org/) |
| 5 | * |
| 6 | * @link https://github.com/popphp/popphp-framework |
| 7 | * @author Nick Sagona, III <nick@popphp.org> |
| 8 | * @copyright Copyright (c) 2009-2026 Nick Sagona, III |
| 9 | * @license https://www.popphp.org/license New BSD License |
| 10 | */ |
| 11 | |
| 12 | /** |
| 13 | * @namespace |
| 14 | */ |
| 15 | namespace Pop\Pdf\Build; |
| 16 | |
| 17 | use Pop\Pdf\Document\AbstractDocument; |
| 18 | |
| 19 | /** |
| 20 | * Abstract Pdf parser class |
| 21 | * |
| 22 | * @category Pop |
| 23 | * @package Pop\Pdf |
| 24 | * @author Nick Sagona, III <nick@popphp.org> |
| 25 | * @copyright Copyright (c) 2009-2026 Nick Sagona, III |
| 26 | * @license https://www.popphp.org/license New BSD License |
| 27 | * @version 6.0.0 |
| 28 | */ |
| 29 | abstract class AbstractParser implements ParserInterface |
| 30 | { |
| 31 | |
| 32 | /** |
| 33 | * Imported PDF file |
| 34 | * @var ?string |
| 35 | */ |
| 36 | protected ?string $file = null; |
| 37 | |
| 38 | /** |
| 39 | * Imported PDF data stream |
| 40 | * @var ?string |
| 41 | */ |
| 42 | protected ?string $data = null; |
| 43 | |
| 44 | /** |
| 45 | * Get the file |
| 46 | * |
| 47 | * @return string |
| 48 | */ |
| 49 | public function getFile(): string |
| 50 | { |
| 51 | return $this->file; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Get the data stream |
| 56 | * |
| 57 | * @return string |
| 58 | */ |
| 59 | public function getData(): string |
| 60 | { |
| 61 | return $this->data; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Parse the PDF data |
| 66 | * |
| 67 | * @param mixed $pages |
| 68 | * @return AbstractDocument |
| 69 | */ |
| 70 | abstract public function parse(mixed $pages = null): AbstractDocument; |
| 71 | |
| 72 | } |