Faker::__get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Josh\Faker;
4
5
/**
6
 * Faker object
7
 *
8
 * @author Alireza Josheghani <[email protected]>
9
 * @since 12 Dec 2016
10
 * @method static fullname()
11
 * @method static firstname()
12
 * @method static lastname()
13
 * @method static telephone()
14
 * @method static age($min = 16,$max = 70)
15
 * @method static email()
16
 * @method static domain()
17
 * @method static website()
18
 * @method static pageUrl()
19
 * @method static company()
20
 * @method static mobile()
21
 * @method static address()
22
 * @method static city()
23
 * @method static meliCode()
24
 */
25
class Faker
26
{
27
    /**
28
     * Call method from magic method
29
     *
30
     * @author Alireza Josheghani <[email protected]>
31
     * @since 12 Dec 2016
32
     * @param $method
33
     * @return mixed
34
     */
35
    public function __get($method)
36
    {
37
        return faker()->$method();
38
    }
39
40
    /**
41
     * @author Alireza Josheghani <[email protected]>
42
     * @since 3 Feb 2017
43
     * @param $method
44
     * @param $args
45
     * @return mixed
46
     */
47
    public static function __callStatic($method, $args)
48
    {
49
        return faker()->$method(...$args);
50
    }
51
52
}
53