Skip to content

Avoid calling the proxy generator with a mismatched number of parameters #363

@Ocramius

Description

@Ocramius

As already reported by PHPStan, PHPStorm, Scrutinizer-CI and other tools:

 ------ ---------------------------------------------------------------------------------------------------------------------
  Line   src/ProxyManager/Factory/AbstractBaseFactory.php
 ------ ---------------------------------------------------------------------------------------------------------------------
  123    Method ProxyManager\ProxyGenerator\ProxyGeneratorInterface::generate() invoked with 3 parameters, 2 required.
  127    Method ProxyManager\GeneratorStrategy\GeneratorStrategyInterface::generate() invoked with 2 parameters, 1 required.
 ------ ---------------------------------------------------------------------------------------------------------------------

That calls for a re-design of the interface.

The additional parameters were added due to BC compliance, but are obviously a smell. This probably calls for a "code generation context" containing all currently known information needed by the code generator.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions