StandardProvisionerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 22
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A visit() 0 11 1
1
<?php
2
3
/**
4
 * AppserverIo\Provisioning\StandardProvisionerFactory
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2018 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/appserver-io/provisioning
18
 * @link      http://www.appserver.io
19
 */
20
21
namespace AppserverIo\Provisioning;
22
23
use AppserverIo\Psr\Application\ApplicationInterface;
24
use AppserverIo\Provisioning\Configuration\ProvisionerConfigurationInterface;
25
26
/**
27
 * Factory for the standard provisioner.
28
 *
29
 * @author    Tim Wagner <[email protected]>
30
 * @copyright 2018 TechDivision GmbH <[email protected]>
31
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
32
 * @link      https://github.com/appserver-io/provisioning
33
 * @link      http://www.appserver.io
34
 */
35
class StandardProvisionerFactory
36
{
37
38
    /**
39
     * The main method that creates a new provisioner instance.
40
     *
41
     * @param \AppserverIo\Psr\Application\ApplicationInterface                         $application              The application instance to register the provisioner with
42
     * @param \AppserverIo\Provisioning\Configuration\ProvisionerConfigurationInterface $provisionerConfiguration The provisioner configuration
43
     *
44
     * @return void
45
     */
46
    public static function visit(ApplicationInterface $application, ProvisionerConfigurationInterface $provisionerConfiguration)
47
    {
48
49
        // load the initial context
50
        $initialContext = $application->getInitialContext();
0 ignored issues
show
Bug introduced by
The method getInitialContext() does not exist on AppserverIo\Psr\Application\ApplicationInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

50
        /** @scrutinizer ignore-call */ 
51
        $initialContext = $application->getInitialContext();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
51
52
        // initialize the bean manager
53
        $provisioner = new StandardProvisioner($initialContext, $provisionerConfiguration);
54
55
        // attach the instance
56
        $application->addProvisioner($provisioner, $provisionerConfiguration);
0 ignored issues
show
Bug introduced by
The method addProvisioner() does not exist on AppserverIo\Psr\Application\ApplicationInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

56
        $application->/** @scrutinizer ignore-call */ 
57
                      addProvisioner($provisioner, $provisionerConfiguration);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
57
    }
58
}
59