1 | <?php |
||
16 | class AuditProvider extends ServiceProvider |
||
17 | { |
||
18 | use ConsoleTools; |
||
19 | |||
20 | public $packageName = 'audit'; |
||
21 | const pathVendor = 'sierratecnologia/audit'; |
||
22 | |||
23 | // @todo Usar Tools aqui pro providers |
||
24 | /** |
||
25 | * This namespace is applied to the controller routes in your routes file. |
||
26 | * |
||
27 | * In addition, it is set as the URL generator's root namespace. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $namespace = 'Audit\Http\Controllers'; |
||
32 | |||
33 | public static $aliasProviders = [ |
||
34 | |||
35 | ]; |
||
36 | |||
37 | public static $providers = [ |
||
38 | /** |
||
39 | * Configuracoes |
||
40 | */ |
||
41 | \Audit\Providers\TelescopeServiceProvider::class, |
||
42 | |||
43 | /** |
||
44 | * Externos |
||
45 | */ |
||
46 | \Laravel\Telescope\TelescopeServiceProvider::class, |
||
47 | \Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class, |
||
48 | ]; |
||
49 | |||
50 | /** |
||
51 | * Rotas do Menu |
||
52 | */ |
||
53 | public static $menuItens = [ |
||
54 | [ |
||
55 | 'text' => 'Auditoria', |
||
56 | 'icon' => 'fas fa-fw fa-chart-area', |
||
57 | 'icon_color' => "blue", |
||
58 | 'label_color' => "success", |
||
59 | 'order' => 4550, |
||
60 | 'section' => "rica", |
||
61 | 'level' => 2, // 0 (Public), 1, 2 (Admin) , 3 (Root) |
||
62 | ], |
||
63 | 'Auditoria' => [ |
||
64 | [ |
||
65 | 'text' => 'Logs', |
||
66 | 'route' => 'rica.tracking.larametrics::metrics.index', |
||
67 | 'icon' => 'dashboard', |
||
68 | 'icon_color' => 'blue', |
||
69 | 'label_color' => 'success', |
||
70 | 'level' => 2, |
||
71 | 'order' => 4550, |
||
72 | 'section' => "admin", |
||
73 | // 'access' => \Porteiro\Models\Role::$ADMIN |
||
74 | ], |
||
75 | [ |
||
76 | 'text' => 'Telescope', |
||
77 | 'route' => 'telescope', |
||
78 | 'icon' => 'dashboard', |
||
79 | 'icon_color' => 'blue', |
||
80 | 'label_color' => 'success', |
||
81 | 'level' => 2, |
||
82 | 'order' => 4550, |
||
83 | 'section' => "rica", |
||
84 | // 'access' => \Porteiro\Models\Role::$ADMIN |
||
85 | ], |
||
86 | [ |
||
87 | 'text' => 'Horizon', |
||
88 | 'route' => 'horizon.index', |
||
89 | 'icon' => 'dashboard', |
||
90 | 'icon_color' => 'blue', |
||
91 | 'label_color' => 'success', |
||
92 | 'order' => 4550, |
||
93 | 'section' => "rica", |
||
94 | 'level' => 2, |
||
95 | // 'access' => \Porteiro\Models\Role::$ADMIN |
||
96 | ], |
||
97 | ], |
||
98 | ]; |
||
99 | |||
100 | /** |
||
101 | * Alias the services in the boot. |
||
102 | */ |
||
103 | public function boot(Router $router) |
||
125 | |||
126 | /** |
||
127 | * Register the services. |
||
128 | */ |
||
129 | public function register() |
||
154 | |||
155 | |||
156 | /** |
||
157 | * Register configs, migrations, etc |
||
158 | * |
||
159 | * @return void |
||
160 | */ |
||
161 | public function registerDirectories() |
||
196 | |||
197 | private function loadViews() |
||
219 | |||
220 | private function loadTranslations() |
||
228 | |||
229 | /** |
||
230 | * Configs Paths |
||
231 | */ |
||
232 | private function getResourcesPath($folder) |
||
236 | |||
237 | private function getPublishesPath($folder) |
||
241 | |||
242 | private function getDistPath($folder = '') |
||
246 | } |
||
247 |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: