Completed
Push — master ( 11ad20...a09f6d )
by Sergi Tur
05:23
created

HasEmail   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A email() 0 8 3
1
<?php
2
3
4
namespace Acacha\AdminLTETemplateLaravel\Console;
5
6
/**
7
 * Class HasEmail.
8
 *
9
 * @package Acacha\AdminLTETemplateLaravel\Console
10
 */
11
trait HasEmail
12
{
13
    /**
14
     * Obtain admin email.
15
     *
16
     * @return bool|string
17
     */
18
    protected function email()
19
    {
20
        if (($email = env('ADMIN_EMAIL', null)) != null) return $email;
21
22
        if (($email = git_user_email()) != null) return $email;
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...
23
24
        return "[email protected]";
25
    }
26
}