Skip to content

Patcher fatals silently ignored #1138

@kkmuffme

Description

@kkmuffme

Bug report

Question Answer
PHP-Scoper version 0.18.18

#869 deprecated --stop-on-failure
Because the scoper catches all execptions and logs them https://github.com/humbug/php-scoper/blob/main/src/Console/ConsoleScoper.php#L356 only if OutputInterface::VERBOSITY_VERY_VERBOSE (-vv) this means that if there's an exception in a patcher, the execption is silently "swallowed" and the file not scoped.

However using -vv isn't practiable, since it includes tons of other, non-error and useless output.

Therefore, I suggest:

  • In terms of usability, and to stay closely to PHP's original behavior, I think it would make a lot of sense if the default behavior of outputWarnOfFailure is to always print exceptions - remove https://github.com/humbug/php-scoper/blob/main/src/Console/ScoperLogger.php#L125 condition at least for any exceptions that are not from within scoper itself
  • undeprecate --stop-on-failure to allow complex patcher set ups to handle exceptions in their own (PHP defined/native exception handler)

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