Skip to content

Commit

Permalink
Fix 'toSmall' typo (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
marmichalski authored and akondas committed Feb 15, 2018
1 parent 451f84c commit 6ac61a8
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static function arrayCantBeEmpty(): self
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));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Math/Statistic/ANOVA.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function oneWayF(array $samples): array
{
$classes = count($samples);
if ($classes < 2) {
throw InvalidArgumentException::arraySizeToSmall(2);
throw InvalidArgumentException::arraySizeTooSmall(2);
}

$samplesPerClass = array_map(function (array $class): int {
Expand Down
4 changes: 2 additions & 2 deletions src/Math/Statistic/Covariance.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static function fromXYArrays(array $x, array $y, bool $sample = true, ?fl

$n = count($x);
if ($sample && $n === 1) {
throw InvalidArgumentException::arraySizeToSmall(2);
throw InvalidArgumentException::arraySizeTooSmall(2);
}

if ($meanX === null) {
Expand Down Expand Up @@ -59,7 +59,7 @@ public static function fromDataset(array $data, int $i, int $k, bool $sample = t

$n = count($data);
if ($sample && $n === 1) {
throw InvalidArgumentException::arraySizeToSmall(2);
throw InvalidArgumentException::arraySizeTooSmall(2);
}

if ($i < 0 || $k < 0 || $i >= $n || $k >= $n) {
Expand Down
2 changes: 1 addition & 1 deletion src/Math/Statistic/StandardDeviation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function population(array $numbers, bool $sample = true): float
$n = count($numbers);

if ($sample && $n === 1) {
throw InvalidArgumentException::arraySizeToSmall(2);
throw InvalidArgumentException::arraySizeTooSmall(2);
}

$mean = Mean::arithmetic($numbers);
Expand Down
2 changes: 1 addition & 1 deletion tests/CrossValidation/RandomSplitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class RandomSplitTest extends TestCase
{
public function testThrowExceptionOnToSmallTestSize(): void
public function testThrowExceptionOnTooSmallTestSize(): void
{
$this->expectException(InvalidArgumentException::class);
new RandomSplit(new ArrayDataset([], []), 0);
Expand Down
2 changes: 1 addition & 1 deletion tests/Math/Statistic/ANOVATest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testOneWayFWithDifferingSizes(): void
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 = [
Expand Down
4 changes: 2 additions & 2 deletions tests/Math/Statistic/CovarianceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testThrowExceptionOnEmptyY(): void
Covariance::fromXYArrays([1, 2, 3], []);
}

public function testThrowExceptionOnToSmallArrayIfSample(): void
public function testThrowExceptionOnTooSmallArrayIfSample(): void
{
$this->expectException(InvalidArgumentException::class);
Covariance::fromXYArrays([1], [2], true);
Expand All @@ -85,7 +85,7 @@ public function testThrowExceptionIfEmptyDataset(): void
Covariance::fromDataset([], 0, 1);
}

public function testThrowExceptionOnToSmallDatasetIfSample(): void
public function testThrowExceptionOnTooSmallDatasetIfSample(): void
{
$this->expectException(InvalidArgumentException::class);
Covariance::fromDataset([1], 0, 1);
Expand Down
2 changes: 1 addition & 1 deletion tests/Math/Statistic/StandardDeviationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testThrowExceptionOnEmptyArrayIfNotSample(): void
StandardDeviation::population([], false);
}

public function testThrowExceptionOnToSmallArray(): void
public function testThrowExceptionOnTooSmallArray(): void
{
$this->expectException(InvalidArgumentException::class);
StandardDeviation::population([1]);
Expand Down

0 comments on commit 6ac61a8

Please sign in to comment.