mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-10 17:28:40 +00:00
fix tests
This commit is contained in:
parent
5230892673
commit
126fca5574
|
|
@ -188,7 +188,7 @@ final class AffinityPropagation implements ClusteringInterface
|
|||
/**
|
||||
* Find the nearest group for a point
|
||||
*
|
||||
* @param array<int, array<int, int|float>> $similarityMatrix Similarity matrix
|
||||
* @param array<int, Point> $similarityMatrix Similarity matrix
|
||||
* @param int $point Point id in the similarity matrix to compare
|
||||
*
|
||||
* @return int
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ final class AgglomerativeClustering implements ClusteringInterface
|
|||
* @var \Closure
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private \Closure $metric;
|
||||
public \Closure $metric;
|
||||
|
||||
/**
|
||||
* Metric to calculate the distance between two points
|
||||
|
|
@ -50,7 +50,7 @@ final class AgglomerativeClustering implements ClusteringInterface
|
|||
* @var \Closure
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private \Closure $linkage;
|
||||
public \Closure $linkage;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class Point implements PointInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isEquals(PointInterface $point) : bool
|
||||
public function isEquals(Point $point) : bool
|
||||
{
|
||||
return $this->name === $point->name && $this->coordinates === $point->coordinates;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ interface PointInterface
|
|||
/**
|
||||
* Check if two points are equal
|
||||
*
|
||||
* @param self $point Point to compare with
|
||||
* @param Point $point Point to compare with
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function isEquals(self $point) : bool;
|
||||
public function isEquals(Point $point) : bool;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,8 +139,8 @@ final class Loan
|
|||
*
|
||||
* @param float $loan Loan amount
|
||||
* @param float $r Rate
|
||||
* @param float $duration Loan duration
|
||||
* @param float $interval Payment interval
|
||||
* @param int $duration Loan duration
|
||||
* @param int $interval Payment interval
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -156,7 +156,7 @@ final class Loan
|
|||
*
|
||||
* @param float $loan Loan amount
|
||||
* @param float $r Rate
|
||||
* @param float $interval Payment interval
|
||||
* @param int $interval Payment interval
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -171,7 +171,7 @@ final class Loan
|
|||
* Calculate the principal for amortization loans
|
||||
*
|
||||
* @param float $payment Total payment
|
||||
* @param float $interval Payment interval
|
||||
* @param float $interest Interest payment
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -183,6 +183,8 @@ final class Loan
|
|||
}
|
||||
|
||||
/**
|
||||
* Calculate schedule for amortization loan
|
||||
*
|
||||
* @param float $loan Loan amount
|
||||
* @param float $r Borrowing rate (annual)
|
||||
* @param int $duration Loan duration in months
|
||||
|
|
|
|||
|
|
@ -217,6 +217,9 @@ abstract class CodeAbstract
|
|||
public function saveToPngFile(string $file) : void
|
||||
{
|
||||
$res = $this->get();
|
||||
if ($res === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
\imagepng($res, $file);
|
||||
\imagedestroy($res);
|
||||
|
|
@ -234,6 +237,9 @@ abstract class CodeAbstract
|
|||
public function saveToJpgFile(string $file) : void
|
||||
{
|
||||
$res = $this->get();
|
||||
if ($res === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
\imagejpeg($res, $file);
|
||||
\imagedestroy($res);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user