Problem/Motivation

Fix phpstan and cspell, see GitLab CI

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork ban-3575442

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anybody created an issue. See original summary.

anybody’s picture

Should the custom phpstan.neon get removed?

grevil made their first commit to this issue’s fork.

grevil’s picture

Assigned: Unassigned » anybody
Status: Active » Needs review
Issue tags: -Novice

Last PHPStan error suggests removing the ban migrate source plugin, since that module is currently deprecated and will be removed in Drupal 12. Unsure if we should really do that. I'd prefer not to.

anybody’s picture

Assigned: anybody » Unassigned
Status: Needs review » Reviewed & tested by the community

@grevil: That sounds like #3572710: Drupal\ban\Plugin\migrate\source\d7\BlockedIps extends deprecated class?

Then let's just merge that one before this?

anybody’s picture

Status: Reviewed & tested by the community » Fixed

All green! Merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mstrelan’s picture

Status: Fixed » Needs work

Sorry, this has not fixed phpstan, it's just lowered the level from 8 to 0. Would be better to add the appropriate return types. I hadn't added them initially because it would mean a BC break, so I've added to the baseline instead.

grevil’s picture

@mstrelan that is true, since removing it we use https://git.drupalcode.org/project/gitlab_templates/-/blob/main/assets/p... instead.

But this is usually the standard for most contrib modules, why should we use a dedicated phpstan.neon for this module specifically?

mstrelan’s picture

I don't see it as the standard, more as the lack of standard. In fact, Drupal core uses level 1, and ban was previously subject to that. By reverting to level 0 we're going even lower than core.

The documentation for PHPStan in Gitlab Templates (for contrib) is at https://project.pages.drupalcode.org/gitlab_templates/jobs/phpstan/ and suggests that the default configuration is a fallback for when you haven't provided your own:

Configuration discovery leverages PHPStan's defaults: it will use phpstan.neon when present, fall back to phpstan.neon.dist, and finally phpstan.dist.neon. If none of these exist in the project root, a default configuration is used.

Furthermore, I don't know why you wouldn't want to have better automated checks in place, particularly when there are so few violations to start with.

grevil’s picture

Title: Fix phpstan and cspell » Reintroduce PHPStan and fix phpstan errors

grevil changed the visibility of the branch 3575442-fix-phpstan-and to hidden.

grevil’s picture

Issue tags: +Novice

mstrelan’s picture

Status: Needs work » Needs review
anybody’s picture

@mstrelan I left a reply. Thanks!

grevil’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Novice

LGTM, thanks!

grevil’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

anybody’s picture

@mstrelan could you please finally check that 1.1.x-dev is fine again now?

mstrelan’s picture

perfect, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.