Skip to content

Add assert positive, negative ints - #55

Merged
frankdekker merged 7 commits into
masterfrom
Add-assert-positive-negative-int
Aug 27, 2025
Merged

Add assert positive, negative ints#55
frankdekker merged 7 commits into
masterfrom
Add-assert-positive-negative-int

Conversation

@frankdekker

Copy link
Copy Markdown
Member

Adds assert methods:

  • Assert::positiveInt
  • Assert::negativeInt
  • Assert::nonPositiveInt
  • Assert::nonNegativeInt

@frankdekker
frankdekker requested review from bram123 and Copilot August 27, 2025 13:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds four new assertion methods to the Assert class for validating integer values with specific sign constraints. These methods provide more granular validation for positive, negative, non-positive, and non-negative integers.

  • Adds four new integer assertion methods: positiveInt, negativeInt, nonPositiveInt, and nonNegativeInt
  • Refactors existing integer and numeric tests from AssertTest to a dedicated AssertIntegerTest class
  • Updates documentation to include the new assertion methods

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Assert.php Implements the four new integer assertion methods with proper PHPStan type annotations
tests/Unit/AssertIntegerTest.php Creates new test file with comprehensive tests for all integer-related assertions
tests/Unit/AssertTest.php Removes integer and numeric tests that were moved to the dedicated test file
README.md Documents the new assertion methods in the feature list

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/Assert.php Outdated
Comment thread src/Assert.php
frankdekker and others added 4 commits August 27, 2025 15:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@frankdekker
frankdekker merged commit 5b215ee into master Aug 27, 2025
10 checks passed
@frankdekker
frankdekker deleted the Add-assert-positive-negative-int branch August 27, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants