These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | |||
4 | namespace Acacha\AdminLTETemplateLaravel\Console; |
||
5 | |||
6 | /** |
||
7 | * Class HasUsername. |
||
8 | * |
||
9 | * @package Acacha\AdminLTETemplateLaravel\Console |
||
10 | */ |
||
11 | trait HasUsername |
||
12 | { |
||
13 | /** |
||
14 | * Obtains username. |
||
15 | * |
||
16 | * @return mixed|null|string |
||
17 | */ |
||
18 | public function username() |
||
19 | { |
||
20 | if (($username = env('ADMIN_USERNAME', null)) != null) { |
||
21 | return $username; |
||
22 | } |
||
23 | |||
24 | if (($username = git_user_name()) != null) { |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
25 | return $username; |
||
26 | } |
||
27 | |||
28 | return "Admin"; |
||
29 | } |
||
30 | } |
||
31 |