Completed
Pull Request — master (#8)
by Alexandre
03:10
created

ExemplifyExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 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