Skip to content

Warnings mess up stdout #774

@geek-merlin

Description

@geek-merlin

The Story

$ vendor/bin/castor compile my-app.linux.phar -v
...
In CompileCommand.php line 287:
  [ErrorException]                                
  Warning: Trying to access array offset on null

The Offending Code

        $p = new Process([\PHP_BINARY, $input->getArgument('phar-path'), 'list', '--format', 'json']);
        $p->mustRun();
        $appName = json_decode($p->getOutput(), true)['application']['name'];

The Debugging

The process output has

The deeper problem

Fixing #772 will fix the problem, but it may be only a bandaid for a deeper problem: That warnings go to stdout and not stderr, torpedoing output parsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions