mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-09-28 06:59:02 +00:00
Add type hint and exceptions annotation
This commit is contained in:
parent
d32197100e
commit
2363bbaa75
@ -60,6 +60,8 @@ class Cluster extends Point implements IteratorAggregate, Countable
|
||||
* @param Point $point
|
||||
*
|
||||
* @return Point
|
||||
*
|
||||
* @throws \LogicException
|
||||
*/
|
||||
public function attach(Point $point)
|
||||
{
|
||||
|
@ -53,11 +53,11 @@ class Point implements ArrayAccess
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $points
|
||||
* @param array $points
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getClosest($points)
|
||||
public function getClosest(array $points)
|
||||
{
|
||||
foreach ($points as $point) {
|
||||
$distance = $this->getDistanceWith($point, false);
|
||||
|
@ -65,7 +65,7 @@ class Space extends SplObjectStorage
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object $point
|
||||
* @param Point $point
|
||||
* @param null $data
|
||||
*/
|
||||
public function attach($point, $data = null)
|
||||
|
Loading…
Reference in New Issue
Block a user