Passed
Push — stable ( 85ed36...e7655b )
by Nuno
12:43 queued 11s
created

ConfigureIO   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 22
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A of() 0 8 1
1
<?php
2
3
/**
4
 * This file is part of Collision.
5
 *
6
 * (c) Nuno Maduro <[email protected]>
7
 *
8
 *  For the full copyright and license information, please view the LICENSE
9
 *  file that was distributed with this source code.
10
 */
11
12
namespace NunoMaduro\Collision\Adapters\Phpunit;
13
14
use ReflectionObject;
15
use Symfony\Component\Console\Application;
16
use Symfony\Component\Console\Input\InputInterface;
17
use Symfony\Component\Console\Output\Output;
18
19
/**
20
 * @internal
21
 */
22
final class ConfigureIO
23
{
24
    /**
25
     * Configures both given input and output with
26
     * options from the enviroment.
27
     *
28
     * @param  InputInterface  $input
29
     * @param  Output  $output
30
     *
31
     * @return void
32
     *
33
     * @throws \ReflectionException
34
     */
35 3
    public static function of(InputInterface $input, Output $output): void
36
    {
37 3
        $application = new Application();
38 3
        $reflector = new ReflectionObject($application);
39 3
        $method = $reflector->getMethod('configureIO');
40 3
        $method->setAccessible(true);
41 3
        $method->invoke($application, $input, $output);
42 3
    }
43
}
44
45