Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

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