SimplePopo   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
c 1
b 0
f 0
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A __construct() 0 9 2
A getCreatedAt() 0 3 1
1
<?php
2
namespace Apie\MockObjects\ApiResources;
3
4
use DateTime;
5
use Apie\Core\Annotations\ApiResource;
6
use Apie\CorePlugin\DataLayers\NullDataLayer;
0 ignored issues
show
Bug introduced by
The type Apie\CorePlugin\DataLayers\NullDataLayer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
/**
9
 * @ApiResource(persistClass=NullDataLayer::class)
10
 */
11
class SimplePopo
12
{
13
    private $id;
14
15
    private $createdAt;
16
17
    public $arbitraryField;
18
19
    public function __construct()
20
    {
21
        // the use of rand is deliberate so it's easier to test...
22
        $this->id = '';
23
        for ($i = 0; $i < 16; $i++) {
24
            $this->id .= chr(rand(ord('A'), ord('Z')));
25
        }
26
27
        $this->createdAt = new DateTime();
28
    }
29
30
    public function getId(): string
31
    {
32
        return $this->id;
33
    }
34
35
    public function getCreatedAt(): DateTime
36
    {
37
        return $this->createdAt;
38
    }
39
}
40