Skip to content

Commit f23a6e7

Browse files
committed
Make CI/CD checks pass
1 parent 569d423 commit f23a6e7

File tree

17 files changed

+337
-306
lines changed

17 files changed

+337
-306
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.
2-
31
<p>
42
<img height="45" src="docs/logo.png" alt="Logo">
53
</p>

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
},
3535
"require-dev": {
3636
"phpunit/phpunit": "^9.5.25",
37-
"laravel/pint": "^1.2",
37+
"laravel/pint": "1.*",
3838
"swoole/ide-helper": "4.8.3",
39-
"phpstan/phpstan": "^1.10",
39+
"phpstan/phpstan": "1.*",
4040
"phpbench/phpbench": "^1.2"
4141
}
4242
}

composer.lock

Lines changed: 301 additions & 268 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Http/Adapter/FPM/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getRawPayload(): string
3636
* @param string|null $default
3737
* @return string|null
3838
*/
39-
public function getServer(string $key, string $default = null): ?string
39+
public function getServer(string $key, ?string $default = null): ?string
4040
{
4141
return $_SERVER[$key] ?? $default;
4242
}

src/Http/Adapter/FPM/Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public function write(string $content): bool
2525
*
2626
* Send optional content and end
2727
*
28-
* @param string $content
28+
* @param string|null $content
2929
* @return void
3030
*/
31-
public function end(string $content = null): void
31+
public function end(?string $content = null): void
3232
{
3333
if (!is_null($content)) {
3434
echo $content;

src/Http/Adapter/Swoole/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function getRawPayload(): string
4343
* @param string|null $default
4444
* @return string|null
4545
*/
46-
public function getServer(string $key, string $default = null): ?string
46+
public function getServer(string $key, ?string $default = null): ?string
4747
{
4848
return $this->swoole->server[$key] ?? $default;
4949
}

src/Http/Adapter/Swoole/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function write(string $content): bool
4545
* @param string|null $content
4646
* @return void
4747
*/
48-
public function end(string $content = null): void
48+
public function end(?string $content = null): void
4949
{
5050
$this->swoole->end($content);
5151
}

src/Http/Adapter/Swoole/Server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Server extends Adapter
1515
{
1616
protected SwooleServer $server;
1717

18-
public function __construct(string $host, string $port = null, array $settings = [])
18+
public function __construct(string $host, ?string $port = null, array $settings = [])
1919
{
2020
$this->server = new SwooleServer($host, $port);
2121
$this->server->set(\array_merge($settings, [
@@ -42,7 +42,7 @@ public function onStart(callable $callback)
4242

4343
public function start()
4444
{
45-
if(Coroutine::getCid() === -1) {
45+
if (Coroutine::getCid() === -1) {
4646
run(fn () => $this->server->start());
4747
} else {
4848
$this->server->start();

src/Http/Files.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getCount(): int
8383
*
8484
* @throws \Exception
8585
*/
86-
public function load(string $directory, string $root = null): void
86+
public function load(string $directory, ?string $root = null): void
8787
{
8888
if (!is_readable($directory)) {
8989
throw new Exception("Failed to load directory: {$directory}");

src/Http/Http.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public static function error(): Hook
295295
* @param string|null $default
296296
* @return string|null
297297
*/
298-
public static function getEnv(string $key, string $default = null): ?string
298+
public static function getEnv(string $key, ?string $default = null): ?string
299299
{
300300
return $_SERVER[$key] ?? $default;
301301
}
@@ -366,7 +366,7 @@ public function getResource(string $name, string $context = 'utopia', bool $fres
366366
$this->resources[$context] ??= [];
367367

368368
$resourcesCallback = &self::$resourcesCallbacks[$context] ?? [];
369-
if(empty($resourcesCallback) || !\array_key_exists($name, $resourcesCallback)) {
369+
if (empty($resourcesCallback) || !\array_key_exists($name, $resourcesCallback)) {
370370
$resourcesCallback = &self::$resourcesCallbacks['utopia'];
371371
}
372372

@@ -514,7 +514,7 @@ public static function addRoute(string $method, string $url): Route
514514
*
515515
* @throws \Exception
516516
*/
517-
public function loadFiles(string $directory, string $root = null): void
517+
public function loadFiles(string $directory, ?string $root = null): void
518518
{
519519
$this->files->load($directory, $root);
520520
}
@@ -576,7 +576,7 @@ public function start()
576576
try {
577577
$this->run($request, $response, $context);
578578
} finally {
579-
if(isset(self::$resourcesCallbacks[$context])) {
579+
if (isset(self::$resourcesCallbacks[$context])) {
580580
unset(self::$resourcesCallbacks[$context]);
581581
}
582582
}
@@ -593,7 +593,7 @@ public function start()
593593
$arguments = $this->getArguments($hook, 'utopia', [], []);
594594
\call_user_func_array($hook->getAction(), $arguments);
595595
}
596-
} catch(\Exception $e) {
596+
} catch (\Exception $e) {
597597
self::setResource('error', fn () => $e);
598598

599599
foreach (self::$errors as $error) { // Global error hooks
@@ -793,7 +793,7 @@ public function run(Request $request, Response $response, string $context): stat
793793
$arguments = $this->getArguments($hook, $context, [], []);
794794
\call_user_func_array($hook->getAction(), $arguments);
795795
}
796-
} catch(\Exception $e) {
796+
} catch (\Exception $e) {
797797
self::setResource('error', fn () => $e, [], $context);
798798

799799
foreach (self::$errors as $error) { // Global error hooks

0 commit comments

Comments
 (0)