SyncCommandFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 17
rs 10
ccs 6
cts 6
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 10 1
1
<?php
2
declare(strict_types=1);
3
4
namespace TogglJira\Command;
5
6
use Interop\Container\ContainerInterface;
7
use TogglJira\Options\SyncOptions;
8
use TogglJira\Service\SyncService;
9
use Zend\Config\Writer\Json;
10
use Zend\ServiceManager\Factory\FactoryInterface;
11
12
class SyncCommandFactory implements FactoryInterface
13
{
14
15
    /**
16
     * {@inheritdoc}
17
     * @throws \Exception
18
     */
19 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null): SyncCommand
20
    {
21
        /** @var SyncOptions $options */
22 1
        $syncOptions = $container->get(SyncOptions::class);
23 1
        $writer = new Json();
24
        
25 1
        $command = new SyncCommand($container->get(SyncService::class), $syncOptions, $writer);
26 1
        $command->setLogger($container->get('Logger'));
27
28 1
        return $command;
29
    }
30
}
31