Completed
Branchmaster (1db7ad)
by Rocco
06:17
created
src/Infrastructure/DBAL/DbalMapper.php 2 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -16,6 +16,9 @@  discard block
 block discarded – undo
16 16
         $this->loadedMap = [];
17 17
     }
18 18
 
19
+    /**
20
+     * @param integer $id
21
+     */
19 22
     protected function abstractFind($id)
20 23
     {
21 24
         if (isset($this->loadedMap[$id])) {
@@ -96,6 +99,10 @@  discard block
 block discarded – undo
96 99
         return $result;
97 100
     }
98 101
 
102
+    /**
103
+     * @param string $name
104
+     * @param integer $value
105
+     */
99 106
     protected function setPropertyValue($subject, $name, $value)
100 107
     {
101 108
         $reflector = new \ReflectionClass($subject);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $findStatement->execute();
28 28
         $resultSet = $findStatement->fetch();
29 29
 
30
-        if (! $resultSet) {
30
+        if (!$resultSet) {
31 31
             return null;
32 32
         }
33 33
 
Please login to merge, or discard this patch.
src/Infrastructure/DBAL/DbalShiftMapper.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -5,13 +5,11 @@
 block discarded – undo
5 5
 use DateTimeImmutable;
6 6
 use DateTimeInterface;
7 7
 use Doctrine\DBAL\Connection;
8
-use Doctrine\DBAL\Driver\PDOStatement;
9 8
 use Doctrine\DBAL\Statement;
10 9
 use Doctrine\DBAL\Types\Type;
11 10
 use Scheduler\Domain\Model\Shift\Shift;
12 11
 use Scheduler\Domain\Model\Shift\ShiftMapper;
13 12
 use Scheduler\Domain\Model\User\NullUser;
14
-use Scheduler\Domain\Model\User\User;
15 13
 use Scheduler\Domain\Model\User\UserMapper;
16 14
 
17 15
 class DbalShiftMapper extends DbalMapper implements ShiftMapper
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@
 block discarded – undo
176 176
                 "phone" => $resultSet["e_phone"],
177 177
                 "created_at" => $resultSet["e_created_at"],
178 178
                 "updated_at" => $resultSet["e_updated_at"]
179
-              ])
179
+                ])
180 180
             : new NullUser();
181 181
 
182 182
         return new Shift($id, $manager, $employee, $break, $start, $end, $created, $updated);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     protected static function findInTimePeriodByEmployeeIdStatement()
52 52
     {
53
-        return self::findInTimePeriodStatement() . " and s.employee_id = :employee_id";
53
+        return self::findInTimePeriodStatement()." and s.employee_id = :employee_id";
54 54
     }
55 55
 
56 56
     protected static function findOpenShiftsStatement()
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
     public function find($id)
105 105
     {
106
-        if (! is_int($id)) {
106
+        if (!is_int($id)) {
107 107
             throw new \InvalidArgumentException("The id must be an integer");
108 108
         }
109 109
 
Please login to merge, or discard this patch.
src/Infrastructure/DBAL/DbalUserMapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
     public function find($id)
38 38
     {
39
-        if (! is_int($id)) {
39
+        if (!is_int($id)) {
40 40
             throw new \InvalidArgumentException("The id must be an integer");
41 41
         }
42 42
 
Please login to merge, or discard this patch.
src/Web/Resource/ShiftResource.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         ];
27 27
 
28 28
         if ($shift->hasCoworkers()) {
29
-            $resource['coworkers'] = array_map(function (User $coworker) {
29
+            $resource['coworkers'] = array_map(function(User $coworker) {
30 30
                 return $this->userResource->transform($coworker);
31 31
             }, $shift->getCoworkers());
32 32
         }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function collection(array $shifts)
43 43
     {
44 44
         return [
45
-            "shifts" => array_map(function (Shift $shift) {
45
+            "shifts" => array_map(function(Shift $shift) {
46 46
                 return $this->transform($shift);
47 47
             }, $shifts)
48 48
         ];
Please login to merge, or discard this patch.
src/Web/Radar/Responder/ShiftResponder.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
         $url = "/shifts/{$shift->getId()}";
18 18
 
19 19
         $this->response = $this->response->withStatus(201)
20
-                                         ->withHeader("Location", $url);
20
+                                            ->withHeader("Location", $url);
21 21
         $this->jsonBody($this->resource->item($shift));
22 22
     }
23 23
 
Please login to merge, or discard this patch.
src/Web/Radar/Responder/ApiProblemResponder.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     protected function notAuthenticated()
40 40
     {
41 41
         $this->response = $this->response->withStatus(401)
42
-                                         ->withHeader("WWW-Authenticate", "None");
42
+                                            ->withHeader("WWW-Authenticate", "None");
43 43
 
44 44
         $problem = $this->createProblem();
45 45
         $problem->setDetail("This resource requires a valid access token.");
Please login to merge, or discard this patch.
src/Web/Radar/Config/RoutesConfig.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@
 block discarded – undo
38 38
         $adr = $di->get('radar/adr:adr');
39 39
         $adr->input(Input\Input::class);
40 40
 
41
-        $adr->get('entry', "/", function ($user) {
41
+        $adr->get('entry', "/", function($user) {
42 42
             $payload = new \Aura\Payload\Payload();
43 43
 
44
-            if (! $user->isAuthenticated()) {
44
+            if (!$user->isAuthenticated()) {
45 45
                 return $payload->setStatus($payload::NOT_AUTHENTICATED);
46 46
             }
47 47
 
Please login to merge, or discard this patch.
src/Web/Radar/Config/SeedConfig.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@
 block discarded – undo
14 14
         $adr = $di->get('radar/adr:adr');
15 15
 
16 16
         // For demonstration purposes, seed database using test fixtures
17
-        $adr->get('seed', "/seed", function () use ($di) {
17
+        $adr->get('seed', "/seed", function() use ($di) {
18 18
             $payload = new Payload();
19 19
 
20 20
             $di->get('db.schema')->drop();
21 21
             $di->get('db.schema')->create();
22 22
 
23 23
             $yaml = new Parser();
24
-            $yamlFile = __DIR__ . "/../../../../tests/Infrastructure/DBAL/fixtures.yml";
24
+            $yamlFile = __DIR__."/../../../../tests/Infrastructure/DBAL/fixtures.yml";
25 25
             $fixtures = $yaml->parse(file_get_contents($yamlFile));
26 26
 
27
-            if (! is_array($fixtures)) {
27
+            if (!is_array($fixtures)) {
28 28
                 throw new RuntimeException("Could not parse fixtures file");
29 29
             }
30 30
 
Please login to merge, or discard this patch.
src/Domain/Model/User/InMemoryAuthenticator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
     public function authenticate($token)
18 18
     {
19
-        if (! array_key_exists($token, $this->tokenMap)) {
19
+        if (!array_key_exists($token, $this->tokenMap)) {
20 20
             return new NullUser();
21 21
         }
22 22
 
Please login to merge, or discard this patch.