@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: marek |
|
| 5 | - * Date: 19.11.15 |
|
| 6 | - * Time: 09:38 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: marek |
|
| 5 | + * Date: 19.11.15 |
|
| 6 | + * Time: 09:38 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Madkom\RegistryApplication\Domain\CarManagement; |
| 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:37 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: marek |
|
| 5 | + * Date: 19.11.15 |
|
| 6 | + * Time: 09:37 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Madkom\RegistryApplication\Domain\CarManagement\Insurances; |
| 10 | 10 | |
@@ -144,13 +144,13 @@ discard block |
||
| 144 | 144 | { |
| 145 | 145 | $duplicationChecker = new VehicleInspectionDuplicationChecker(); |
| 146 | 146 | $isDuplicated = $duplicationChecker->checkForDuplicates($this->vehicleInspection, $newVehicleInspection); |
| 147 | - if($isDuplicated) { |
|
| 147 | + if ($isDuplicated) { |
|
| 148 | 148 | throw new DuplicatedVehicleInspectionException; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | $dateChecker = new VehicleInspectionDateChecker(); |
| 152 | 152 | $isInvalidDates = $dateChecker->checkDates($newVehicleInspection); |
| 153 | - if($isInvalidDates) { |
|
| 153 | + if ($isInvalidDates) { |
|
| 154 | 154 | throw new InvalidDatesException; |
| 155 | 155 | } |
| 156 | 156 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | public function removeVehicleInspection(VehicleInspection $vehicleInspection) |
| 166 | 166 | { // REFACTOR: przekazywać tylko ID |
| 167 | - if( ($key = array_search($vehicleInspection, $this->vehicleInspection, true)) !== false) { |
|
| 167 | + if (($key = array_search($vehicleInspection, $this->vehicleInspection, true)) !== false) { |
|
| 168 | 168 | unset($this->vehicleInspection[$key]); |
| 169 | 169 | } else { |
| 170 | 170 | throw new RemovingNonexistentElementException; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | { |
| 181 | 181 | $duplicationChecker = new InsuranceDuplicationChecker(); |
| 182 | 182 | $isDuplicated = $duplicationChecker->checkForDuplicates($this->insurances, $newInsurance); |
| 183 | - if($isDuplicated) { |
|
| 183 | + if ($isDuplicated) { |
|
| 184 | 184 | throw new DuplicatedInsuranceException; |
| 185 | 185 | } |
| 186 | 186 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | public function removeInsurance($selectedInsuranceId) |
| 191 | 191 | { |
| 192 | 192 | foreach ($this->insurances as $key => $insurance) { |
| 193 | - if($insurance->getId() === $selectedInsuranceId) { |
|
| 193 | + if ($insurance->getId() === $selectedInsuranceId) { |
|
| 194 | 194 | unset($this->insurances[$key]); |
| 195 | 195 | return 0; |
| 196 | 196 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | public function addInsuranceDocument($insuranceId, InsuranceDocument $insuranceDocument) |
| 203 | 203 | { |
| 204 | 204 | foreach ($this->insurances as &$insurance) { |
| 205 | - if($insurance->getId() === $insuranceId) { |
|
| 205 | + if ($insurance->getId() === $insuranceId) { |
|
| 206 | 206 | $insurance->addInsuranceDocument($insuranceDocument); |
| 207 | 207 | return 0; |
| 208 | 208 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | public function getInsuranceDocuments($insuranceId) |
| 215 | 215 | { |
| 216 | 216 | foreach ($this->insurances as $insurance) { |
| 217 | - if($insurance->getId() === $insuranceId) { |
|
| 217 | + if ($insurance->getId() === $insuranceId) { |
|
| 218 | 218 | return $insurance->getInsuranceDocuments(); |
| 219 | 219 | } |
| 220 | 220 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | public function removeInsuranceDocument($insuranceId, $documentId) |
| 248 | 248 | { |
| 249 | 249 | foreach ($this->insurances as $insurance) { |
| 250 | - if($insurance->getId() === $insuranceId) { |
|
| 250 | + if ($insurance->getId() === $insuranceId) { |
|
| 251 | 251 | $insurance->removeInsuranceDocument($documentId); |
| 252 | 252 | return 0; |
| 253 | 253 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | public function find($carId) |
| 24 | 24 | { |
| 25 | - if(!array_key_exists($carId, $this->repository)) { |
|
| 25 | + if (!array_key_exists($carId, $this->repository)) { |
|
| 26 | 26 | throw new CarNotFoundException('Nie znaleziono samochodu o podanym id = ' . $carId); |
| 27 | 27 | } |
| 28 | 28 | |
@@ -31,12 +31,12 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | public function isEmpty() |
| 33 | 33 | { |
| 34 | - return (! count($this->repository)) ?: false; |
|
| 34 | + return (!count($this->repository)) ?: false; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public function remove($carId) |
| 38 | 38 | { |
| 39 | - if(!array_key_exists($carId, $this->repository)) { |
|
| 39 | + if (!array_key_exists($carId, $this->repository)) { |
|
| 40 | 40 | throw new CarNotFoundException('Nie znaleziono samochodu o podanym id = ' . $carId); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -24,10 +24,10 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $document = new DocumentFactory(); |
| 26 | 26 | $carDocument = $document->create(DocumentFactory::CAR_DOCUMENT, |
| 27 | - $this->preparedDocument->docId, |
|
| 28 | - $this->preparedDocument->title, |
|
| 29 | - $this->preparedDocument->description, |
|
| 30 | - $this->preparedDocument->source |
|
| 27 | + $this->preparedDocument->docId, |
|
| 28 | + $this->preparedDocument->title, |
|
| 29 | + $this->preparedDocument->description, |
|
| 30 | + $this->preparedDocument->source |
|
| 31 | 31 | ); |
| 32 | 32 | |
| 33 | 33 | $car = $this->repository->find($this->carId); |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: marek |
|
| 5 | - * Date: 08.12.15 |
|
| 6 | - * Time: 15:43 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: marek |
|
| 5 | + * Date: 08.12.15 |
|
| 6 | + * Time: 15:43 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Madkom\RegistryApplication\Application\CarManagement\Command\Car; |
| 10 | 10 | |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: marek |
|
| 5 | - * Date: 08.12.15 |
|
| 6 | - * Time: 15:43 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: marek |
|
| 5 | + * Date: 08.12.15 |
|
| 6 | + * Time: 15:43 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Madkom\RegistryApplication\Application\CarManagement\Command\Insurance; |
| 10 | 10 | |
@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $car = $this->repository->find($this->carId); |
| 35 | 35 | $insurance = new InsuranceDocument($this->insuranceId, |
| 36 | - $this->document->title, |
|
| 37 | - $this->document->description, |
|
| 38 | - $this->document->source |
|
| 36 | + $this->document->title, |
|
| 37 | + $this->document->description, |
|
| 38 | + $this->document->source |
|
| 39 | 39 | ); |
| 40 | 40 | |
| 41 | 41 | $car->addInsuranceDocument($this->insuranceId, $insurance); |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | $command->car = $command->repository->find($carId); |
| 49 | 49 | |
| 50 | 50 | $command->documentFile = $carInsuranceDocument->create(DocumentFactory::INSURANCE_DOCUMENT, |
| 51 | - $command->documentDTO->docId, |
|
| 52 | - $command->documentDTO->title, |
|
| 53 | - $documentDTO->description, |
|
| 54 | - $documentDTO->source |
|
| 51 | + $command->documentDTO->docId, |
|
| 52 | + $command->documentDTO->title, |
|
| 53 | + $documentDTO->description, |
|
| 54 | + $documentDTO->source |
|
| 55 | 55 | ); |
| 56 | 56 | |
| 57 | 57 | return $command; |
@@ -73,10 +73,10 @@ discard block |
||
| 73 | 73 | $insurance = $this->insuranceDTO; |
| 74 | 74 | $insuranceFactory = new InsuranceFactory(); |
| 75 | 75 | $newInsurance = $insuranceFactory->create($insurance->insuranceId, |
| 76 | - $insurance->type, |
|
| 77 | - new \DateTime($insurance->dateFrom), |
|
| 78 | - new \DateTime($insurance->dateTo), |
|
| 79 | - $insurance->insurerId |
|
| 76 | + $insurance->type, |
|
| 77 | + new \DateTime($insurance->dateFrom), |
|
| 78 | + new \DateTime($insurance->dateTo), |
|
| 79 | + $insurance->insurerId |
|
| 80 | 80 | ); |
| 81 | 81 | |
| 82 | 82 | $this->car->addInsurance($newInsurance); |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: marek |
|
| 5 | - * Date: 18.11.15 |
|
| 6 | - * Time: 15:25 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: marek |
|
| 5 | + * Date: 18.11.15 |
|
| 6 | + * Time: 15:25 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Madkom\RegistryApplication\Application\CarManagement\Command; |
| 10 | 10 | |