Completed
Push — master ( fc3d6f...f7b1d9 )
by Sergi Tur
28:05
created

HasEmail::email()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 3
eloc 6
nc 3
nop 0
1
<?php
2
3
namespace Acacha\AdminLTETemplateLaravel\Console;
4
5
/**
6
 * Class HasEmail.
7
 *
8
 * @package Acacha\AdminLTETemplateLaravel\Console
9
 */
10
trait HasEmail
11
{
12
    /**
13
     * Obtain admin email.
14
     *
15
     * @return bool|string
16
     */
17
    protected function email()
18
    {
19
        if (($email = env('ADMIN_EMAIL', null)) != null) {
20
            return $email;
21
        }
22
23
        if (($email = git_user_email()) != null) {
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $email is correct as git_user_email() seems to always returns null.
Loading history...
24
            return $email;
25
        }
26
27
        return "[email protected]";
28
    }
29
}
30