Repository: laravel/octane (language: php)

Issue:
Uncaught Error: Call to undefined method Swoole\Http\Server::tick
- Octane Version: 1.2.16
- Laravel Version: 9.22.1
- PHP Version: 8.1.8
- Server & Version: Swoole 5.0.0
- Database Driver & Version:

### Description:
```bash
app-1  | Fatal error: Uncaught Error: Call to undefined method Swoole\Http\Server::tick() in /var/www/vendor/laravel/octane/src/Swoole/Handlers/OnServerStart.php:40
app-1  | Stack trace:
app-1  | #0 /var/www/vendor/laravel/octane/bin/swoole-server(57): Laravel\Octane\Swoole\Handlers\OnServerStart->__invoke(Object(Swoole\Http\Server))
app-1  | #1 [internal function]: {closure}(Object(Swoole\Http\Server))
app-1  | #2 /var/www/vendor/laravel/octane/bin/swoole-server(164): Swoole\Server->start()
app-1  | #3 {main}
app-1  |   thrown in /var/www/vendor/laravel/octane/src/Swoole/Handlers/OnServerStart.php on line 40
```
swool version 5.0.0 raise this error

![image](https://user-images.githubusercontent.com/27611405/182373153-163fd9b5-e749-4312-a0b5-e30a348f2308.png)


### Steps To Reproduce:
1. pecl install swool
2. php artisan octane:start --host=docker.host.internal --port=8000 --workers=4 --task-workers=6 --max-requests=250

<!-- If possible, please provide a GitHub repository to demonstrate your issue -->
<!-- laravel new bug-report --github="--public" -->



Discussion / hints:
Not sure if we already suppport Swoole v5?
downgrade swool 5 to  4 and it working!!
I confirm that Octane currently does not support Swoole 5. I am currently working on getting Octane ready for it.

Fix patch:
diff --git a/src/Swoole/Handlers/OnServerStart.php b/src/Swoole/Handlers/OnServerStart.php
index 5cd1f6dfe..64943571d 100644
--- a/src/Swoole/Handlers/OnServerStart.php
+++ b/src/Swoole/Handlers/OnServerStart.php
@@ -5,6 +5,7 @@
 use Laravel\Octane\Swoole\Actions\EnsureRequestsDontExceedMaxExecutionTime;
 use Laravel\Octane\Swoole\ServerStateFile;
 use Laravel\Octane\Swoole\SwooleExtension;
+use Swoole\Timer;
 
 class OnServerStart
 {
@@ -37,13 +38,13 @@ public function __invoke($server)
         }
 
         if ($this->shouldTick) {
-            $server->tick(1000, function () use ($server) {
+            Timer::tick(1000, function () use ($server) {
                 $server->task('octane-tick');
             });
         }
 
         if ($this->maxExecutionTime > 0) {
-            $server->tick(1000, function () use ($server) {
+            Timer::tick(1000, function () use ($server) {
                 (new EnsureRequestsDontExceedMaxExecutionTime(
                     $this->extension, $this->timerTable, $this->maxExecutionTime, $server
                 ))();
diff --git a/src/Swoole/Handlers/OnWorkerStart.php b/src/Swoole/Handlers/OnWorkerStart.php
index fc6d41152..4d27b0356 100644
--- a/src/Swoole/Handlers/OnWorkerStart.php
+++ b/src/Swoole/Handlers/OnWorkerStart.php
@@ -83,12 +83,7 @@ protected function bootWorker($server)
      */
     protected function dispatchServerTickTaskEverySecond($server)
     {
-        // if ($this->workerState->workerId === 0 &&
-        //     ($this->serverState['octaneConfig']['tick'] ?? true)) {
-        //     $this->workerState->tickTimerId = $server->tick(1000, function () use ($server) {
-        //         $server->task('octane-tick');
-        //     });
-        // }
+        // ...
     }
 
     /**


Test patch: