Skip to content

Commit 1ac33a5

Browse files
committed
minor docblock refactors
1 parent e48eb28 commit 1ac33a5

File tree

4 files changed

+19
-24
lines changed

4 files changed

+19
-24
lines changed

src/Engine.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232
* @method void stop(?int $code = null)
3333
* @method void halt(int $code = 200, string $message = '', bool $actuallyExit = true)
3434
* @method EventDispatcher eventDispatcher()
35-
* @method Route route(string $pattern, callable|string|array $callback, bool $pass_route = false, string $alias = '')
36-
* @method void group(string $pattern, callable $callback, array $group_middlewares = [])
37-
* @method Route post(string $pattern, callable|string|array $callback, bool $pass_route = false, string $alias = '')
38-
* @method Route put(string $pattern, callable|string|array $callback, bool $pass_route = false, string $alias = '')
39-
* @method Route patch(string $pattern, callable|string|array $callback, bool $pass_route = false, string $alias = '')
40-
* @method Route delete(string $pattern, callable|string|array $callback, bool $pass_route = false, string $alias = '')
41-
* @method void resource(string $pattern, string $controllerClass, array $methods = [])
35+
* @method Route route(string $pattern, callable|string|array{0: class-string, 1: string} $callback, bool $pass_route = false, string $alias = '')
36+
* @method void group(string $pattern, callable $callback, array<int, class-string|callable|array{0: class-string, 1: string}> $group_middlewares = [])
37+
* @method Route post(string $pattern, callable|string|array{0: class-string, 1: string} $callback, bool $pass_route = false, string $alias = '')
38+
* @method Route put(string $pattern, callable|string|array{0: class-string, 1: string} $callback, bool $pass_route = false, string $alias = '')
39+
* @method Route patch(string $pattern, callable|string|array{0: class-string, 1: string} $callback, bool $pass_route = false, string $alias = '')
40+
* @method Route delete(string $pattern, callable|string|array{0: class-string, 1: string} $callback, bool $pass_route = false, string $alias = '')
41+
* @method void resource(string $pattern, class-string $controllerClass, array<string, string|array<int, string>> $methods = [])
4242
* @method Router router()
43-
* @method string getUrl(string $alias)
44-
* @method void render(string $file, array $data = null, string $key = null)
43+
* @method string getUrl(string $alias, array<string, mixed> $params)
44+
* @method void render(string $file, ?array<string, mixed> $data, string $key = null)
4545
* @method View view()
4646
* @method void onEvent(string $event, callable $callback)
4747
* @method void triggerEvent(string $event, ...$args)

src/Flight.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public static function clear(?string $key = null): void
206206
self::app()->clear($key);
207207
}
208208

209-
/** @param array<string, mixed> $data */
209+
/** @param ?array<string, mixed> $data */
210210
public static function render(string $file, ?array $data = null, ?string $key = null): void
211211
{
212212
self::app()->render($file, $data, $key);
@@ -222,7 +222,7 @@ public static function onEvent(string $event, callable $callback): void
222222
self::app()->onEvent($event, $callback);
223223
}
224224

225-
/** @param ...mixed $args */
225+
/** @param mixed ...$args */
226226
public static function triggerEvent(string $event, ...$args): void
227227
{
228228
self::app()->triggerEvent($event, ...$args);
@@ -249,10 +249,9 @@ public static function json(
249249
int $code = 200,
250250
bool $encode = true,
251251
string $charset = 'utf8',
252-
int $encodeOption = 0,
253-
int $encodeDepth = 512
252+
int $encodeOption = 0
254253
): void {
255-
self::app()->json($data, $code, $encode, $charset, $encodeOption, $encodeDepth);
254+
self::app()->json($data, $code, $encode, $charset, $encodeOption);
256255
}
257256

258257
/** @param mixed $data */
@@ -261,10 +260,9 @@ public static function jsonHalt(
261260
int $code = 200,
262261
bool $encode = true,
263262
string $charset = 'utf8',
264-
int $encodeOption = 0,
265-
int $encodeDepth = 512
263+
int $encodeOption = 0
266264
): void {
267-
self::app()->jsonHalt($data, $code, $encode, $charset, $encodeOption, $encodeDepth);
265+
self::app()->jsonHalt($data, $code, $encode, $charset, $encodeOption);
268266
}
269267

270268
/** @param mixed $data */
@@ -274,10 +272,9 @@ public static function jsonp(
274272
int $code = 200,
275273
bool $encode = true,
276274
string $charset = 'utf8',
277-
int $encodeOption = 0,
278-
int $encodeDepth = 512
275+
int $encodeOption = 0
279276
): void {
280-
self::app()->jsonp($data, $param, $code, $encode, $charset, $encodeOption, $encodeDepth);
277+
self::app()->jsonp($data, $param, $code, $encode, $charset, $encodeOption);
281278
}
282279

283280
public static function error(Throwable $exception): void

src/core/Dispatcher.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
* allows you to hook other functions to an event that can modify the
1919
* input parameters and/or the output.
2020
*
21-
* @license MIT, http://flightphp.com/license
21+
* @license MIT, https://docs.flightphp.com/license/
2222
* @copyright Copyright (c) 2011, Mike Cao <mike@mikecao.com>
23-
* @phpstan-template EngineTemplate of object
2423
*/
2524
class Dispatcher
2625
{
@@ -30,7 +29,6 @@ class Dispatcher
3029
/** Exception message if thrown by setting the container as a callable method. */
3130
protected ?Throwable $containerException = null;
3231

33-
/** @var ?Engine<EngineTemplate> $engine Engine instance. */
3432
protected ?Engine $engine = null;
3533

3634
/** @var array<string, callable(): (void|mixed)> Mapped events. */

src/core/Loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* The Loader class is responsible for loading objects. It maintains a list of
1111
* reusable class instances and can generate a new class instances with custom
12-
* initialization parameters. It also performs class autoloading.
12+
* initialization parameters.
1313
* @license MIT, https://docs.flightphp.com/license/
1414
* @copyright Copyright (c) 2011, Mike Cao <mike@mikecao.com>
1515
*/

0 commit comments

Comments
 (0)