Fix 'toSmall' typo (#234)

This commit is contained in:
Marcin Michalski 2018-02-15 18:14:06 +01:00 committed by Arkadiusz Kondas
parent 451f84c2e6
commit 6ac61a860c
8 changed files with 10 additions and 10 deletions

View File

@ -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));
}

View File

@ -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 {

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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 = [

View File

@ -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);

View File

@ -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]);