@@ -16,7 +16,7 @@ |
||
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | 18 | * @param \Madkom\RegistryApplication\Domain\CarManagement\Insurances\Insurance $newInsurance |
| 19 | - * @return true|false |
|
| 19 | + * @return boolean |
|
| 20 | 20 | */ |
| 21 | 21 | public function checkForDuplicates(array $existingInsurance, Insurance $newInsurance) |
| 22 | 22 | { |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | ) { |
| 28 | 28 | return true; |
| 29 | 29 | } |
| 30 | - if($newInsurance->getId() === $insurance->getId()) { |
|
| 30 | + if ($newInsurance->getId() === $insurance->getId()) { |
|
| 31 | 31 | return true; |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -14,12 +14,13 @@ |
||
| 14 | 14 | class InsuranceFactory |
| 15 | 15 | { |
| 16 | 16 | /** |
| 17 | - * @param $insuranceType |
|
| 18 | - * @param $dateFrom |
|
| 19 | - * @param $dateTo |
|
| 20 | - * @param $insuranceId |
|
| 17 | + * @param string $insuranceType |
|
| 18 | + * @param \DateTime $dateFrom |
|
| 19 | + * @param \DateTime $dateTo |
|
| 20 | + * @param string $insuranceId |
|
| 21 | + * @param string $insurerId |
|
| 21 | 22 | * |
| 22 | - * @return \Madkom\RegistryApplication\Domain\CarManagement\Insurances\AccidentInsurance|\Madkom\RegistryApplication\Domain\CarManagement\Insurances\AssistanceInsurance|\Madkom\RegistryApplication\Domain\CarManagement\Insurances\CarInsurance|\Madkom\RegistryApplication\Domain\CarManagement\Insurances\LiabilityInsurance |
|
| 23 | + * @return Insurance |
|
| 23 | 24 | * @throws \Madkom\RegistryApplication\Domain\CarManagement\Insurances\Exceptions\EmptyInsuranceDateException |
| 24 | 25 | * @throws \Madkom\RegistryApplication\Domain\CarManagement\Insurances\Exceptions\UnknownInsuranceTypeException |
| 25 | 26 | * @throws \InvalidArgumentException |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $this->hasValidDateFormat($dateFrom, $dateTo); |
| 32 | 32 | $this->isEqualToOneYear($dateFrom, $dateTo); |
| 33 | 33 | |
| 34 | - switch($insuranceType) { |
|
| 34 | + switch ($insuranceType) { |
|
| 35 | 35 | case CarInsurance::INSURANCE_TYPE: |
| 36 | 36 | $insurance = new CarInsurance($insuranceId, $dateFrom, $dateTo, $insurerId); |
| 37 | 37 | break; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | private function hasValidDateFormat($dateFrom, $dateTo) |
| 74 | 74 | { |
| 75 | - if (! ($dateFrom instanceof \DateTime) or ! ($dateTo instanceof \DateTime)) { |
|
| 75 | + if (!($dateFrom instanceof \DateTime) or !($dateTo instanceof \DateTime)) { |
|
| 76 | 76 | throw new \InvalidArgumentException('The \'date from\' or \'date to\' has not be instance of DateTime class.' |
| 77 | 77 | ); |
| 78 | 78 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | $interval = $dateTo->diff($dateFrom); |
| 84 | 84 | |
| 85 | - if($interval->days < 365 or $interval->days > 366) { |
|
| 85 | + if ($interval->days < 365 or $interval->days > 366) { |
|
| 86 | 86 | throw new InvalidDatesException('Umowa z ubezpieczeniem może być tylko na rok.'); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: marek |
|
| 5 | - * Date: 19.11.15 |
|
| 6 | - * Time: 13:06 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: marek |
|
| 5 | + * Date: 19.11.15 |
|
| 6 | + * Time: 13:06 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Madkom\RegistryApplication\Domain\CarManagement\VehicleInspection; |
| 10 | 10 | |
@@ -25,8 +25,8 @@ |
||
| 25 | 25 | { |
| 26 | 26 | /** @var VehicleInspection $vehicleInspection */ |
| 27 | 27 | foreach ($existingVehicleInspection as $vehicleInspection) { |
| 28 | - if($newVehicleInspection->getLastInspection() === $vehicleInspection->getLastInspection() || |
|
| 29 | - $newVehicleInspection->getId() === $vehicleInspection->getId() |
|
| 28 | + if ($newVehicleInspection->getLastInspection() === $vehicleInspection->getLastInspection() || |
|
| 29 | + $newVehicleInspection->getId() === $vehicleInspection->getId() |
|
| 30 | 30 | ) { |
| 31 | 31 | return true; |
| 32 | 32 | } |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: marek |
|
| 5 | - * Date: 19.11.15 |
|
| 6 | - * Time: 09:36 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: marek |
|
| 5 | + * Date: 19.11.15 |
|
| 6 | + * Time: 09:36 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Madkom\RegistryApplication\Domain\CarManagement\VehicleInspection; |
| 10 | 10 | |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: marek |
|
| 5 | - * Date: 19.11.15 |
|
| 6 | - * Time: 09:47 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: marek |
|
| 5 | + * Date: 19.11.15 |
|
| 6 | + * Time: 09:47 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Madkom\RegistryApplication\Domain\CarManagement; |
| 10 | 10 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function create($type, $id, $title, $description, $source) |
| 22 | 22 | { |
| 23 | - switch($type) { |
|
| 23 | + switch ($type) { |
|
| 24 | 24 | case self::CAR_DOCUMENT: |
| 25 | 25 | return new CarDocument($id, $title, $description, $source); |
| 26 | 26 | break; |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: marek |
|
| 5 | - * Date: 02.12.15 |
|
| 6 | - * Time: 14:43 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: marek |
|
| 5 | + * Date: 02.12.15 |
|
| 6 | + * Time: 14:43 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Madkom\RegistryApplication\Domain\CarManagement; |
| 10 | 10 | |
@@ -115,9 +115,9 @@ |
||
| 115 | 115 | { |
| 116 | 116 | foreach ($table as $item) { |
| 117 | 117 | $dto = new DocumentDTO($item['fileId'], |
| 118 | - $item['title'], |
|
| 119 | - $item['description'], |
|
| 120 | - $item['source'] |
|
| 118 | + $item['title'], |
|
| 119 | + $item['description'], |
|
| 120 | + $item['source'] |
|
| 121 | 121 | ); |
| 122 | 122 | |
| 123 | 123 | |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | |
| 130 | 130 | try { |
| 131 | 131 | $newInsuranceDocument->execute(); |
| 132 | - } catch(NonexistentInsuranceException $nonexistent) { |
|
| 132 | + } catch (NonexistentInsuranceException $nonexistent) { |
|
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | } |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: marek |
|
| 5 | - * Date: 10.12.15 |
|
| 6 | - * Time: 09:57 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: marek |
|
| 5 | + * Date: 10.12.15 |
|
| 6 | + * Time: 09:57 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Madkom\RegistryApplication\Domain\CarManagement\Behat; |
| 10 | 10 | |
@@ -38,14 +38,14 @@ discard block |
||
| 38 | 38 | $car = $table->getHash(); |
| 39 | 39 | foreach ($car as $item) { |
| 40 | 40 | $dto = new CarDTO($item['id'], |
| 41 | - $item['responsiblePerson'], |
|
| 42 | - $item['model'], |
|
| 43 | - $item['brand'], |
|
| 44 | - $item['registrationNumber'], |
|
| 45 | - $item['productionDate'], |
|
| 46 | - $item['warrantyPeriod'], |
|
| 47 | - $item['city'], |
|
| 48 | - $item['department'] |
|
| 41 | + $item['responsiblePerson'], |
|
| 42 | + $item['model'], |
|
| 43 | + $item['brand'], |
|
| 44 | + $item['registrationNumber'], |
|
| 45 | + $item['productionDate'], |
|
| 46 | + $item['warrantyPeriod'], |
|
| 47 | + $item['city'], |
|
| 48 | + $item['department'] |
|
| 49 | 49 | ); |
| 50 | 50 | |
| 51 | 51 | $newCar = new AddCarCommand(self::$carRepository, $dto); |
@@ -178,9 +178,9 @@ discard block |
||
| 178 | 178 | $documents = $table->getHash(); |
| 179 | 179 | foreach ($documents as $document) { |
| 180 | 180 | $dto = new DocumentDTO($document['id'], |
| 181 | - $document['source'], |
|
| 182 | - $document['title'], |
|
| 183 | - $document['description'] |
|
| 181 | + $document['source'], |
|
| 182 | + $document['title'], |
|
| 183 | + $document['description'] |
|
| 184 | 184 | ); |
| 185 | 185 | |
| 186 | 186 | $carDocument = new AddCarDocumentCommand(self::$carRepository, $document['carId'], $dto); |
@@ -138,8 +138,7 @@ |
||
| 138 | 138 | * @Then chciałbym w samochodzie :carId dodać informację o przeglądzie z numerem :inspectionId, w którym data ostatniego to :lastInspection, a data następnego to :upcomingInspection |
| 139 | 139 | * @throws \Madkom\RegistryApplication\Domain\CarManagement\CarExceptions\InvalidDatesException |
| 140 | 140 | */ |
| 141 | - public function chcialbymWSamochodzieDodacInformacjeOPrzegladzieZNumeremWKtorymDataOstatniegoToADataNastępnegoTo |
|
| 142 | -( |
|
| 141 | + public function chcialbymWSamochodzieDodacInformacjeOPrzegladzieZNumeremWKtorymDataOstatniegoToADataNastępnegoTo( |
|
| 143 | 142 | $carId, |
| 144 | 143 | $inspectionId, |
| 145 | 144 | $lastInspection, |