Skip to main content
replaced http://magento.stackexchange.com/ with https://magento.stackexchange.com/
Source Link

NB: please note that in Magento 2, the $data array parameter always comes last: Magento 2: what is the $data array constructor parameter?Magento 2: what is the $data array constructor parameter?

NB: please note that in Magento 2, the $data array parameter always comes last: Magento 2: what is the $data array constructor parameter?

NB: please note that in Magento 2, the $data array parameter always comes last: Magento 2: what is the $data array constructor parameter?

added 135 characters in body
Source Link

In that particular case, the ECGM2 standars will complain about the order of parameters in the constructorthe static tests will complain about the order of parameters in the constructor. To fix that you should change:

In that particular case, the ECGM2 standars will complain about the order of parameters in the constructor. To fix that you should change:

In that particular case, the static tests will complain about the order of parameters in the constructor. To fix that you should change:

added 729 characters in body
Source Link

Extra Case

You have class Foo that extends Bar

class Foo extends Bar { public function __construct( \Test $test, \Testtwo $testtwo, \First\Argument $first, \Second\Argument $second ) { parent::__construct($first, $second); } } 

In that particular case, the ECGM2 standars will complain about the order of parameters in the constructor. To fix that you should change:

 public function __construct( \First\Argument $first, \Second\Argument $second, \Test $test, \Testtwo $testtwo ) { parent::__construct($first, $second); } 

Extra Case

You have class Foo that extends Bar

class Foo extends Bar { public function __construct( \Test $test, \Testtwo $testtwo, \First\Argument $first, \Second\Argument $second ) { parent::__construct($first, $second); } } 

In that particular case, the ECGM2 standars will complain about the order of parameters in the constructor. To fix that you should change:

 public function __construct( \First\Argument $first, \Second\Argument $second, \Test $test, \Testtwo $testtwo ) { parent::__construct($first, $second); } 
deleted 777 characters in body
Source Link
Loading
Source Link
Loading