-
Notifications
You must be signed in to change notification settings - Fork 0
Create Assert Class #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Assert Class #159
Conversation
There was a problem hiding this comment.
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 introduces a new Assert class to provide runtime type assertions with PHPStan integration, along with updating development dependencies and cleaning up Rector rules.
- Creates a new
Assertutility class with methods for runtime assertions (true,false,notNull,string) - Adds an
Assertabletrait to simplify assertion usage in classes - Updates development dependencies to their latest major versions (PHPStan 2.x, Rector 2.x, Pest 4.x)
Reviewed changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/Objects/Support/Assert.php |
New utility class providing static assertion methods with PHPStan type narrowing annotations |
src/Objects/Support/Traits/Assertable.php |
New trait providing protected assertion methods that delegate to the Assert class |
src/Exceptions/AssertionFailedException.php |
New exception class for assertion failures |
src/Objects/Filesystem/Directory.php |
Refactored current() method to use Assert::string() instead of ImproperBooleanReturnedException |
src/Objects/Serializers/JsonSerializer.php |
Simplified mapper fallback logic by relying on MapName attribute's constructor default |
src/Objects/Support/Traits/Macroable.php |
Added explicit array type hint to $parameters in __callStatic() |
src/Objects/Support/Traits/HasEnumValue.php |
Added PHPStan ignore comment for runtime safety check |
src/Support/Internal/Rector/Rector.php |
Removed several Rector rules from configuration |
phpstan.neon |
Added trait.unused to ignored errors list |
composer.json |
Updated dev dependencies to major versions (PHPStan ^2, Rector ^2, Pest ^4, etc.) |
composer.lock |
Lock file updates for dependency changes |
Files not reviewed (2)
- .idea/php.xml: Language not supported
- .idea/stdlib.iml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
No description provided.