Skip to content

Commit 4d8f354

Browse files
committed
Move Swoole-nyholm to a new package
1 parent c3b4c34 commit 4d8f354

File tree

6 files changed

+0
-179
lines changed

6 files changed

+0
-179
lines changed

README.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,6 @@ return function () {
3636
};
3737
```
3838

39-
### PSR
40-
41-
```php
42-
// public/index.php
43-
44-
use Nyholm\Psr7\Response;
45-
use Psr\Http\Message\ResponseInterface;
46-
use Psr\Http\Message\ServerRequestInterface;
47-
use Psr\Http\Server\RequestHandlerInterface;
48-
49-
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
50-
51-
class App implements RequestHandlerInterface {
52-
public function handle(ServerRequestInterface $request): ResponseInterface {
53-
$name = $request->getQueryParams()['name'] ?? 'World';
54-
return new Response(200, ['Server' => 'swoole-runtime'], "Hello, $name!");
55-
}
56-
}
57-
58-
return function(): RequestHandlerInterface {
59-
return new App();
60-
};
61-
```
62-
6339
### Symfony
6440

6541
```php

composer.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
}
1111
],
1212
"require": {
13-
"nyholm/psr7": "^1.4",
14-
"psr/http-server-handler": "^1.0",
1513
"symfony/runtime": "^5.3 || ^6.0"
1614
},
1715
"require-dev": {

src/RequestHandlerRunner.php

Lines changed: 0 additions & 81 deletions
This file was deleted.

src/Runtime.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Runtime\Swoole;
44

55
use Illuminate\Contracts\Http\Kernel;
6-
use Psr\Http\Server\RequestHandlerInterface;
76
use Symfony\Component\HttpKernel\HttpKernelInterface;
87
use Symfony\Component\Runtime\RunnerInterface;
98
use Symfony\Component\Runtime\SymfonyRuntime;
@@ -38,10 +37,6 @@ public function getRunner(?object $application): RunnerInterface
3837
return new LaravelRunner($this->serverFactory, $application);
3938
}
4039

41-
if ($application instanceof RequestHandlerInterface) {
42-
return new RequestHandlerRunner($this->serverFactory, $application);
43-
}
44-
4540
return parent::getRunner($application);
4641
}
4742
}

tests/Unit/RequestHandlerRunnerTest.php

Lines changed: 0 additions & 54 deletions
This file was deleted.

tests/Unit/RuntimeTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44

55
use Illuminate\Contracts\Http\Kernel;
66
use PHPUnit\Framework\TestCase;
7-
use Psr\Http\Server\RequestHandlerInterface;
87
use Runtime\Swoole\CallableRunner;
98
use Runtime\Swoole\LaravelRunner;
10-
use Runtime\Swoole\RequestHandlerRunner;
119
use Runtime\Swoole\Runtime;
1210
use Runtime\Swoole\SymfonyRunner;
1311
use Symfony\Component\HttpKernel\HttpKernelInterface;
@@ -49,17 +47,6 @@ public function testGetRunnerCreatesARunnerForLaravel(): void
4947
self::assertInstanceOf(LaravelRunner::class, $runner);
5048
}
5149

52-
public function testGetRunnerCreatesARunnerForRequestHandlers(): void
53-
{
54-
$options = [];
55-
$runtime = new Runtime($options);
56-
57-
$application = $this->createMock(RequestHandlerInterface::class);
58-
$runner = $runtime->getRunner($application);
59-
60-
self::assertInstanceOf(RequestHandlerRunner::class, $runner);
61-
}
62-
6350
public function testGetRunnerFallbacksToClosureRunner(): void
6451
{
6552
$options = [];

0 commit comments

Comments
 (0)