-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for enum default arguments using enum cases #1464
Conversation
Can you please add a test too? |
@mfn Will try, don't know if there are tests for these default values, I was looking around and didn't found something I can adapt to this, or do you think I should add a new folder instead? |
Ok I reply myself, I think this should go in a new folder so we can mark it as PHP 8+ only as these enums won't work on PHP 7 tests |
Ok tests added and passing on PHP 8.2, also added same way it was done for Laravel 9 only tests (a condition to check if PHP 8.1+ is running otherwise markAsSkipped the test) |
@@ -17,7 +17,7 @@ jobs: | |||
- name: Setup PHP | |||
uses: shivammathur/setup-php@v2 | |||
with: | |||
php-version: 8.0 | |||
php-version: 8.1 |
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.
Otherwise the UnitEnum does not exist
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.
Probably always should run on the latest stable (would be 8.2)
* add case when default value is of type enum * Update CHANGELOG.md * add tests for enum arguments default values * ignore psalm issue (built-in `\UnitEnum` class does not exists in PHP7) * Update run-static-analysis.yml to use PHP8.1 --------- Co-authored-by: Barry vd. Heuvel <[email protected]> Co-authored-by: Barry vd. Heuvel <[email protected]>
Summary
Fixes #1463
Type of change
Checklist
composer fix-style