← Back to Baseline

MB-0817

Partially automated DI constructor arguments match supported signatures

MB-C20 Module Integrity & Compatibility Medium

Named DI arguments match indexed constructor parameters and supported array parameter types. Development without module order evaluates per-file declarations, not effective merged DI.

Overview

Compare named DI arguments to indexed constructor parameters and supported array types. A misspelled parameter or incompatible array declaration can prevent the intended object from being built.

Why it Matters

Misspelled or incompatible constructor arguments can prevent the intended dependency from being injected.

Interpret the reported resource and collection scope before making changes. Unsupported source, unresolved symbols and bounded collection gaps cannot establish a clean result.

Verification Steps

Manual Verification

  1. Compare named DI arguments to indexed constructor parameters and supported array types. A misspelled parameter or incompatible array declaration can prevent the intended object from being built.
  2. Inspect the reported file, declaration, package or evidence record in the same selected release. Keep source observations separate from effective runtime behavior.
  3. Apply the rule-specific remediation below, validate the affected behavior in staging, and rerun the same selection.

Command / Review Sample

php magebean.phar audit --path=/var/www/magento --profile=module-integrity --rules=MB-0817 --modules=Vendor_Module

Use the assessed Magento project and the appropriate application or read-only review account. Replace example hosts, paths and identifiers with the assessment scope; configuration and source fragments are illustrative.

Remediation / Fix Guidance

  1. Check the reported DI declaration and its area override.
  2. Verify the affected class or service in staging.
  3. Rerun MB-0817 with the same module selection.

Examples

Illustrative declaration/review examples, not recorded scan output. A pass example concerns only the stated predicate and supported collected scope.

Fail Example

Constructor parameter: $client
DI argument name: clietn

Pass Example

Constructor parameter: $client
DI argument name: client
Confirm supported argument type and effective area configuration.

Scope and Evidence Limits

Rule revision: 2. Target modes: LOCAL.

Named DI arguments match indexed constructor parameters and supported array parameter types. Development without module order evaluates per-file declarations, not effective merged DI.

Static declaration analysis only. Unresolved symbols and unsupported runtime or generated behavior are collection gaps.

Catalog coverage describes implementation capability, not a scan outcome. An incomplete manual review cannot establish that the criterion is satisfied.

References