DeleteCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 13
rs 10
c 0
b 0
f 0
ccs 0
cts 7
cp 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 7 1
1
<?php
2
3
namespace Synapse\Cmf\Framework\Theme\Template\Domain\Command;
4
5
use Synapse\Cmf\Framework\Theme\Template\Event\Event as TemplateEvent;
6
use Synapse\Cmf\Framework\Theme\Template\Event\Events as TemplateEvents;
7
8
/**
9
 * Template deletion command representation.
10
 */
11
class DeleteCommand extends AbstractCommand
12
{
13
    /**
14
     * @see ActionInterface::resolve()
15
     */
16
    public function resolve()
17
    {
18
        $this->fireEvent(
19
            TemplateEvents::TEMPLATE_DELETED,
20
            new TemplateEvent($this->template, $this)
0 ignored issues
show
Compatibility introduced by
$this->template of type object<Synapse\Cmf\Frame...odel\TemplateInterface> is not a sub-type of object<Synapse\Cmf\Frame...mplate\Entity\Template>. It seems like you assume a concrete implementation of the interface Synapse\Cmf\Framework\Th...Model\TemplateInterface to be always present.

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.

Loading history...
21
        );
22
    }
23
}
24