Skip to content
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

sfFactoryConfigHandler generates a wrong constructor for request instance #134

Open
fruit opened this issue Aug 17, 2016 · 0 comments
Open

Comments

@fruit
Copy link

fruit commented Aug 17, 2016

Hi,

while inspecting a generated factories cache file (e.i. ./cache/frontend/test/config/config_factories.yml.php I found out that the number of constructor arguments for class sfWebRequest does not match the signature.

Take a look at file sfFactoryConfigHandler:94 on line

$this->factories['request'] = new $class($this->dispatcher, array(), array(), sfConfig::get('sf_factory_request_parameters', '%s'), sfConfig::get('sf_factory_request_attributes', array()));

It initializes a $class instance with 5 arguments:

  1. EventDispatcher
  2. array() hardcoded
  3. array() hardcoded
  4. request parameters
  5. request attributes

Furthermore, the class sfWebRequest (parent sfRequest) has only 4 arguments in constructor:

  1. EventDispatcher
  2. $parameters = array()
  3. $attributes = array()
  4. $options = array()

I came to conclusion that the 5th argument in sfFactoryConfigHandler is unnecessary and won't break any BC if you drop it.

P.S. The extra (e.i. 5th) argument was there for a long time since v1.2

P.P.S. IMHO, the priority of the issue is minor.

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

No branches or pull requests

1 participant