Passed
Pull Request — 1.11.x (#4501)
by Angel Fernando Quiroz
09:49
created

XApiPortfolioDownloadedHookObserver   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A hookPortfolioDownloaded() 0 8 1
1
<?php
2
3
use Chamilo\PluginBundle\XApi\ToolExperience\Statement\PortfolioDownloaded;
4
use Chamilo\UserBundle\Entity\User;
5
6
class XApiPortfolioDownloadedHookObserver extends XApiActivityHookObserver implements HookPortfolioDownloadedObserverInterface
7
{
8
    public function hookPortfolioDownloaded(HookPortfolioDownloadedEventInterface $hookEvent)
9
    {
10
        /** @var User $owner */
11
        $owner = $hookEvent->getEventData()['owner'];
12
13
        $statement = (new PortfolioDownloaded($owner))->generate();
14
15
        $this->saveSharedStatement($statement);
16
    }
17
}
18