You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
arch('strict types used everywhere')
->expect('App')
->toUseStrictTypes();
that works, but once I'd fixed my missing declare(strict_types=1); it displayed the following error:
DEPR Tests\Unit\ArchitectureTest
! strict types used everywhere → Optional parameter $displayname declared before required parameter $status is implicitly treated as a required parameter // vendor/ta-tikoma/phpunit-architecture-test/src/Asserts/Dependencies/ObjectDependenciesDescription.php:44
There's no mention of what file the error was in, and the only clue was the $displayname and $status parameters.
I eventually found the file with the offending issue, and as the error said, I'd mistakenly put a required parameter after an optional one in a function definition:
What Happened
I have a simple test:
that works, but once I'd fixed my missing
declare(strict_types=1);
it displayed the following error:There's no mention of what file the error was in, and the only clue was the
$displayname
and$status
parameters.I eventually found the file with the offending issue, and as the error said, I'd mistakenly put a required parameter after an optional one in a function definition:
Note:
AccountStatus
above is an enum, and line 44 ofObjectDependenciesDescription.php
isenum_exists($nameAsString) => true,
How to Reproduce
Test
folder insideapp
Test.php
, with a classTest
and function definition with required parameters after an optional parameter:Test.php
Sample Repository
https://github.com/avenjamin/Pest-Test
Pest Version
2.34.7
PHP Version
8.3.7
Operation System
macOS
Notes
This is my first time using pest so I might have done something wrong 🤓
The text was updated successfully, but these errors were encountered: