Improve return types.
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user