Issues (23)

src/helpers.php (3 issues)

1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: zhanglingyu
5
 * Date: 2019-03-06
6
 * Time: 10:55
7
 */
8
9
if (!function_exists('identity')) {
10
    /**
11
     * Get Identity value
12
     *
13
     * @param int $limit
14
     * @return mixed
15
     */
16
    function identity($limit = 1)
17
    {
18
        if ($limit == 1) {
19
            return app('identity_faker')->one();
0 ignored issues
show
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
            return /** @scrutinizer ignore-call */ app('identity_faker')->one();
Loading history...
20
        }
21
22
        return app('identity_faker')->limit($limit)->get();
23
    }
24
}
25
26
27
if(!function_exists('identity_verity')) {
28
    /**
29
     * check chinese id number
30
     *
31
     * @param null $idNumer
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $idNumer is correct as it would always require null to be passed?
Loading history...
32
     * @return bool
33
     */
34
    function identity_verity($idNumer = null)
35
    {
36
        if (is_null($idNumer)) {
0 ignored issues
show
The condition is_null($idNumer) is always true.
Loading history...
37
            return false;
38
        }
39
40
        return \ArcherZdip\Identity\VerityChineseIDNumber::isValid($idNumer);
41
    }
42
}
43
44