GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( c7f4e3...a41792 )
by Mario
18:09
created

DatabaseAction::act()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Netgen\InformationCollection\Core\Action;
6
7
use Netgen\InformationCollection\API\Exception\PersistingFailedException;
8
use Netgen\InformationCollection\API\Service\InformationCollection;
9
use Netgen\InformationCollection\API\Value\Event\InformationCollected;
10
use Netgen\InformationCollection\API\Exception\ActionFailedException;
11
use Netgen\InformationCollection\API\Action\ActionInterface;
12
use Netgen\InformationCollection\API\Action\CrucialActionInterface;
13
14
class DatabaseAction implements ActionInterface, CrucialActionInterface
15
{
16
    /**
17
     * @var InformationCollection
18
     */
19
    private $informationCollection;
20
21
    public function __construct(InformationCollection $informationCollection)
22
    {
23
        $this->informationCollection = $informationCollection;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function act(InformationCollected $event): void
30
    {
31
        $struct = $event->getInformationCollectionStruct();
32
33
        try {
34
            $this->informationCollection
35
                ->createCollection($struct);
36
        } catch (PersistingFailedException $e) {
37
            throw new ActionFailedException('database', $e->getMessage());
38
        }
39
    }
40
}
41