Framework Performance Optimisations
Optimised autoloader and framework setup Fixes #845 (closed)
added MR::Awaiting Review Product::Platform Sprint::09/11 - Nuanced Numbat Squad::Blue Type::Feature scoped labels
- Developer
- Last updated by Guy Thouret
8 8 9 9 class Events 10 10 { 11 /** @var Legacy\Entity */ 12 protected $legacyEntity; 13 14 /** @var Manager */ 15 protected $manager; 16 17 11 /** @var EventsDispatcher */ 18 12 protected $eventsDispatcher; 19 13 20 public function __construct($legacyEntity = null, $manager = null, $eventsDispatcher = null) 14 public function __construct($eventsDispatcher = null) 21 15 { 22 $this->legacyEntity = $legacyEntity ?: new Legacy\Entity(); - Owner
are we not now losing the ability to spec test these events by making this change?
- Developer
In this case you would lose the ability to mock
Manager
andLegacy\Entity
via the constructor, IIRC there isn't a test covering this plus the event handler callback should always be minimal and immediately call e.g. a manager method that does have coverage.It's a minor inconvenience vs triggering a cascading chain of object instantiations that have nothing to do with the functionality being executed.
Tbh there is always going to be a way around it to test, like a couple of possibilities could be a method that can inject the mocks or refactor to have them accessed by DI and bind them to the DI in the spec test before calling the method under test.
- Owner
is
composer.phar
supposed to be committed?Edited by Mark Harding added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label
- DeveloperResolved by Guy Thouret
It's not normal practice to redistribute 3rd party tools within your own project as they won't get kept up to date.
composer.phar was added to the repo a year ago in 509c804f
- Last reply by Guy Thouret