FakeCodeRepo   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Test Coverage

Coverage 52.63%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 7
c 3
b 0
f 0
dl 0
loc 79
ccs 10
cts 19
cp 0.5263
rs 10
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A getOneUnvalidatedByCode() 0 3 1
A save() 0 3 1
A getLastCodeForAddress() 0 3 1
A update() 0 3 1
A delete() 0 2 1
A getCodesCountForAddress() 0 3 1
A commitTransaction() 0 2 1
A rollbackTransaction() 0 2 1
A openTransaction() 0 2 1
1
<?php
2
3
namespace Prozorov\DataVerification\Repositories;
4
5
use Prozorov\DataVerification\Contracts\CodeRepositoryInterface;
6
use Prozorov\DataVerification\Integrations;
0 ignored issues
show
Bug introduced by
The type Prozorov\DataVerification\Integrations 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
use Prozorov\DataVerification\Models\Code;
8
use Prozorov\DataVerification\Types\Address;
9
use Datetime;
10
11
class FakeCodeRepo implements CodeRepositoryInterface
12
{
13
    /**
14
     * @inheritDoc
15
     */
16 4
    public function save(Code $code): Code
17
    {
18 4
        return new Code();
19
    }
20
21
    /**
22
     * @inheritDoc
23
     */
24
    public function delete(Code $code): void
25
    {
26
        
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function create(Code $code): Code
0 ignored issues
show
Unused Code introduced by
The parameter $code is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    public function create(/** @scrutinizer ignore-unused */ Code $code): Code

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
    {
34
        return new Code();
35
    }
36
37
    /**
38
     * @inheritDoc
39
     */
40
    public function update(Code $code): Code
41
    {
42
        return $code;
43
    }
44
45
    /**
46
     * @inheritDoc
47
     */
48
    public function getOneUnvalidatedByCode(string $code, Datetime $createdAfter = null): ?Code
49
    {
50
        return null;
51
    }
52
53
    /**
54
     * @inheritDoc
55
     */
56 4
    public function getLastCodeForAddress(Address $address, Datetime $createdAfter = null): ?Code
57
    {
58 4
        return null;
59
    }
60
61
    /**
62
     * @inheritDoc
63
     */
64 4
    public function getCodesCountForAddress(Address $address, Datetime $createdAfter = null): ?int
65
    {
66 4
        return 0;
67
    }
68
69
    /**
70
     * @inheritDoc
71
     */
72 1
    public function openTransaction(): void
73
    {
74
75 1
    }
76
77
    /**
78
     * @inheritDoc
79
     */
80 1
    public function commitTransaction(): void
81
    {
82
83 1
    }
84
85
    /**
86
     * @inheritDoc
87
     */
88
    public function rollbackTransaction(): void
89
    {
90
91
    }
92
}
93