JFIF  x x C         C     "        } !1AQa "q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz        w !1AQ aq"2B #3Rbr{ gilour

File "ReportablePrinter.php"

Full Path: /home/palsarh/web/palsarh.in/public_html/vendor/nunomaduro/collision/src/Adapters/Phpunit/Printers/ReportablePrinter.php
File size: 703 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

declare(strict_types=1);

namespace NunoMaduro\Collision\Adapters\Phpunit\Printers;

use Throwable;

/**
 * @internal
 *
 * @mixin DefaultPrinter
 */
final class ReportablePrinter
{
    /**
     * Creates a new Printer instance.
     */
    public function __construct(private readonly DefaultPrinter $printer)
    {
        // ..
    }

    /**
     * Calls the original method, but reports any errors to the reporter.
     */
    public function __call(string $name, array $arguments): mixed
    {
        try {
            return $this->printer->$name(...$arguments);
        } catch (Throwable $throwable) {
            $this->printer->report($throwable);
        }

        exit(1);
    }
}