minor docblock refactors

v4
fadrian06 21 hours ago
parent e48eb283b5
commit 1ac33a5d27

@ -32,16 +32,16 @@ use Psr\Container\ContainerInterface;
* @method void stop(?int $code = null)
* @method void halt(int $code = 200, string $message = '', bool $actuallyExit = true)
* @method EventDispatcher eventDispatcher()
* @method Route route(string $pattern, callable|string|array $callback, bool $pass_route = false, string $alias = '')
* @method void group(string $pattern, callable $callback, array $group_middlewares = [])
* @method Route post(string $pattern, callable|string|array $callback, bool $pass_route = false, string $alias = '')
* @method Route put(string $pattern, callable|string|array $callback, bool $pass_route = false, string $alias = '')
* @method Route patch(string $pattern, callable|string|array $callback, bool $pass_route = false, string $alias = '')
* @method Route delete(string $pattern, callable|string|array $callback, bool $pass_route = false, string $alias = '')
* @method void resource(string $pattern, string $controllerClass, array $methods = [])
* @method Route route(string $pattern, callable|string|array{0: class-string, 1: string} $callback, bool $pass_route = false, string $alias = '')
* @method void group(string $pattern, callable $callback, array<int, class-string|callable|array{0: class-string, 1: string}> $group_middlewares = [])
* @method Route post(string $pattern, callable|string|array{0: class-string, 1: string} $callback, bool $pass_route = false, string $alias = '')
* @method Route put(string $pattern, callable|string|array{0: class-string, 1: string} $callback, bool $pass_route = false, string $alias = '')
* @method Route patch(string $pattern, callable|string|array{0: class-string, 1: string} $callback, bool $pass_route = false, string $alias = '')
* @method Route delete(string $pattern, callable|string|array{0: class-string, 1: string} $callback, bool $pass_route = false, string $alias = '')
* @method void resource(string $pattern, class-string $controllerClass, array<string, string|array<int, string>> $methods = [])
* @method Router router()
* @method string getUrl(string $alias)
* @method void render(string $file, array $data = null, string $key = null)
* @method string getUrl(string $alias, array<string, mixed> $params)
* @method void render(string $file, ?array<string, mixed> $data, string $key = null)
* @method View view()
* @method void onEvent(string $event, callable $callback)
* @method void triggerEvent(string $event, ...$args)

@ -206,7 +206,7 @@ class Flight
self::app()->clear($key);
}
/** @param array<string, mixed> $data */
/** @param ?array<string, mixed> $data */
public static function render(string $file, ?array $data = null, ?string $key = null): void
{
self::app()->render($file, $data, $key);
@ -222,7 +222,7 @@ class Flight
self::app()->onEvent($event, $callback);
}
/** @param ...mixed $args */
/** @param mixed ...$args */
public static function triggerEvent(string $event, ...$args): void
{
self::app()->triggerEvent($event, ...$args);
@ -249,10 +249,9 @@ class Flight
int $code = 200,
bool $encode = true,
string $charset = 'utf8',
int $encodeOption = 0,
int $encodeDepth = 512
int $encodeOption = 0
): void {
self::app()->json($data, $code, $encode, $charset, $encodeOption, $encodeDepth);
self::app()->json($data, $code, $encode, $charset, $encodeOption);
}
/** @param mixed $data */
@ -261,10 +260,9 @@ class Flight
int $code = 200,
bool $encode = true,
string $charset = 'utf8',
int $encodeOption = 0,
int $encodeDepth = 512
int $encodeOption = 0
): void {
self::app()->jsonHalt($data, $code, $encode, $charset, $encodeOption, $encodeDepth);
self::app()->jsonHalt($data, $code, $encode, $charset, $encodeOption);
}
/** @param mixed $data */
@ -274,10 +272,9 @@ class Flight
int $code = 200,
bool $encode = true,
string $charset = 'utf8',
int $encodeOption = 0,
int $encodeDepth = 512
int $encodeOption = 0
): void {
self::app()->jsonp($data, $param, $code, $encode, $charset, $encodeOption, $encodeDepth);
self::app()->jsonp($data, $param, $code, $encode, $charset, $encodeOption);
}
public static function error(Throwable $exception): void

@ -18,9 +18,8 @@ use TypeError;
* allows you to hook other functions to an event that can modify the
* input parameters and/or the output.
*
* @license MIT, http://flightphp.com/license
* @license MIT, https://docs.flightphp.com/license/
* @copyright Copyright (c) 2011, Mike Cao <mike@mikecao.com>
* @phpstan-template EngineTemplate of object
*/
class Dispatcher
{
@ -30,7 +29,6 @@ class Dispatcher
/** Exception message if thrown by setting the container as a callable method. */
protected ?Throwable $containerException = null;
/** @var ?Engine<EngineTemplate> $engine Engine instance. */
protected ?Engine $engine = null;
/** @var array<string, callable(): (void|mixed)> Mapped events. */

@ -9,7 +9,7 @@ use Throwable;
/**
* The Loader class is responsible for loading objects. It maintains a list of
* reusable class instances and can generate a new class instances with custom
* initialization parameters. It also performs class autoloading.
* initialization parameters.
* @license MIT, https://docs.flightphp.com/license/
* @copyright Copyright (c) 2011, Mike Cao <mike@mikecao.com>
*/

Loading…
Cancel
Save