Repository navigation
#18 PHPStan level 10 - #134
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3 tasks
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.
Description
Fixes #18
PHPStan level 10 (was 8) on
srcandtests, as the other bridges (archive, cache, doctrine, flysystem, rest, soap). 68 errors fixed (28 at level 9), no baseline, noignoreErrors.Changes
Almost all errors were
mixedvalues used without being typed. They are narrowed by PHPDoc (@varon an assignment) where the type is already guaranteed (bundle configuration, form options and data, OptionsResolver allowed types, Doctrine results, validated command inputs), without changing the runtime behaviour:CleverAgeUiProcessExtension: array shape of the processed configuration.LaunchAction,LogRecordCrudController,ProcessDashboardController,ProcessExecuteController,UserCrudController),LaunchType,UserCreateCommand,HttpProcessExecuteValueResolver,CronProcessMessageHandler,ProcessExecutionRepository::getLastProcessExecution(),ProcessSchedule::getContext().ProcessConfigurationsManager: element types of the OptionsResolver closures (statuses,recipients,ui.default.context). PHPStan ignores a PHPDoc@paramplaced on the statement, and PHP-CS-Fixer (phpdoc_to_comment) turns a@varthat is not followed by an assignment into a plain comment: hence the typed intermediate variables.ProcessExecutionManager::increment(): early return when there is no current execution (same behaviour as the former nullsafe call).UserCrudController::generateToken(): the entity manager is fetched forUser::class(the FQCN of this CRUD) instead of$adminContext?->getEntity()->getFqcn()(nullable).Typing changes visible from outside (no BC break):
LogProcessFilter::new():$labeltypedTranslatableInterface|string|false|nullinstead ofmixed. It is passed to EasyAdminFilterTrait::setLabel(), which already has this native type: any other value already failed.LogRecord::$contextdocumented asarray<mixed>(wasarray<string, mixed>), the type of the Monolog context it is built from.ProcessExecution::getReport(): conditional return type($key is null ? array<string, mixed> : mixed).Tests: array shapes on
$form->getPhpValues(), on the DBAL results and on the processed configuration; no assertion changed.CHANGELOG: #18 entry under "Latest".
Checks
phpunit.xml.dist) already exist onmain.Out of scope (not fixed)
contextthat is valid but not an object or an array (e.g."1") passes theJsonconstraint ofHttpProcessExecution, thenjson_decode()returns a scalar and aTypeErrorgives a 500. The PHPDoc only documents the existing assumption; this could be a separate issue.Requirements
Breaking changes
None.
🤖 Generated with Claude Code