Completed
Pull Request — master (#9)
by Lars
02:23
created

RegistrationRepository::getHandledRegistrations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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 string $request  Request object
0 ignored issues
show
Bug introduced by
There is no parameter named $request. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
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 $registration Array with registration options
0 ignored issues
show
Documentation introduced by
There is no parameter named $registration. Did you maybe mean $registrations?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
41
     *
42
     * @return Response
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 Response
53
     */
54
    public function getNewRegistrations()
55
    {
56
        return $this->client->getNewRegistrations();
57
    }
58
59
    /**
60
     * Gets handled registrations
61
     *
62
     * @return Response
63
     */
64
    public function getHandledRegistrations()
65
    {
66
        return $this->client->getHandledRegistrations();
67
    }
68
69
    /**
70
     * Deletes registrations
71
     *
72
     * @param string $weblist_id String with the id
73
     *
74
     * @return Response
75
     */
76
    public function delete($weblist_id)
77
    {
78
        return $this->client->deleteRegistrations($weblist_id);
79
    }
80
}
81