Improve return types.

This commit is contained in:
kj
2023-04-22 05:32:37 -04:00
parent b326c8e1d0
commit d48f24ed98
3 changed files with 43 additions and 43 deletions

View File

@ -109,11 +109,11 @@ class Router {
* @param mixed $callback
* @param int $prioriry
*
* @return Router
* @return static
* Devuelve un enlace estático.
*/
public static function middleware($callback, int $priority = null): Router {
public static function middleware($callback, int $priority = null): static {
if (!isset(static::$last))
return new static();
@ -179,10 +179,10 @@ class Router {
* @param mixed $callback
* Callback que será llamado cuando la ruta configurada en $path coincida.
*
* @return Router
* @return static
* Devuelve un enlace estático.
*/
public static function get(string $path, $callback): Router {
public static function get(string $path, $callback): static {
static::$get[] = static::parse($path, $callback);
static::$last = ['get', count(static::$get)-1];
return new static();
@ -197,10 +197,10 @@ class Router {
* @param mixed $callback
* Callback que será llamado cuando la ruta configurada en $path coincida.
*
* @return Router
* @return static
* Devuelve un enlace estático.
*/
public static function post(string $path, $callback): Router {
public static function post(string $path, $callback): static {
static::$post[] = static::parse($path, $callback);
static::$last = ['post', count(static::$post)-1];
return new static();
@ -215,11 +215,11 @@ class Router {
* @param mixed $callback
* Callback que será llamado cuando la ruta configurada en $path coincida.
*
* @return Router
* @return static
* Devuelve un enlace estático
*/
public static function put(string $path, $callback): Router {
public static function put(string $path, $callback): static {
static::$put[] = static::parse($path, $callback);
static::$last = ['put', count(static::$put)-1];
return new static();
@ -237,7 +237,7 @@ class Router {
* @return static
* Devuelve un enlace estático
*/
public static function delete(string $path, $callback): Router {
public static function delete(string $path, $callback): static {
static::$delete[] = static::parse($path, $callback);
static::$last = ['delete', count(static::$delete)-1];
return new static();