Drop support for older Laravels, apply formatting#245
Merged
dwightwatson merged 8 commits intomasterfrom Apr 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the package’s supported framework/tooling targets to Laravel 12/13 and applies consistent formatting (Pint-style), alongside related test and code cleanup.
Changes:
- Update Composer constraints to only allow Illuminate 12/13, add Pint, and bump PHPUnit.
- Update CI matrix to run against Laravel 12/13 and newer PHP versions.
- Reformat source/tests and modernize PHPUnit
setUp()visibility + test method naming.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
composer.json |
Drops Illuminate 9–11, bumps PHPUnit, adds Pint. |
.github/workflows/run-tests.yml |
Updates PHP/Laravel test matrix to newer versions. |
src/ValidationException.php |
Reorders imports/docblocks; adjusts return type annotations. |
src/ValidatingTrait.php |
Import/docblock tweaks + formatting updates. |
src/ValidatingObserver.php |
Docblock/formatting updates; string formatting. |
src/ValidatingModel.php |
Docblock return type simplification + import. |
src/ValidatingInterface.php |
Import/docblock updates. |
tests/TestCase.php |
Reorders imports and changes base TestCase from abstract to concrete. |
tests/ValidationExceptionTest.php |
Formatting + setUp() visibility + test naming. |
tests/ValidatingTraitTest.php |
Formatting + setUp() visibility + test naming + stub updates. |
tests/ValidatingObserverTest.php |
Formatting + setUp() visibility + test naming. |
tests/ValidatingModelTest.php |
Formatting + test naming + removes unused import. |
tests/Injectors/UniqueWithInjectorTest.php |
Formatting + setUp() visibility + test naming + imports. |
tests/Injectors/UniqueInjectorTest.php |
Formatting + setUp() visibility + test naming + imports. |
src/Injectors/UniqueWithInjector.php |
Formatting (concat spacing/docblocks). |
src/Injectors/UniqueInjector.php |
Formatting (concat spacing/docblocks). |
Comments suppressed due to low confidence (1)
src/ValidatingObserver.php:45
- These docblocks say the observer methods return
bool, butperformValidation()returnsnullin multiple branches (e.g., when validation is skipped or a validating event returns non-null). Update the documented return types to reflect the actualbool|nullbehavior (or make the methods consistently return a boolean).
* @return bool
*/
public function saving(Model $model)
{
return $this->performValidation($model, 'saving');
}
/**
* Register the validation event for restoring the model.
*
* @return bool
*/
public function restoring(Model $model)
{
return $this->performValidation($model, 'restoring');
}
/**
* Perform validation with the specified ruleset.
*
* @param string $event
* @return bool
*/
protected function performValidation(Model $model, $event)
{
// If the model has validating enabled, perform it.
if ($model->getValidating()) {
// Fire the namespaced validating event and prevent validation
// if it returns a value.
if ($this->fireValidatingEvent($model, $event) !== null) {
return;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
16
to
+27
| "require": { | ||
| "php": "^8.1", | ||
| "illuminate/contracts": "~9.0|~10.0|~11.0|~12.0|~13.0", | ||
| "illuminate/database": "~9.0|~10.0|~11.0|~12.0|~13.0", | ||
| "illuminate/events": "~9.0|~10.0|~11.0|~12.0|~13.0", | ||
| "illuminate/support": "~9.0|~10.0|~11.0|~12.0|~13.0", | ||
| "illuminate/validation": "~9.0|~10.0|~11.0|~12.0|~13.0" | ||
| "illuminate/contracts": "~13.0", | ||
| "illuminate/database": "~13.0", | ||
| "illuminate/events": "~13.0", | ||
| "illuminate/support": "~13.0", | ||
| "illuminate/validation": "~13.0" | ||
| }, | ||
| "require-dev": { | ||
| "mockery/mockery": "^1.4.4", | ||
| "phpunit/phpunit": "~9.0" | ||
| "phpunit/phpunit": "~12.0", | ||
| "laravel/pint": "^1.29" |
Comment on lines
+5
to
+8
| use Illuminate\Contracts\Support\Messagebag; | ||
| use Illuminate\Contracts\Support\MessageProvider; | ||
| use Illuminate\Contracts\Validation\Validator; | ||
| use Illuminate\Database\Eloquent\Model; |
| * @return void | ||
| * @throws \Watson\Validating\ValidatingException | ||
| * | ||
| * @throws ValidatingException |
| os: [ubuntu-latest, windows-latest] | ||
| php: [8.1, 8.2] | ||
| laravel: [9.*, 10.*] | ||
| php: [8.4, 8.5] |
Comment on lines
24
to
28
| "require-dev": { | ||
| "mockery/mockery": "^1.4.4", | ||
| "phpunit/phpunit": "~9.0" | ||
| "phpunit/phpunit": "~12.0", | ||
| "laravel/pint": "^1.29" | ||
| }, |
| @@ -43,7 +42,7 @@ public function model() | |||
| /** | |||
| * Get the mdoel with validation errors. | |||
| use PHPUnit\Framework\TestCase as BaseTestCase; | ||
|
|
||
| abstract class TestCase extends BaseTestCase | ||
| class TestCase extends BaseTestCase |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.