@@ -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 | |
@@ -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 | ]; |
@@ -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 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function __construct($id, $name, $role, $email = null, $phone = null, |
| 36 | 36 | DateTimeInterface $created = null, DateTimeInterface $updated = null) |
| 37 | 37 | { |
| 38 | - if (isset($id) && ! is_int($id)) { |
|
| 38 | + if (isset($id) && !is_int($id)) { |
|
| 39 | 39 | throw new \InvalidArgumentException("The id must be an integer"); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | throw new \InvalidArgumentException("At least one of phone or email must be defined"); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if (! isset(self::$roles[$role])) { |
|
| 46 | + if (!isset(self::$roles[$role])) { |
|
| 47 | 47 | throw new \InvalidArgumentException("The role must be either employee or manager"); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -23,11 +23,11 @@ |
||
| 23 | 23 | |
| 24 | 24 | $employee = $shift->getEmployee(); |
| 25 | 25 | |
| 26 | - $shifts = array_filter($shifts, function ($shift) use ($employee) { |
|
| 26 | + $shifts = array_filter($shifts, function($shift) use ($employee) { |
|
| 27 | 27 | return $shift->getEmployee()->getId() !== $employee->getId(); |
| 28 | 28 | }); |
| 29 | 29 | |
| 30 | - $coworkers = array_map(function ($shift) { |
|
| 30 | + $coworkers = array_map(function($shift) { |
|
| 31 | 31 | return $shift->getEmployee(); |
| 32 | 32 | }, $shifts); |
| 33 | 33 | |