?????????? ????????? - ??????????????? - /home/agenciai/public_html/cd38d8/ResultCache.zip
???????
PK �E(\>)� � NullResultCache.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Framework\TestStatus\TestStatus; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NullResultCache implements ResultCache { public function setStatus(string $id, TestStatus $status): void { } public function status(string $id): TestStatus { return TestStatus::unknown(); } public function setTime(string $id, float $time): void { } public function time(string $id): float { return 0; } public function load(): void { } public function persist(): void { } } PK �E(\q�P� � $ Subscriber/TestErroredSubscriber.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\ErroredSubscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestErroredSubscriber extends Subscriber implements ErroredSubscriber { public function notify(Errored $event): void { $this->handler()->testErrored($event); } } PK �E(\� ,� % Subscriber/TestPreparedSubscriber.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\PreparedSubscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber { public function notify(Prepared $event): void { $this->handler()->testPrepared($event); } } PK �E(\���� � # Subscriber/TestFailedSubscriber.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\FailedSubscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFailedSubscriber extends Subscriber implements FailedSubscriber { public function notify(Failed $event): void { $this->handler()->testFailed($event); } } PK �E(\���j Subscriber/Subscriber.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class Subscriber { private readonly ResultCacheHandler $handler; public function __construct(ResultCacheHandler $handler) { $this->handler = $handler; } protected function handler(): ResultCacheHandler { return $this->handler; } } PK �E(\Ġ��� � $ Subscriber/TestSkippedSubscriber.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\SkippedSubscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber { /** * @throws \PHPUnit\Framework\InvalidArgumentException * @throws InvalidArgumentException */ public function notify(Skipped $event): void { $this->handler()->testSkipped($event); } } PK �E(\��. . , Subscriber/TestConsideredRiskySubscriber.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\ConsideredRiskySubscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestConsideredRiskySubscriber extends Subscriber implements ConsideredRiskySubscriber { public function notify(ConsideredRisky $event): void { $this->handler()->testConsideredRisky($event); } } PK �E(\d�ף � % Subscriber/TestFinishedSubscriber.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\FinishedSubscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber { /** * @throws \PHPUnit\Framework\InvalidArgumentException * @throws InvalidArgumentException */ public function notify(Finished $event): void { $this->handler()->testFinished($event); } } PK �E(\7D�� ) Subscriber/TestSuiteStartedSubscriber.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Event\TestSuite\Started; use PHPUnit\Event\TestSuite\StartedSubscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteStartedSubscriber extends Subscriber implements StartedSubscriber { public function notify(Started $event): void { $this->handler()->testSuiteStarted(); } } PK �E(\מ�/4 4 - Subscriber/TestMarkedIncompleteSubscriber.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\MarkedIncompleteSubscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber { public function notify(MarkedIncomplete $event): void { $this->handler()->testMarkedIncomplete($event); } } PK �E(\�Y.8 * Subscriber/TestSuiteFinishedSubscriber.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Event\TestSuite\Finished; use PHPUnit\Event\TestSuite\FinishedSubscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteFinishedSubscriber extends Subscriber implements FinishedSubscriber { public function notify(Finished $event): void { $this->handler()->testSuiteFinished(); } } PK �E(\pͭg g ResultCache.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Framework\TestStatus\TestStatus; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ interface ResultCache { public function setStatus(string $id, TestStatus $status): void; public function status(string $id): TestStatus; public function setTime(string $id, float $time): void; public function time(string $id): float; public function load(): void; public function persist(): void; } PK �E(\���N ResultCacheHandler.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use function round; use PHPUnit\Event\Event; use PHPUnit\Event\EventFacadeIsSealedException; use PHPUnit\Event\Facade; use PHPUnit\Event\Telemetry\HRTime; use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\UnknownSubscriberTypeException; use PHPUnit\Framework\InvalidArgumentException; use PHPUnit\Framework\TestStatus\TestStatus; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ResultCacheHandler { private readonly ResultCache $cache; private ?HRTime $time = null; private int $testSuite = 0; /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ public function __construct(ResultCache $cache, Facade $facade) { $this->cache = $cache; $this->registerSubscribers($facade); } public function testSuiteStarted(): void { $this->testSuite++; } public function testSuiteFinished(): void { $this->testSuite--; if ($this->testSuite === 0) { $this->cache->persist(); } } public function testPrepared(Prepared $event): void { $this->time = $event->telemetryInfo()->time(); } public function testMarkedIncomplete(MarkedIncomplete $event): void { $this->cache->setStatus( $event->test()->id(), TestStatus::incomplete($event->throwable()->message()), ); } public function testConsideredRisky(ConsideredRisky $event): void { $this->cache->setStatus( $event->test()->id(), TestStatus::risky($event->message()), ); } public function testErrored(Errored $event): void { $this->cache->setStatus( $event->test()->id(), TestStatus::error($event->throwable()->message()), ); } public function testFailed(Failed $event): void { $this->cache->setStatus( $event->test()->id(), TestStatus::failure($event->throwable()->message()), ); } /** * @throws \PHPUnit\Event\InvalidArgumentException * @throws InvalidArgumentException */ public function testSkipped(Skipped $event): void { $this->cache->setStatus( $event->test()->id(), TestStatus::skipped($event->message()), ); $this->cache->setTime($event->test()->id(), $this->duration($event)); } /** * @throws \PHPUnit\Event\InvalidArgumentException * @throws InvalidArgumentException */ public function testFinished(Finished $event): void { $this->cache->setTime($event->test()->id(), $this->duration($event)); $this->time = null; } /** * @throws \PHPUnit\Event\InvalidArgumentException * @throws InvalidArgumentException */ private function duration(Event $event): float { if ($this->time === null) { return 0.0; } return round($event->telemetryInfo()->time()->duration($this->time)->asFloat(), 3); } /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ private function registerSubscribers(Facade $facade): void { $facade->registerSubscribers( new TestSuiteStartedSubscriber($this), new TestSuiteFinishedSubscriber($this), new TestPreparedSubscriber($this), new TestMarkedIncompleteSubscriber($this), new TestConsideredRiskySubscriber($this), new TestErroredSubscriber($this), new TestFailedSubscriber($this), new TestSkippedSubscriber($this), new TestFinishedSubscriber($this), ); } } PK �E(\��n DefaultResultCache.phpnu �[��� <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\ResultCache; use const DIRECTORY_SEPARATOR; use const LOCK_EX; use function array_keys; use function assert; use function dirname; use function file_get_contents; use function file_put_contents; use function is_array; use function is_dir; use function is_file; use function json_decode; use function json_encode; use PHPUnit\Framework\TestStatus\TestStatus; use PHPUnit\Runner\DirectoryDoesNotExistException; use PHPUnit\Runner\Exception; use PHPUnit\Util\Filesystem; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DefaultResultCache implements ResultCache { /** * @var int */ private const VERSION = 2; /** * @var string */ private const DEFAULT_RESULT_CACHE_FILENAME = '.phpunit.result.cache'; private readonly string $cacheFilename; /** * @psalm-var array<string, TestStatus> */ private array $defects = []; /** * @psalm-var array<string, float> */ private array $times = []; public function __construct(?string $filepath = null) { if ($filepath !== null && is_dir($filepath)) { $filepath .= DIRECTORY_SEPARATOR . self::DEFAULT_RESULT_CACHE_FILENAME; } $this->cacheFilename = $filepath ?? $_ENV['PHPUNIT_RESULT_CACHE'] ?? self::DEFAULT_RESULT_CACHE_FILENAME; } public function setStatus(string $id, TestStatus $status): void { if ($status->isSuccess()) { return; } $this->defects[$id] = $status; } public function status(string $id): TestStatus { return $this->defects[$id] ?? TestStatus::unknown(); } public function setTime(string $id, float $time): void { $this->times[$id] = $time; } public function time(string $id): float { return $this->times[$id] ?? 0.0; } public function mergeWith(self $other): void { foreach ($other->defects as $id => $defect) { $this->defects[$id] = $defect; } foreach ($other->times as $id => $time) { $this->times[$id] = $time; } } public function load(): void { if (!is_file($this->cacheFilename)) { return; } $contents = file_get_contents($this->cacheFilename); if ($contents === false) { return; } $data = json_decode( $contents, true, ); if ($data === null) { return; } if (!isset($data['version'])) { return; } if ($data['version'] !== self::VERSION) { return; } assert(isset($data['defects']) && is_array($data['defects'])); assert(isset($data['times']) && is_array($data['times'])); foreach (array_keys($data['defects']) as $test) { $data['defects'][$test] = TestStatus::from($data['defects'][$test]); } $this->defects = $data['defects']; $this->times = $data['times']; } /** * @throws Exception */ public function persist(): void { if (!Filesystem::createDirectory(dirname($this->cacheFilename))) { throw new DirectoryDoesNotExistException(dirname($this->cacheFilename)); } $data = [ 'version' => self::VERSION, 'defects' => [], 'times' => $this->times, ]; foreach ($this->defects as $test => $status) { $data['defects'][$test] = $status->asInt(); } file_put_contents( $this->cacheFilename, json_encode($data), LOCK_EX, ); } } PK �E(\>)� � NullResultCache.phpnu �[��� PK �E(\q�P� � $ A Subscriber/TestErroredSubscriber.phpnu �[��� PK �E(\� ,� % � Subscriber/TestPreparedSubscriber.phpnu �[��� PK �E(\���� � # � Subscriber/TestFailedSubscriber.phpnu �[��� PK �E(\���j 7 Subscriber/Subscriber.phpnu �[��� PK �E(\Ġ��� � $ � Subscriber/TestSkippedSubscriber.phpnu �[��� PK �E(\��. . , � Subscriber/TestConsideredRiskySubscriber.phpnu �[��� PK �E(\d�ף � % Subscriber/TestFinishedSubscriber.phpnu �[��� PK �E(\7D�� ) Subscriber/TestSuiteStartedSubscriber.phpnu �[��� PK �E(\מ�/4 4 - g Subscriber/TestMarkedIncompleteSubscriber.phpnu �[��� PK �E(\�Y.8 * �# Subscriber/TestSuiteFinishedSubscriber.phpnu �[��� PK �E(\pͭg g d'