GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 3.0 ( c3085b...827fa4 )
by Vermeulen
02:56
created

Datas::checkMail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace BFW\Helpers;
4
5
/**
6
 * Helpers to manage datas
7
 */
8
class Datas
9
{
10
    /**
11
     * Check types of variables
12
     * 
13
     * @param array $vars : Variables to check
14
     *  array(array('type' => 'monType', 'data' => 'mesData), array(...)...)
15
     * 
16
     * @return boolean
17
     */
18
    public static function checkType($vars)
19
    {
20
        if (!is_array($vars)) {
21
            return false;
22
        }
23
24
        foreach ($vars as $var) {
25
            if (!is_array($var)) {
26
                return false;
27
            }
28
29
            if (!(!empty($var['type']) && isset($var['data']))) {
30
                return false;
31
            }
32
33
            if (!is_string($var['type'])) {
34
                return false;
35
            }
36
37
            if ($var['type'] === 'int') {
38
                $var['type'] = 'integer';
39
            }
40
41
            if ($var['type'] === 'float') {
42
                $var['type'] = 'double';
43
            }
44
45
            if (gettype($var['data']) !== $var['type']) {
46
                return false;
47
            }
48
        }
49
50
        return true;
51
    }
52
53
    /**
54
     * Check if an email address is valid
55
     * 
56
     * @param string $mail The email address to check
57
     * 
58
     * @return boolean
59
     */
60
    public static function checkMail($mail)
61
    {
62
        return Secure::securise($mail, 'email');
0 ignored issues
show
Bug introduced by
The call to securise() misses a required argument $htmlentities.

This check looks for function calls that miss required arguments.

Loading history...
63
    }
64
}
65