WithFaker   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A faker() 0 6 2
1
<?php
2
3
4
namespace SmartWeb\ModuleTesting\Util;
5
6
use Faker\Factory;
7
use Faker\Generator;
8
9
10
/**
11
 * Trait WithFaker
12
 *
13
 * @package SmartWeb\ModuleTesting\Util
14
 */
15
trait WithFaker
16
{
17
    
18
    /**
19
     * @var Generator
20
     */
21
    protected static $faker;
22
    
23
    /**
24
     * @return Generator
25
     */
26
    protected function faker()
27
    {
28
        return static::$faker = (isset(static::$faker))
29
            ? static::$faker
30
            : Factory::create();
31
    }
32
}
33