protected function getOrderedByDistanceAsc(): array
    {
        $values = $this->getIndexedValues();
        uksort($values, function ($oneDistanceInMeters, $anotherDistanceInMeters) {
            /** @noinspection ExceptionsAnnotatingAndHandlingInspection */
            $oneDistanceInMeters = ToFloat::toPositiveFloat($oneDistanceInMeters);
            /** @noinspection ExceptionsAnnotatingAndHandlingInspection */
            $anotherDistanceInMeters = ToFloat::toPositiveFloat($anotherDistanceInMeters);

            return $oneDistanceInMeters <=> $anotherDistanceInMeters; // lowest first
        });

        return $values;
    }
protected function getOrderedByDistanceAsc(): array
    {
        $values = $this->getIndexedValues();
        uksort($values, function ($oneDistanceInMeters, $anotherDistanceInMeters) {
            /** @noinspection ExceptionsAnnotatingAndHandlingInspection */
            $oneDistanceInMeters = ToFloat::toPositiveFloat($oneDistanceInMeters);
            /** @noinspection ExceptionsAnnotatingAndHandlingInspection */
            $anotherDistanceInMeters = ToFloat::toPositiveFloat($anotherDistanceInMeters);

            return $oneDistanceInMeters <=> $anotherDistanceInMeters; // lowest first
        });

        return $values;
    }
protected function getOrderedByDistanceAsc ( ) : array { $ values = $ this -> getIndexedValues ( ) ; uksort ( $ values , function ( $ oneDistanceInMeters , $ anotherDistanceInMeters ) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ $ oneDistanceInMeters = ToFloat :: toPositiveFloat ( $ oneDistanceInMeters ) ; /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ $ anotherDistanceInMeters = ToFloat :: toPositiveFloat ( $ anotherDistanceInMeters ) ; return $ oneDistanceInMeters <=> $ anotherDistanceInMeters ; // lowest first } ) ; return $ values ; }
Values may be already ordered from file, but have to be sure.

@return array
Values may be already ordered from file but have to be sure .