Passed
Push — master ( 3624d1...36fc6d )
by Gerrit
02:07
created

SampleEntity   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 31
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A someStaticFactory() 0 4 1
A doFoo() 0 4 1
A getId() 0 4 1
1
<?php
2
/**
3
 * Copyright (C) 2018 Gerrit Addiks.
4
 * This package (including this file) was released under the terms of the GPL-3.0.
5
 * You should have received a copy of the GNU General Public License along with this program.
6
 * If not, see <http://www.gnu.org/licenses/> or send me a mail so i can send you a copy.
7
 *
8
 * @license GPL-3.0
9
 *
10
 * @author Gerrit Addiks <[email protected]>
11
 */
12
13
namespace Addiks\SymfonyGenerics\Tests\Unit\Controllers;
14
15
class SampleEntity
16
{
17
18
    /**
19
     * @var bool
20
     */
21
    public $fooCalled = false;
22
23
    public $constructArgument = "foo";
24
25
    public function __construct(string $foo = "foo")
26
    {
27
        $this->constructArgument = $foo;
28
    }
29
30
    public static function someStaticFactory(string $foo = "foo"): SampleEntity
31
    {
32
        return new SampleEntity("static " . $foo);
33
    }
34
35
    public function doFoo()
36
    {
37
        $this->fooCalled = true;
38
    }
39
40
    public function getId()
41
    {
42
        return 'some_id';
43
    }
44
45
}
46