Passed
Pull Request — master (#203)
by Romain
03:13
created

CommentAddedEvent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 8 1
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * Copyright (C) 2018
6
 * Nathan Boiron <[email protected]>
7
 * Romain Canon <[email protected]>
8
 *
9
 * This file is part of the TYPO3 NotiZ project.
10
 * It is free software; you can redistribute it and/or modify it
11
 * under the terms of the GNU General Public License, either
12
 * version 3 of the License, or any later version.
13
 *
14
 * For the full copyright and license information, see:
15
 * http://www.gnu.org/licenses/gpl-3.0.html
16
 */
17
18
namespace CuyZ\Notiz\Domain\Event\Blog;
19
20
use CuyZ\Notiz\Core\Event\AbstractEvent;
21
use T3G\AgencyPack\Blog\Domain\Model\Comment;
0 ignored issues
show
Bug introduced by
The type T3G\AgencyPack\Blog\Domain\Model\Comment was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
22
use T3G\AgencyPack\Blog\Domain\Model\Post;
0 ignored issues
show
Bug introduced by
The type T3G\AgencyPack\Blog\Domain\Model\Post was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
23
use T3G\AgencyPack\Blog\Notification\CommentAddedNotification;
0 ignored issues
show
Bug introduced by
The type T3G\AgencyPack\Blog\Noti...ommentAddedNotification was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
24
25
class CommentAddedEvent extends AbstractEvent
26
{
27
    /**
28
     * @label Event/Blog:comment_added.marker.comment
29
     * @marker
30
     *
31
     * @var Comment
32
     */
33
    protected $comment;
34
35
    /**
36
     * @label Event/Blog:comment_added.marker.post
37
     * @marker
38
     *
39
     * @var Post
40
     */
41
    protected $post;
42
43
    /**
44
     * @label Event/Blog:comment_added.email.comment_email
45
     * @email
46
     *
47
     * @var array
48
     */
49
    protected $commentEmail;
50
51
    /**
52
     * @param CommentAddedNotification $commentAddedNotification
53
     */
54
    public function run(CommentAddedNotification $commentAddedNotification)
55
    {
56
        $data = $commentAddedNotification->getData();
57
58
        $this->comment = $data['comment'];
59
        $this->post = $data['post'];
60
61
        $this->commentEmail = $this->comment->getEmail();
62
    }
63
}
64