ObjectTypeMock   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
getSample() 0 15 ?
A hp$0 ➔ getSample() 0 15 2
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Created by PhpStorm.
5
 * User: danchukas
6
 * Date: 2017-07-18 08:46
7
 */
8
9
namespace DanchukAS\Mock\Type;
10
11
12
use DanchukAS\Mock\TypeMock;
13
14
/**
15
 * Class ObjectTypeMock
16
 * @package DanchukAS\Mock\Type
17
 */
18
class ObjectTypeMock extends TypeMock
19
{
20
    protected static $optimalCount = 5;
21
22
    /**
23
     * @return \Generator
24
     */
25
    public static function getSample()
26
    {
27
        $sample_list = [
28
            'anonymous class' => new class
29
            {
30
            }
31
            , 'anonymous function' => function () {
32
            }
33
            , 'minimal items' => new \stdClass
34
            , 'usual' => new \Exception
35
            , 'with namespace' => new self
36
        ];
37
38
        foreach ($sample_list as $expression => $value) {
39
            yield [$expression => $value];
40
        }
41
    }
42
}