Problem/Motivation

Adding entity type mappings for log and log_type will make it easier to perform static analysis of code interacting with Log entities. This is a feature provided by the phpstan-drupal extension.

The Log module can provide an entity type mapping via a entity_mapping.neon file mentioned in extra.phpstan.includes section of the composer.json file. For more info see: https://github.com/mglaman/phpstan-drupal?tab=readme-ov-file#providing-e...

Steps to reproduce

N/A

Proposed resolution

Provide entity type mappings for phpstan-drupal

Remaining tasks

Implement

User interface changes

None

API changes

None

Data model changes

None

Issue fork log-3499826

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

paul121 created an issue. See original summary.

paul121’s picture

Status: Active » Needs review

This is really a simple change that might not necessarily be seen within the Log module/tests here (maybe not until we upgrade to level 2) but this will be useful for contrib, and notably FarmOS: https://github.com/farmOS/farmOS/pull/906

Note that tests are failing on 2.x branch for other reasons, see here: https://www.drupal.org/project/log/issues/3431729#comment-15942301

m.stenta made their first commit to this issue’s fork.

  • m.stenta committed ea6593e7 on 2.x authored by paul121
    Issue #3499826: Provide entity type mappings for phpstan-drupal
    
m.stenta’s picture

Status: Needs review » Fixed

Merged - thanks @paul121!

Status: Fixed » Closed (fixed)

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