Completed
Push — 4.0 ( 103006...239d44 )
by Ryo
05:55
created

ComposerServiceFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 10 2
1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.lockon.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Eccube\Service\Composer;
15
16
use Eccube\Entity\BaseInfo;
17
use Eccube\Repository\BaseInfoRepository;
18
use Symfony\Component\DependencyInjection\ContainerInterface;
19
20
class ComposerServiceFactory
21
{
22
    public static function createService(ContainerInterface $container)
23
    {
24
        /** @var BaseInfo $BaseInfo */
25
        $BaseInfo = $container->get(BaseInfoRepository::class)->get();
26
        if (!empty($BaseInfo->getPhpPath())) {
27
            return $container->get(ComposerProcessService::class);
28
        }
29
30
        return $container->get(ComposerApiService::class);
31
    }
32
}
33