Skip to content

Inspections

vitaliy edited this page Dec 15, 2022 · 1 revision

Inspections

Plugin inspection in the scope of PHP class

Inspection highlights the following cases:

  • Plugin declared for a final class
  • Plugin declared for a final method
  • Plugin declared for a constructor
  • Plugin declared for a not public method
  • Plugin declared for a static method
  • Incompatible parameter
  • Redundant parameter

Plugin duplication inspection in the scope of di.xml

This inspection highlights possible accidental plugin duplication. A Plugin name must be unique. In case if overriding is wanted, the best practice is to disable the original plugin and give a unique name to the current plugin.

Observer duplication inspection in the scope of events.xml

Inspection for observer declaration records, similar to plugin inspection.

GraphQL resolver inspection in the scope of PHP class (Requires GraphQLJS plugin)

If a class is configured in schema.GraphQLs as a resolver, it should implement one of the resolver interfaces.

Cacheable false in the scope of the default layout

This inspection highlights the cacheable attribute which is set to be false in default.xml as that can make the whole site uncacheable.

Module declaration in the scope of the module.xml and registration.php

Inspection checks whether the name of the module declared in app/code reflect the folder structure.

GraphQL resolver in the scope of a schema file

Inspection checks whether resolvers declared in schema implement resolver interfaces.

ACL resource inspection

Inspection check ACL resource with a unique identifier to have a title attribute.

Web API XML service tag attributes inspections

DI XML preference tag attributes inspections

DI XML type tag attributes inspections that related to the PHP/Magento types

The Type tag inspections (in the di.xml files) detect empty values or invalid values where a Type values (class, interface, virtual type) are expected.

It also supports recursive inspection for xsi:type="array" arguments.

DI XML plugin type attribute inspections

Virtual type check

Added inspection to check if the type attribute value in the virtual type tag of the di.xml is valid

For an empty value:

For an invalid value:

Config Scope directory inspection