ConfigureIO   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
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 17
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
     * @throws \ReflectionException
29
     */
30 3
    public static function of(InputInterface $input, Output $output): void
31
    {
32 3
        $application = new Application();
33 3
        $reflector   = new ReflectionObject($application);
34 3
        $method      = $reflector->getMethod('configureIO');
35 3
        $method->setAccessible(true);
36 3
        $method->invoke($application, $input, $output);
37 3
    }
38
}
39