Completed
Pull Request — master (#8)
by Alexandre
06:20
created

ExemplifyExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 13 1
1
<?php
2
3
namespace RMiller\ExemplifyExtension;
4
5
use PhpSpec\Extension\ExtensionInterface;
6
use PhpSpec\ServiceContainer;
7
use RMiller\ExemplifyExtension\Command\ExemplifyCommand;
8
use RMiller\ExemplifyExtension\Generator\SpecificationMethodGenerator;
9
10
class ExemplifyExtension implements ExtensionInterface
11
{
12
    /**
13
     * @param ServiceContainer $container
14
     */
15
    public function load(ServiceContainer $container)
16
    {
17
        $container->set('code_generator.generators.specification_method', function (ServiceContainer $c) {
18
            return new SpecificationMethodGenerator(
19
                $c->get('console.io'),
20
                $c->get('code_generator.templates')
21
            );
22
        });
23
24
        $container->setShared('console.commands.exemplify', function () {
25
            return new ExemplifyCommand();
26
        });
27
    }
28
}
29