Completed
Push — master ( 381bc0...2b9053 )
by Lars
05:55 queued 02:03
created

RegistrationRepository::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * SDK to communicate with EDBBrugs
4
 *
5
 * PHP Version 5
6
 *
7
 * @category EDBBrugs
8
 * @package  EDBBrugs
9
 * @author   Lars Olesen <[email protected]>
10
 * @license  MIT Open Source License https://opensource.org/licenses/MIT
11
 * @version  GIT: <git_id>
12
 */
13
14
namespace EDBBrugs;
15
16
/**
17
 * Generate the XML
18
 *
19
 * @category EDBBrugs
20
 * @package  EDBBrugs
21
 * @author   Lars Olesen <[email protected]>
22
 * @license  MIT Open Source License https://opensource.org/licenses/MIT
23
 * @version  GIT: <git_id>
24
 */
25
class RegistrationRepository
26
{
27
    /**
28
     * Constructor
29
     *
30
     * @param ClientInterface $client Client object
31
     */
32 1
    public function __construct(ClientInterface $client)
33
    {
34 1
        $this->client = $client;
0 ignored issues
show
Bug introduced by
The property client does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
35 1
    }
36
37
    /**
38
     * Adds registration
39
     *
40
     * @param array $registrations Array with several registrations
41
     *
42
     * @return ResponseInterface
43
     */
44 1
    public function addRegistrations(array $registrations)
45
    {
46 1
        return $this->client->createNewRegistrations($registrations);
47
    }
48
49
    /**
50
     * Gets new registrations
51
     *
52
     * @return ResponseInterface
53
     */
54
    public function getNewRegistrations()
55
    {
56
        return $this->client->getNewRegistrations();
57
    }
58
59
    /**
60
     * Gets handled registrations
61
     *
62
     * @return ResponseInterface
63
     */
64
    public function getHandledRegistrations()
65
    {
66
        return $this->client->getHandledRegistrations();
67
    }
68
69
    /**
70
     * Deletes registration
71
     *
72
     * @throws Exception
73
     * @return void
74
     */
75
    public function delete()
76
    {
77
        throw new \Exception('It is not possible to delete registrations using the SOAP webservice');
78
    }
79
}
80