Skip to content

Add strict type checking #685

@millnut

Description

@millnut

Drupal is moving towards strict type (https://www.drupal.org/project/drupal/issues/3404246, https://www.drupal.org/project/drupal/issues/3295295).

I have started adding improvements to PHPStan checks to run strict type checking, as part of this it includes a new dev package in the project called phpstan/phpstan-strict-rules. By default I've disabled most of the rules it provides apart from checking calls are strict.

The checks can be found in this PR localgovdrupal/localgov_project#153 where the previous deprecated check is now a static analysis check to report all modules for deprecations, strict calls and typing.

Overall there are only 129 strict type/call issues which is great as this means minimal work to update.

This ticket would be best used to track updating each module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions