Completed
Push — 7.5 ( 8c46b6...5b7eb5 )
by Łukasz
20:41
created

DeleteUser::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Publish\Core\Repository\Slot\User;
8
9
use eZ\Bundle\EzPublishCoreBundle\EventListener\User\eZ;
10
use eZ\Publish\API\Repository\ContentTypeService;
11
use eZ\Publish\Core\SignalSlot\Signal;
12
use eZ\Publish\Core\SignalSlot\Slot;
13
14
class DeleteUser extends Slot
15
{
16
    /** @var eZ\Publish\API\Repository\ContentTypeService */
17
    private $contentTypeService;
18
19
    public function __construct(ContentTypeService $contentTypeService)
20
    {
21
        $this->contentTypeService = $contentTypeService;
0 ignored issues
show
Documentation Bug introduced by
It seems like $contentTypeService of type object<eZ\Publish\API\Re...ory\ContentTypeService> is incompatible with the declared type object<eZ\Bundle\EzPubli...ory\ContentTypeService> of property $contentTypeService.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
22
    }
23
24
    public function receive(Signal $signal)
25
    {
26
        if (!$signal instanceof Signal\UserService\DeleteUserSignal) {
27
            return;
28
        }
29
30
        $this->contentTypeService->deleteUserDrafts($signal->userId);
31
    }
32
}
33