@@ -16,6 +16,9 @@ discard block |
||
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 |
||
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); |
@@ -27,7 +27,7 @@ |
||
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 |
@@ -5,13 +5,11 @@ |
||
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 |
@@ -176,7 +176,7 @@ |
||
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); |
@@ -50,7 +50,7 @@ discard block |
||
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 |
||
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 |
@@ -36,7 +36,7 @@ |
||
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 |
@@ -26,7 +26,7 @@ discard block |
||
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 |
||
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 | ]; |
@@ -17,7 +17,7 @@ |
||
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 |
@@ -39,7 +39,7 @@ |
||
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."); |
@@ -38,10 +38,10 @@ |
||
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 |
@@ -14,17 +14,17 @@ |
||
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 |
@@ -16,7 +16,7 @@ |
||
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 |