diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index e02d14d..8aebbe0 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -23,7 +23,7 @@ class InvalidArgumentException extends Exception return new self('The array has zero elements'); } - public static function arraySizeToSmall(int $minimumSize = 2): self + public static function arraySizeTooSmall(int $minimumSize = 2): self { return new self(sprintf('The array must have at least %d elements', $minimumSize)); } diff --git a/src/Math/Statistic/ANOVA.php b/src/Math/Statistic/ANOVA.php index b0d0d37..65548a1 100644 --- a/src/Math/Statistic/ANOVA.php +++ b/src/Math/Statistic/ANOVA.php @@ -25,7 +25,7 @@ final class ANOVA { $classes = count($samples); if ($classes < 2) { - throw InvalidArgumentException::arraySizeToSmall(2); + throw InvalidArgumentException::arraySizeTooSmall(2); } $samplesPerClass = array_map(function (array $class): int { diff --git a/src/Math/Statistic/Covariance.php b/src/Math/Statistic/Covariance.php index ac24a53..3dfce4b 100644 --- a/src/Math/Statistic/Covariance.php +++ b/src/Math/Statistic/Covariance.php @@ -21,7 +21,7 @@ class Covariance $n = count($x); if ($sample && $n === 1) { - throw InvalidArgumentException::arraySizeToSmall(2); + throw InvalidArgumentException::arraySizeTooSmall(2); } if ($meanX === null) { @@ -59,7 +59,7 @@ class Covariance $n = count($data); if ($sample && $n === 1) { - throw InvalidArgumentException::arraySizeToSmall(2); + throw InvalidArgumentException::arraySizeTooSmall(2); } if ($i < 0 || $k < 0 || $i >= $n || $k >= $n) { diff --git a/src/Math/Statistic/StandardDeviation.php b/src/Math/Statistic/StandardDeviation.php index 426e4fd..5bf4940 100644 --- a/src/Math/Statistic/StandardDeviation.php +++ b/src/Math/Statistic/StandardDeviation.php @@ -20,7 +20,7 @@ class StandardDeviation $n = count($numbers); if ($sample && $n === 1) { - throw InvalidArgumentException::arraySizeToSmall(2); + throw InvalidArgumentException::arraySizeTooSmall(2); } $mean = Mean::arithmetic($numbers); diff --git a/tests/CrossValidation/RandomSplitTest.php b/tests/CrossValidation/RandomSplitTest.php index 75f60ff..65e8d8b 100644 --- a/tests/CrossValidation/RandomSplitTest.php +++ b/tests/CrossValidation/RandomSplitTest.php @@ -11,7 +11,7 @@ use PHPUnit\Framework\TestCase; class RandomSplitTest extends TestCase { - public function testThrowExceptionOnToSmallTestSize(): void + public function testThrowExceptionOnTooSmallTestSize(): void { $this->expectException(InvalidArgumentException::class); new RandomSplit(new ArrayDataset([], []), 0); diff --git a/tests/Math/Statistic/ANOVATest.php b/tests/Math/Statistic/ANOVATest.php index 81717f8..2203bf1 100644 --- a/tests/Math/Statistic/ANOVATest.php +++ b/tests/Math/Statistic/ANOVATest.php @@ -32,7 +32,7 @@ final class ANOVATest extends TestCase self::assertEquals([0.6, 2.4, 1.24615385], ANOVA::oneWayF($samples), '', 0.00000001); } - public function testThrowExceptionOnToSmallSamples(): void + public function testThrowExceptionOnTooSmallSamples(): void { $this->expectException(InvalidArgumentException::class); $samples = [ diff --git a/tests/Math/Statistic/CovarianceTest.php b/tests/Math/Statistic/CovarianceTest.php index 43b775a..fd7187a 100644 --- a/tests/Math/Statistic/CovarianceTest.php +++ b/tests/Math/Statistic/CovarianceTest.php @@ -73,7 +73,7 @@ class CovarianceTest extends TestCase Covariance::fromXYArrays([1, 2, 3], []); } - public function testThrowExceptionOnToSmallArrayIfSample(): void + public function testThrowExceptionOnTooSmallArrayIfSample(): void { $this->expectException(InvalidArgumentException::class); Covariance::fromXYArrays([1], [2], true); @@ -85,7 +85,7 @@ class CovarianceTest extends TestCase Covariance::fromDataset([], 0, 1); } - public function testThrowExceptionOnToSmallDatasetIfSample(): void + public function testThrowExceptionOnTooSmallDatasetIfSample(): void { $this->expectException(InvalidArgumentException::class); Covariance::fromDataset([1], 0, 1); diff --git a/tests/Math/Statistic/StandardDeviationTest.php b/tests/Math/Statistic/StandardDeviationTest.php index 51c2770..c6fd47e 100644 --- a/tests/Math/Statistic/StandardDeviationTest.php +++ b/tests/Math/Statistic/StandardDeviationTest.php @@ -32,7 +32,7 @@ class StandardDeviationTest extends TestCase StandardDeviation::population([], false); } - public function testThrowExceptionOnToSmallArray(): void + public function testThrowExceptionOnTooSmallArray(): void { $this->expectException(InvalidArgumentException::class); StandardDeviation::population([1]);