Skip to content

Commit

Permalink
Define PageInputData type.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Aug 26, 2024
1 parent 40b4e70 commit 6c9bf07
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 71 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.0
4.1.1
71 changes: 71 additions & 0 deletions src/Box.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,77 @@
* 'width': float,
* 'zoom': float,
* }
*
* @phpstan-type PageInputData array{
* 'annotrefs'?: array<int,int>,
* 'autobreak'?: bool,
* 'box'?: array<string, array{
* 'llx'?: float,
* 'lly'?: float,
* 'urx'?: float,
* 'ury'?: float,
* 'bci'?: array{
* 'color'?: string,
* 'width'?: float,
* 'style'?: string,
* 'dash'?: array<int>,
* },
* }>,
* 'columns'?: int,
* 'content'?: array<string>,
* 'content_mark'?: array<int>,
* 'ContentHeight'?: float,
* 'ContentWidth'?: float,
* 'FooterHeight'?: float,
* 'HeaderHeight'?: float,
* 'currentRegion'?: int,
* 'format'?: string,
* 'group'?: int,
* 'height'?: float,
* 'margin'?: array{
* 'CB'?: float,
* 'CT'?: float,
* 'FT'?: float,
* 'HB'?: float,
* 'PB'?: float,
* 'PL'?: float,
* 'PR'?: float,
* 'PT'?: float,
* },
* 'n'?: int,
* 'num'?: int,
* 'orientation'?: string,
* 'pagenum'?: int,
* 'pheight'?: float,
* 'pid'?: int,
* 'pwidth'?: float,
* 'region'?: array<int, array{
* 'RB'?: float,
* 'RH'?: float,
* 'RL'?: float,
* 'RR'?: float,
* 'RT'?: float,
* 'RW'?: float,
* 'RX'?: float,
* 'RY'?: float,
* 'x' ?: float,
* 'y' ?: float,
* }>,
* 'rotation'?: int,
* 'time'?: int,
* 'transition'?: array{
* 'B'?: bool,
* 'D'?: int,
* 'Di'?: string|int,
* 'Dm'?: string,
* 'Dur'?: float,
* 'M'?: string,
* 'S'?: string,
* 'SS'?: float,
* },
* 'width'?: float,
* 'zoom'?: float,
* }
*/
abstract class Box extends \Com\Tecnick\Pdf\Page\Mode
{
Expand Down
72 changes: 2 additions & 70 deletions src/Region.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*
* @phpstan-import-type RegionData from \Com\Tecnick\Pdf\Page\Box
* @phpstan-import-type PageData from \Com\Tecnick\Pdf\Page\Box
* @phpstan-import-type PageInputData from \Com\Tecnick\Pdf\Page\Box
*
* A page region defines the writable area of the page.
*/
Expand All @@ -39,76 +40,7 @@ abstract class Region extends \Com\Tecnick\Pdf\Page\Settings
/**
* Add a new page.
*
* @param array{
* 'annotrefs'?: array<int,int>,
* 'autobreak'?: bool,
* 'box'?: array<string, array{
* 'llx'?: float,
* 'lly'?: float,
* 'urx'?: float,
* 'ury'?: float,
* 'bci'?: array{
* 'color'?: string,
* 'width'?: float,
* 'style'?: string,
* 'dash'?: array<int>,
* },
* }>,
* 'columns'?: int,
* 'content'?: array<string>,
* 'content_mark'?: array<int>,
* 'ContentHeight'?: float,
* 'ContentWidth'?: float,
* 'FooterHeight'?: float,
* 'HeaderHeight'?: float,
* 'currentRegion'?: int,
* 'format'?: string,
* 'group'?: int,
* 'height'?: float,
* 'margin'?: array{
* 'CB'?: float,
* 'CT'?: float,
* 'FT'?: float,
* 'HB'?: float,
* 'PB'?: float,
* 'PL'?: float,
* 'PR'?: float,
* 'PT'?: float,
* },
* 'n'?: int,
* 'num'?: int,
* 'orientation'?: string,
* 'pagenum'?: int,
* 'pheight'?: float,
* 'pid'?: int,
* 'pwidth'?: float,
* 'region'?: array<int, array{
* 'RB'?: float,
* 'RH'?: float,
* 'RL'?: float,
* 'RR'?: float,
* 'RT'?: float,
* 'RW'?: float,
* 'RX'?: float,
* 'RY'?: float,
* 'x' ?: float,
* 'y' ?: float,
* }>,
* 'rotation'?: int,
* 'time'?: int,
* 'transition'?: array{
* 'B'?: bool,
* 'D'?: int,
* 'Di'?: string|int,
* 'Dm'?: string,
* 'Dur'?: float,
* 'M'?: string,
* 'S'?: string,
* 'SS'?: float,
* },
* 'width'?: float,
* 'zoom'?: float,
* } $data Page data:
* @param PageInputData $data Page data:
* annotrefs : array containing the annotation object references;
* autobreak : true to automatically add a page when the content reaches the breaking point.
* box : array containing page box boundaries and settings (@see setBox);
Expand Down

0 comments on commit 6c9bf07

Please sign in to comment.