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

hookPortfolioDownloaded()   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
use Chamilo\PluginBundle\XApi\ToolExperience\Statement\PortfolioDownloaded;
6
use Chamilo\UserBundle\Entity\User;
7
8
class XApiPortfolioDownloadedHookObserver extends XApiActivityHookObserver implements HookPortfolioDownloadedObserverInterface
9
{
10
    public function hookPortfolioDownloaded(HookPortfolioDownloadedEventInterface $hookEvent): void
11
    {
12
        /** @var User $owner */
13
        $owner = $hookEvent->getEventData()['owner'];
14
15
        $statement = (new PortfolioDownloaded($owner))->generate();
16
17
        $this->saveSharedStatement($statement);
18
    }
19
}
20