sebastianbergmann / phpcov

TextUI frontend for php-code-coverage
BSD 3-Clause "New" or "Revised" License
223 stars 58 forks source link

phpcov should mask its arguments from script that is being executed #86

Closed ostrolucky closed 5 years ago

ostrolucky commented 5 years ago

Given following simple script

<?php

use Symfony\Component\Console\Output\OutputInterface;

require_once __DIR__.'/../vendor/autoload.php';

(new \Symfony\Component\Console\Application())
    ->register('greeter')
    ->addArgument('message', null, 'world')
    ->setCode(function(\Symfony\Component\Console\Input\InputInterface $input, OutputInterface $output) {
        $output->writeln('hello ' . $input->getArgument('message'));
    })
    ->getApplication()
    ->setDefaultCommand('greeter', true)
    ->run()
;

When phpcov executes it via phpcov execute greeter.php Then script should output hello, not

Too many arguments, expected arguments "message".

ostrolucky commented 5 years ago

Mistakenly I thought error comes from the application, but it comes from phpcov itself