Skip to content

Commit

Permalink
Merge pull request #7 from karam-mustafa/revert-2-analysis-orVQGN
Browse files Browse the repository at this point in the history
Revert "Apply fixes from StyleCI"
  • Loading branch information
karam-mustafa authored Dec 17, 2021
2 parents 547f095 + 235399d commit 2601652
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 26 deletions.
5 changes: 2 additions & 3 deletions src/Interfaces/GeoInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ public function getDistance();
public function getCenter();

/**
* clear all stored results.
*
* @return GeoInterface
* clear all stored results
*
* @return GeoInterface
* @author karam mustafa
*/
public function clearResult();
Expand Down
31 changes: 16 additions & 15 deletions src/Traits/DataStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ trait DataStorage
*/
private $units = [
'mile' => 1,
'km' => 1.609344,
'm' => (1.609344 * 1000),
'cm' => (1.609344 * 100),
'mm' => (1.609344 * 1000 * 1000),
'km' => 1.609344,
'm' => (1.609344 * 1000),
'cm' => (1.609344 * 100),
'mm' => (1.609344 * 1000 * 1000),
];
/**
* for develop and resolve any options.
Expand All @@ -71,7 +71,7 @@ public function getUnits()
}

/**
* @param array $units
* @param array $units
*
* @return DataStorage
*
Expand All @@ -85,7 +85,7 @@ public function setUnits($units)
}

/**
* @param mixed $key
* @param mixed $key
*
* @return array
*
Expand All @@ -99,7 +99,7 @@ public function getOptions($key = null)
}

/**
* @param array $options
* @param array $options
*
* @return DataStorage
*
Expand All @@ -113,7 +113,7 @@ public function setOptions($options)
}

/**
* @param null $index
* @param null $index
*
* @return array
*
Expand Down Expand Up @@ -141,7 +141,7 @@ public function setPoint($point)
}

/**
* @param array $points
* @param array $points
*
* @return DataStorage
*
Expand All @@ -165,8 +165,9 @@ public function getResult()
}

/**
* @param mixed $result
* @param bool $force
* @param mixed $result
*
* @param bool $force
*
* @return DataStorage
*
Expand All @@ -192,7 +193,7 @@ public function clearStoredResults()
}

/**
* @param string $key
* @param string $key
*
* @return mixed
*
Expand All @@ -206,8 +207,8 @@ public function getFromStorage($key = null)
}

/**
* @param string $key
* @param mixed $value
* @param string $key
* @param mixed $value
*
* @return DataStorage
*
Expand All @@ -233,7 +234,7 @@ public function clearStorage()
}

/**
* @param mixed $keys
* @param mixed $keys
*
* @return DataStorage
*
Expand Down
12 changes: 5 additions & 7 deletions src/Traits/Distances.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,11 @@ private function getValueForAngleBetween()
*/
private function calcDistance()
{
$this->setInStorage(
'distance',
$this->setInStorage('distance',
acos($this->getSin() + $this->getCos() * $this->getValueForAngleBetween())
)->setInStorage(
'rad2deg',
)->setInStorage('rad2deg',
rad2deg($this->getFromStorage('distance'))
)->setInStorage(
'correctDistanceValue',
)->setInStorage('correctDistanceValue',
$this->correctDistanceValue($this->getFromStorage('rad2deg'))
);

Expand Down Expand Up @@ -249,10 +246,11 @@ private function resolveDistanceWithUnits($distance)
// remove un required results and get the results from storage.
return $this
->removeFromStorage('position', 'distance_key')
->removeFromStorage('distance', 'rad2deg', 'correctDistanceValue')
->removeFromStorage('distance' , 'rad2deg' , 'correctDistanceValue')
->getFromStorage();
}


/**
* check if user chose any units.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/AreasTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function test_center()
->getCenter();

$this->assertEquals([
'lat' => 27.508023496931,
'lat' => 27.508023496931,
'long' => 38.424795502212,
], $result);
}
Expand Down

0 comments on commit 2601652

Please sign in to comment.