1 | <?php |
||
14 | abstract class Component implements ComponentInterface |
||
15 | { |
||
16 | use HasEvents, HasPermission; |
||
17 | |||
18 | protected $name; |
||
19 | |||
20 | protected $app; |
||
21 | |||
22 | protected $title; |
||
23 | |||
24 | protected $repository; |
||
25 | |||
26 | protected $model; |
||
27 | |||
28 | protected static $booted = []; |
||
29 | |||
30 | /** |
||
31 | * @var \Illuminate\Contracts\Events\Dispatcher |
||
32 | */ |
||
33 | protected static $dispatcher; |
||
34 | |||
35 | public function __construct(Application $app = null, $modelClass = null) |
||
49 | |||
50 | protected function setDefaultName() |
||
54 | |||
55 | protected function getModelClassName() |
||
59 | |||
60 | public function getName() |
||
64 | |||
65 | public function getTitle() |
||
69 | |||
70 | public function getModel() |
||
74 | |||
75 | public function getRepository() |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function getConfigs() |
||
93 | |||
94 | /** |
||
95 | * @return \KodiComponents\Navigation\Contracts\NavigationInterface |
||
96 | */ |
||
97 | public function getNavigation() |
||
101 | |||
102 | /** |
||
103 | * 添加菜单 |
||
104 | * |
||
105 | * @param int $priority |
||
106 | * @param null $badge |
||
107 | * |
||
108 | * @return \Sco\Admin\Navigation\Page |
||
109 | */ |
||
110 | public function addToNavigation($priority = 100, $badge = null) |
||
116 | |||
117 | /** |
||
118 | * page |
||
119 | * |
||
120 | * @param int $priority |
||
121 | * @param null $badge |
||
122 | * |
||
123 | * @return \Sco\Admin\Navigation\Page |
||
124 | */ |
||
125 | protected function makePage($priority = 100, $badge = null) |
||
138 | |||
139 | protected function bootIfNotBooted() |
||
153 | |||
154 | public function boot() |
||
157 | |||
158 | /** |
||
159 | * Boot all of the bootable traits on the model. |
||
160 | * |
||
161 | * @return void |
||
162 | */ |
||
163 | protected static function bootTraits() |
||
173 | } |
||
174 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.