Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Ocramius opened this issue Feb 19, 2017 · 0 comments
Open

Comments

@Ocramius
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant