Skip to content

Commit

Permalink
Add type hint and exceptions annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
akondas committed Dec 12, 2016
1 parent d321971 commit 2363bba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Phpml/Clustering/KMeans/Cluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public function toArray()
* @param Point $point
*
* @return Point
*
* @throws \LogicException
*/
public function attach(Point $point)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Phpml/Clustering/KMeans/Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public function getDistanceWith(self $point, $precise = true)
}

/**
* @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);
Expand Down
2 changes: 1 addition & 1 deletion src/Phpml/Clustering/KMeans/Space.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function addPoint(array $coordinates, $data = null)
}

/**
* @param object $point
* @param Point $point
* @param null $data
*/
public function attach($point, $data = null)
Expand Down

0 comments on commit 2363bba

Please sign in to comment.