From 234510d783745f3265029c71087cf8a8866ce6d0 Mon Sep 17 00:00:00 2001
From: Mateusz Charytoniuk <mateusz.charytoniuk@protonmail.com>
Date: Mon, 25 Mar 2024 16:47:13 +0100
Subject: [PATCH] chore: remove unnecessary phpunit extension

---
 phpunit.xml                             |  4 ---
 src/PHPUnitSwooleCoroutineExtension.php | 43 -------------------------
 2 files changed, 47 deletions(-)
 delete mode 100644 src/PHPUnitSwooleCoroutineExtension.php

diff --git a/phpunit.xml b/phpunit.xml
index 3fd52b7b..f960f454 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -18,8 +18,4 @@
             <directory suffix=".php">src</directory>
         </include>
     </source>
-    <extensions>
-        <bootstrap class="Distantmagic\Resonance\PHPUnitSwooleCoroutineExtension">
-        </bootstrap>
-    </extensions>
 </phpunit>
diff --git a/src/PHPUnitSwooleCoroutineExtension.php b/src/PHPUnitSwooleCoroutineExtension.php
deleted file mode 100644
index 9128a229..00000000
--- a/src/PHPUnitSwooleCoroutineExtension.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Distantmagic\Resonance;
-
-use PHPUnit\Event\TestRunner\Finished;
-use PHPUnit\Event\TestRunner\FinishedSubscriber;
-use PHPUnit\Runner\Extension\Extension;
-use PHPUnit\Runner\Extension\Facade as EventFacade;
-use PHPUnit\Runner\Extension\ParameterCollection;
-use PHPUnit\TextUI\Configuration\Configuration;
-use Swoole\Coroutine;
-use Swoole\Timer;
-
-final class PHPUnitSwooleCoroutineExtension implements Extension
-{
-    public function bootstrap(Configuration $configuration, EventFacade $facade, ParameterCollection $parameters): void
-    {
-        $facade->registerSubscriber(new class($this) implements FinishedSubscriber {
-            public function __construct(private PHPUnitSwooleCoroutineExtension $thisClass) {}
-
-            public function notify(Finished $event): void
-            {
-                $this->thisClass->executeAfterLastTest();
-            }
-        });
-    }
-
-    public function executeAfterLastTest(): void
-    {
-        /**
-         * @var array{ coroutine_num: int } $coroutineStats
-         */
-        $coroutineStats = Coroutine::stats();
-
-        while ($coroutineStats['coroutine_num'] > 1) {
-            Coroutine::sleep(0.1);
-        }
-
-        Timer::clearAll();
-    }
-}
-- 
GitLab