@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | protected function execute(InputInterface $input, OutputInterface $output) |
| 32 | 32 | { |
| 33 | - $warehouse = Warehouse::createFromJson(getcwd() . "/resources/biggerWarehouse.json"); |
|
| 33 | + $warehouse = Warehouse::createFromJson(getcwd()."/resources/biggerWarehouse.json"); |
|
| 34 | 34 | |
| 35 | 35 | /** @var Place $nodeStart */ |
| 36 | 36 | $nodeStart = $warehouse->getPlacesCollector()->getPlaces()[5]; |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $table->setRows($calculatedMatrix); |
| 46 | 46 | $table->render(); |
| 47 | 47 | |
| 48 | - $output->writeln("Start: " . $nodeStart->getName()); |
|
| 49 | - $output->writeln("End: " . $nodeEnd->getName()); |
|
| 50 | - $output->writeln("Total path: " . $nodeEnd->getCurrentWeight()); |
|
| 48 | + $output->writeln("Start: ".$nodeStart->getName()); |
|
| 49 | + $output->writeln("End: ".$nodeEnd->getName()); |
|
| 50 | + $output->writeln("Total path: ".$nodeEnd->getCurrentWeight()); |
|
| 51 | 51 | } |
| 52 | 52 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | protected function execute(InputInterface $input, OutputInterface $output) |
| 33 | 33 | { |
| 34 | 34 | /** @var Warehouse $warehouse */ |
| 35 | - $warehouse = Warehouse::createFromJson(getcwd() . "/../resources/biggerWarehouse.json"); |
|
| 35 | + $warehouse = Warehouse::createFromJson(getcwd()."/../resources/biggerWarehouse.json"); |
|
| 36 | 36 | $calculatedArray = $warehouse->getPlacesCollector()->getPlaces(); |
| 37 | 37 | |
| 38 | 38 | $warehouse->setPathCalculator(new ShortPathCalculator()); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | protected function execute(InputInterface $input, OutputInterface $output) |
| 32 | 32 | { |
| 33 | 33 | /** @var Warehouse $warehouse */ |
| 34 | - $warehouse = Warehouse::createFromJson(getcwd() . "/./resources/simpleWarehouse.json"); |
|
| 34 | + $warehouse = Warehouse::createFromJson(getcwd()."/./resources/simpleWarehouse.json"); |
|
| 35 | 35 | |
| 36 | 36 | $this->printTable($output, array(), $warehouse->createMatrix()); |
| 37 | 37 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | protected function execute(InputInterface $input, OutputInterface $output) |
| 33 | 33 | { |
| 34 | 34 | /** @var Warehouse $warehouse */ |
| 35 | - $warehouse = Warehouse::createFromJson(getcwd() . "/../resources/biggerWarehouse.json"); |
|
| 35 | + $warehouse = Warehouse::createFromJson(getcwd()."/../resources/biggerWarehouse.json"); |
|
| 36 | 36 | $calculatedArray = $warehouse->getPlacesCollector()->getPlaces(); |
| 37 | 37 | |
| 38 | 38 | $warehouse->setPathCalculator(new FastCalculator()); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function createBreadcrumb(Place $startPlace, Place $endPlace = null) |
| 64 | 64 | { |
| 65 | - if ( is_callable( $this->onPreCreateBreadcumb ) ) { |
|
| 65 | + if (is_callable($this->onPreCreateBreadcumb)) { |
|
| 66 | 66 | call_user_func($this->onPreCreateBreadcumb, $startPlace, $this->placeCollector->getPlacesType()); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -73,10 +73,10 @@ discard block |
||
| 73 | 73 | /** @var Place $current */ |
| 74 | 74 | $current = array_shift($frontier); |
| 75 | 75 | |
| 76 | - if( $current->getCurrentWeight() > $this->precision ) |
|
| 76 | + if ($current->getCurrentWeight() > $this->precision) |
|
| 77 | 77 | continue; |
| 78 | 78 | |
| 79 | - if ( is_callable( $this->onWalk ) ) { |
|
| 79 | + if (is_callable($this->onWalk)) { |
|
| 80 | 80 | call_user_func($this->onWalk, $current); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -73,8 +73,9 @@ |
||
| 73 | 73 | /** @var Place $current */ |
| 74 | 74 | $current = array_shift($frontier); |
| 75 | 75 | |
| 76 | - if( $current->getCurrentWeight() > $this->precision ) |
|
| 77 | - continue; |
|
| 76 | + if( $current->getCurrentWeight() > $this->precision ) { |
|
| 77 | + continue; |
|
| 78 | + } |
|
| 78 | 79 | |
| 79 | 80 | if ( is_callable( $this->onWalk ) ) { |
| 80 | 81 | call_user_func($this->onWalk, $current); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | public function testTransformToTreeConstructor(): void |
| 17 | 17 | { |
| 18 | 18 | /** @var Warehouse $testMatrix */ |
| 19 | - $testMatrix = Warehouse::createFromJson(getcwd() . "/resources/simpleWarehouse.json"); |
|
| 19 | + $testMatrix = Warehouse::createFromJson(getcwd()."/resources/simpleWarehouse.json"); |
|
| 20 | 20 | |
| 21 | 21 | $calculatedArray = $testMatrix->getPlacesCollector()->getPlaces(); |
| 22 | 22 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function testBigConstructor(): void |
| 37 | 37 | { |
| 38 | 38 | /** @var Warehouse $testMatrix */ |
| 39 | - $testMatrix = Warehouse::createFromJson(getcwd() . "/resources/biggerWarehouse.json"); |
|
| 39 | + $testMatrix = Warehouse::createFromJson(getcwd()."/resources/biggerWarehouse.json"); |
|
| 40 | 40 | |
| 41 | 41 | $calculatedArray = $testMatrix->getPlacesCollector()->getPlaces(); |
| 42 | 42 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function testBigMultiplePath(): void |
| 57 | 57 | { |
| 58 | 58 | /** @var Warehouse $testMatrix */ |
| 59 | - $testMatrix = Warehouse::createFromJson(getcwd() . "/resources/biggerWarehouse.json"); |
|
| 59 | + $testMatrix = Warehouse::createFromJson(getcwd()."/resources/biggerWarehouse.json"); |
|
| 60 | 60 | |
| 61 | 61 | $calculatedArray = $testMatrix->getPlacesCollector()->getPlaces(); |
| 62 | 62 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function testBigFastMultiplePath(): void |
| 96 | 96 | { |
| 97 | - $path = getcwd() . "/resources/biggerWarehouse.json"; |
|
| 97 | + $path = getcwd()."/resources/biggerWarehouse.json"; |
|
| 98 | 98 | $placesCollector = new PlacesCollector(); |
| 99 | 99 | $placesCollector->addBasePlaceTypes(); |
| 100 | 100 | |