Skip to content

Allow float width/height in document page Size - #71

Open
Dinwid wants to merge 1 commit into
signnow:masterfrom
Dinwid:fix/document-page-size-float
Open

Allow float width/height in document page Size#71
Dinwid wants to merge 1 commit into
signnow:masterfrom
Dinwid:fix/document-page-size-float

Conversation

@Dinwid

@Dinwid Dinwid commented Jul 14, 2026

Copy link
Copy Markdown

Problem

GET /document/{document_id} can return non-integer page dimensions in pages[].size, e.g.:

"pages": [
  {
    "src": "...",
    "size": { "width": 612, "height": 791.99 }
  }
]

Since Size is declared under strict_types=1 with int constructor parameters, Size::fromArray() throws an uncatchable-in-practice TypeError whenever the API returns a float, which breaks DocumentGet deserialization for such documents.

Fix

Widen width/height in SignNow\Api\Document\Response\Data\Size from int to float|int (constructor and getters). Integer values keep round-tripping as integers through toArray(); float values no longer fatal.

phpcs passes on the changed file.

The API returns non-integer page dimensions for some documents
(e.g. 791.99), which causes a TypeError in Size::fromArray()
because the constructor is typed int under strict_types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant