Problem/Motivation

PHPStan is a tool that does static analysis on a codebase to find bugs. PHPStan is run in our CI pipeline. PHPStan groups its lints into rule levels.

Currently PHPStan doesn't report any issues, possibly because we don't have a configuration file for it yet.

It does find a common lint ("Unsafe usage of new static()") at levels 0 and 1 when I run PHPStan locally.

Proposed resolution

Add a PHPStan configuration file (i.e.: phpstan.neon) and generate a baseline file. Ignore the "Unsafe usage of new static()" lint like Drupal core does.

Remaining tasks

  1. Merge request - merge request !11 created by @mparker17 in #2
  2. Commit - merged by @mparker17 in #4
  3. Release

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork feedback-3586801

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

mparker17 created an issue. See original summary.

mparker17’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community

Created a merge request

mparker17’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Merged! I will update this issue when the code added here is released.

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.