Skip to content

sfFactoryConfigHandler generates a wrong constructor for request instance #134

Open
@fruit

Description

@fruit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions