Passed
Pull Request — master (#5629)
by Angel Fernando Quiroz
08:49
created

hookCommentScored()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
use Chamilo\CoreBundle\Entity\PortfolioComment;
8
use Chamilo\PluginBundle\XApi\ToolExperience\Statement\PortfolioCommentScored;
9
10
class XApiPortfolioCommentScoredHookObserver extends XApiActivityHookObserver implements HookPortfolioCommentScoredObserverInterface
11
{
12
    public function hookCommentScored(HookPortfolioCommentScoredEventInterface $hookEvent): void
13
    {
14
        /** @var PortfolioComment $comment */
15
        $comment = $hookEvent->getEventData()['comment'];
16
17
        $statement = (new PortfolioCommentScored($comment))->generate();
18
19
        $this->saveSharedStatement($statement);
20
    }
21
}
22