XApiPortfolioCommentScoredHookObserver   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A hookCommentScored() 0 8 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
use Chamilo\CoreBundle\Entity\PortfolioComment;
6
use Chamilo\PluginBundle\XApi\ToolExperience\Statement\PortfolioCommentScored;
7
8
class XApiPortfolioCommentScoredHookObserver extends XApiActivityHookObserver implements HookPortfolioCommentScoredObserverInterface
9
{
10
    public function hookCommentScored(HookPortfolioCommentScoredEventInterface $hookEvent)
11
    {
12
        /** @var PortfolioComment $comment */
13
        $comment = $hookEvent->getEventData()['comment'];
14
15
        $statement = (new PortfolioCommentScored($comment))->generate();
16
17
        $this->saveSharedStatement($statement);
18
    }
19
}
20