WellCommerceBundleFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
3
namespace WellCommerce\Bundle\GeneratorBundle\Factory;
4
5
use WellCommerce\Bundle\GeneratorBundle\Model\WellCommerceBundle;
6
7
/**
8
 * Class WellCommerceBundleFactory
9
 *
10
 * @author  Adam Piotrowski <[email protected]>
11
 */
12
final class WellCommerceBundleFactory
13
{
14
    public function create(string $class): WellCommerceBundle
15
    {
16
        $reflectionClass = new \ReflectionClass($class);
17
        $shortName       = $reflectionClass->getShortName();
18
        $namespace       = $reflectionClass->getNamespaceName();
19
        $targetDirectory = dirname($reflectionClass->getFileName());
20
        
21
        return new WellCommerceBundle($namespace, $shortName, $targetDirectory, 'yml', true);
0 ignored issues
show
Bug introduced by
The call to WellCommerceBundle::__construct() misses a required argument $isShared.

This check looks for function calls that miss required arguments.

Loading history...
22
    }
23
}
24