ContractApplication   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 6
dl 0
loc 21
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configureAop() 0 10 1
1
<?php
2
3
/**
4
 * PHP Deal framework
5
 *
6
 * @copyright Copyright 2019, Lisachenko Alexander <[email protected]>
7
 *
8
 * This source file is subject to the license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
declare(strict_types=1);
13
14
namespace PhpDeal;
15
16
use Doctrine\Common\Annotations\AnnotationReader;
17
use Go\Core\AspectContainer;
18
use Go\Core\AspectKernel;
19
use PhpDeal\Aspect\InheritCheckerAspect;
20
use Go\Core\GoAspectContainer;
21
use PhpDeal\Aspect\InvariantCheckerAspect;
22
use PhpDeal\Aspect\PostconditionCheckerAspect;
23
use PhpDeal\Aspect\PreconditionCheckerAspect;
24
25
/**
26
 * Main kernel class for enabling "design by contract" paradigm
27
 */
28
class ContractApplication extends AspectKernel
29
{
30
31
    /**
32
     * Configures an AspectContainer with advisors, aspects and pointcuts
33
     *
34
     * @param AspectContainer&GoAspectContainer $container
0 ignored issues
show
Documentation introduced by
The doc-type AspectContainer&GoAspectContainer could not be parsed: Unknown type name "AspectContainer&GoAspectContainer" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
35
     *
36
     * @return void
37
     */
38
    protected function configureAop(AspectContainer $container): void
39
    {
40
        /** @var AnnotationReader $reader */
41
        $reader = $container->get('aspect.annotation.reader');
42
43
        $container->registerAspect(new InvariantCheckerAspect($reader));
44
        $container->registerAspect(new PostconditionCheckerAspect($reader));
45
        $container->registerAspect(new PreconditionCheckerAspect($reader));
46
        $container->registerAspect(new InheritCheckerAspect($reader));
47
    }
48
}
49