Passed
Branch main (b6a268)
by Iain
04:11
created

SubscriptionsCompilerPass::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Copyright Humbly Arrogant Ltd 2020-2022.
7
 *
8
 * Use of this software is governed by the Business Source License included in the LICENSE file and at https://getparthenon.com/docs/next/license.
9
 *
10
 * Change Date: TBD ( 3 years after 2.0.0 release )
11
 *
12
 * On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
13
 */
14
15
namespace Parthenon\Subscriptions\CompilerPass;
16
17
use Parthenon\Common\Compiler\AbstractCompilerPass;
18
use Parthenon\Subscriptions\Transition\ToActiveManager;
19
use Parthenon\Subscriptions\Transition\ToCancelledManager;
20
use Parthenon\Subscriptions\Transition\ToOverdueManager;
21
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
22
use Symfony\Component\DependencyInjection\ContainerBuilder;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Depend...ection\ContainerBuilder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
23
24
final class SubscriptionsCompilerPass extends AbstractCompilerPass implements CompilerPassInterface
25
{
26
    public function process(ContainerBuilder $container)
27
    {
28
        $this->handle($container, 'parthenon.subscriptions.plan.counter_manager', 'parthenon.subscriptions.plan.counter', 'add');
29
        $this->handle($container, ToActiveManager::class, 'parthenon.subscriptions.transitions.to_active', 'addTransition');
30
        $this->handle($container, ToOverdueManager::class, 'parthenon.subscriptions.transitions.to_overdue', 'addTransition');
31
        $this->handle($container, ToCancelledManager::class, 'parthenon.subscriptions.transitions.to_cancelled', 'addTransition');
32
    }
33
}
34