Skip to content

Commit

Permalink
refactor(router): use php 8 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
doyouhaobaby committed Nov 26, 2020
1 parent 95822e0 commit b0d16bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions src/Leevel/Router/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
*/
class Url implements IUrl
{
/**
* HTTP 请求.
*/
protected Request $request;

/**
* URL 参数.
*/
Expand All @@ -49,9 +44,8 @@ class Url implements IUrl
/**
* 构造函数.
*/
public function __construct(Request $request, array $option = [])
public function __construct(protected Request $request, array $option = [])
{
$this->request = $request;
if ($option) {
$this->option = array_merge($this->option, $option);
}
Expand Down
8 changes: 1 addition & 7 deletions src/Leevel/Router/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,11 @@
*/
class View implements IView
{
/**
* 视图模板.
*/
protected IViews $view;

/**
* 构造函数.
*/
public function __construct(IViews $view)
public function __construct(protected IViews $view)
{
$this->view = $view;
}

/**
Expand Down

0 comments on commit b0d16bc

Please sign in to comment.