From e6fcece8c60ef52fb12b1c21f7093f1292208be9 Mon Sep 17 00:00:00 2001 From: PapsOu Date: Thu, 18 Jul 2019 14:22:07 +0200 Subject: [PATCH 1/2] Allow override of static method Dijkstra::distance --- src/Dijkstra.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Dijkstra.php b/src/Dijkstra.php index 66faccb..4fbdb56 100644 --- a/src/Dijkstra.php +++ b/src/Dijkstra.php @@ -130,9 +130,9 @@ protected function calculateWeight(Point $parent, Point $child): void * ENDIF */ if (! $this->weights[$child->ref]['passed'] - && ($this->weights[$parent->ref]['weight'] + self::distance($parent, $child) < $this->weights[$child->ref]['weight'] + && ($this->weights[$parent->ref]['weight'] + static::distance($parent, $child) < $this->weights[$child->ref]['weight'] || $this->weights[$child->ref]['weight'] === -1)) { - $this->weights[$child->ref]['weight'] = $this->weights[$parent->ref]['weight'] + self::distance($parent, $child); + $this->weights[$child->ref]['weight'] = $this->weights[$parent->ref]['weight'] + static::distance($parent, $child); $this->predecessors[$child->ref]['previous'] = $parent; } } From 93e142b833717f0f33ebe3c7561f94504361e0df Mon Sep 17 00:00:00 2001 From: PapsOu Date: Thu, 18 Jul 2019 17:22:12 +0200 Subject: [PATCH 2/2] Add ext-bcmath in composer requirements --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bf4fed8..c0b244f 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ } ], "require": { - "php": "^7.1" + "php": "^7.1", + "ext-bcmath": "*" }, "require-dev": { "ext-gd": "*",