Completed
Pull Request — 1.x (#214)
by Yuu
03:24 queued 55s
created

CliModule   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 28.57%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 14
ccs 2
cts 7
cp 0.2857
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
1
<?php
2
/**
3
 * This file is part of the BEAR.Package package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace BEAR\Package\Context;
8
9
use BEAR\Package\Annotation\StdIn;
10
use BEAR\Package\Provide\Router\CliRouter;
11
use BEAR\Package\Provide\Transfer\CliResponder;
12
use BEAR\Sunday\Extension\Router\RouterInterface;
13
use BEAR\Sunday\Extension\Transfer\TransferInterface;
14
use Ray\Di\AbstractModule;
15
16
class CliModule extends AbstractModule
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21 2
    protected function configure()
22
    {
23
        $this->rename(RouterInterface::class, 'original');
24
        $this->bind(RouterInterface::class)->to(CliRouter::class);
25
        $this->bind(TransferInterface::class)->to(CliResponder::class);
26
        $stdIn = tempnam(sys_get_temp_dir(), 'stdin-' . crc32(__FILE__));
27
        $this->bind()->annotatedWith(StdIn::class)->toInstance($stdIn);
28 2
    }
29
}
30