Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
language: php

dist: bionic
php:
- 7.3
- 7.4
- 8.0
- 8.1.0

# This triggers builds to run on the new TravisCI infrastructure.
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
[ico-downloads]: https://img.shields.io/packagist/dt/hexogen/kdtree.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/hexogen/kdtree
[link-travis]: https://travis-ci.org/hexogen/kdtree
[link-travis]: https://app.travis-ci.com/hexogen/kdtree.svg?branch=master
[link-scrutinizer]: https://scrutinizer-ci.com/g/hexogen/kdtree/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/hexogen/kdtree
[link-downloads]: https://packagist.org/packages/hexogen/kdtree
Expand Down
12 changes: 6 additions & 6 deletions src/NearestSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function search(PointInterface $point, int $resultLength = 1) : array
if ($root == null) {
return [];
}

/**
* @var array orthogonal square distances to the point
*/
Expand Down Expand Up @@ -105,9 +105,9 @@ private function getOrthogonalDistances(PointInterface $point, array $upperBound
* Calculate minimal possible Euclidean distance from the point to an item
*
* @param $orthogonalDistances
* @return int
* @return float
*/
private function getPossibleDistance(array $orthogonalDistances) : int
private function getPossibleDistance(array $orthogonalDistances) : float
{
$possibleDistance = 0.;
foreach ($orthogonalDistances as $orthogonalDistance) {
Expand Down Expand Up @@ -282,7 +282,7 @@ private function branchSearch(
array $orthogonalDistances,
float $possibleDistance
) {

// possible orthogonal distances to the right node
$branchOrthogonalDistances = $orthogonalDistances;
$branchPossibleDistance = $possibleDistance;
Expand Down Expand Up @@ -350,7 +350,7 @@ private function smartBranchesSearch(
array $orthogonalDistances,
float $possibleDistance
) {

// possible orthogonal distances to the right node
$leftOrthogonalDistances = $rightOrthogonalDistances = $orthogonalDistances;
$leftPossibleDistance = $rightPossibleDistance = $possibleDistance;
Expand Down Expand Up @@ -421,7 +421,7 @@ public function prioritySearch(
float $secondPossibleDistance,
int $nextDimension
) {

if ($firstPossibleDistance < $this->maxQueuedDistance) {
$this->searchNearest(
$firstNode,
Expand Down