Skip to content

Conversation

@shahmal1yev
Copy link
Member

@shahmal1yev shahmal1yev commented Dec 19, 2024

  • Unsigned Integer Implementation

@shahmal1yev shahmal1yev changed the title [ATC-2] CBOR Implementation [APC-2] CBOR Implementation Dec 19, 2024
@shahmal1yev shahmal1yev self-assigned this Dec 19, 2024
@shahmal1yev shahmal1yev added the enhancement New feature or request label Dec 19, 2024
shahmal1yev and others added 6 commits January 7, 2025 14:33
…d data

- Updated `decode` method in `UnsignedInteger` to:
  - Remove unnecessary offset variable.
  - Add validation for negative values in CBOR data, throwing a `ValueError` for invalid unsigned integers.
- Added test cases in `UnsignedIntegerTest`:
  - `testEncodeThrowsAnExceptionForValueGreaterThanIntMax`: Ensures decoding throws an exception when passed a value exceeding `PHP_INT_MAX`.
  - `testDecodeThrowsAnExceptionWhenPassedInvalidValue`: Verifies invalid CBOR data with negative or unsupported values triggers proper exceptions.
  - Added `provideNegativeCases` data provider to test a range of invalid CBOR inputs.
- Improved exception messages for better clarity and debugging.
@shahmal1yev shahmal1yev changed the title [APC-2] CBOR Implementation [APC-2] CBOR Implementation (UII) Jan 7, 2025
@shahmal1yev shahmal1yev merged commit 462788d into 1.x Jan 7, 2025
4 checks passed
@shahmal1yev shahmal1yev deleted the apc-2 branch January 7, 2025 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants