Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
32 | public function resolve() |
||
33 | { |
||
34 | $this->template->setZones($this->zones); |
||
35 | |||
36 | $this->template->denormalize($this->normalize('update')); |
||
37 | |||
38 | $this->assertEntityIsValid($this->template, array('Template', 'edition')); |
||
39 | |||
40 | $this->eventDispatcher->addListener( |
||
41 | TemplateEvents::TEMPLATE_EDITED, |
||
42 | $handler = array($this, 'onTemplateCreated') |
||
43 | ); |
||
44 | $this->fireEvent( |
||
45 | TemplateEvents::TEMPLATE_EDITED, |
||
46 | new TemplateEvent($this->template, $this) |
||
|
|||
47 | ); |
||
48 | $this->eventDispatcher->removeListener(TemplateEvents::TEMPLATE_EDITED, $handler); |
||
49 | } |
||
50 | } |
||
51 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.