Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ $generator = function () {
yield 2;
};

$reduce = static function ($carry, $item) {
$reduce = function ($carry, $item) {
return $carry + $item;
};

Expand Down
7 changes: 1 addition & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@
>
<testsuites>
<testsuite name="Test Suite">
<file>tests/TestIsIterable.php</file>
<file>tests/TestIterableToArray.php</file>
<file>tests/TestIterableToTraversable.php</file>
<file>tests/TestIterableFilter.php</file>
<file>tests/TestIterableMap.php</file>
<file>tests/TestIterableObject.php</file>
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
Expand Down
2 changes: 1 addition & 1 deletion tests/TestIsIterable.php → tests/IsIterableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use PHPUnit\Framework\TestCase;

class TestIsIterable extends TestCase
final class IsIterableTest extends TestCase
{

public function testFunctionExists()
Expand Down
6 changes: 4 additions & 2 deletions tests/TestIterableFilter.php → tests/IterableFilterTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class TestIterableFilter extends \PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

final class IterableFilterTest extends TestCase
{

public function testArrayFilter()
Expand Down Expand Up @@ -31,4 +33,4 @@ public function testInvalidIterable()
};
iterable_filter('foo', $filter);
}
}
}
6 changes: 4 additions & 2 deletions tests/TestIterableMap.php → tests/IterableMapTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class TestIterableMap extends \PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

final class IterableMapTest extends TestCase
{

public function testArrayMap()
Expand All @@ -27,4 +29,4 @@ public function testInvalidIterable()
};
iterable_map('foo', $filter);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class TestIterableObject extends \PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;

final class IterableObjectTest extends TestCase
{

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/TestIterableReduce.php → tests/IterableReduceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

use PHPUnit\Framework\TestCase;

final class TestIterableReduce extends TestCase
final class IterableReduceTest extends TestCase
{
public function testArrayReduce()
{
$iterable = array(1, 2);
$reduce = static function ($carry, $item) {
$reduce = function ($carry, $item) {
return $carry + $item;
};
self::assertSame(3, iterable_reduce($iterable, $reduce, 0));
Expand All @@ -16,7 +16,7 @@ public function testArrayReduce()
public function testTraversableReduce()
{
$iterable = SplFixedArray::fromArray(array(1, 2));
$reduce = static function ($carry, $item) {
$reduce = function ($carry, $item) {
return $carry + $item;
};
self::assertSame(3, iterable_reduce($iterable, $reduce, 0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use PHPUnit\Framework\TestCase;

class TestIterableToArray extends TestCase
final class IterableToArrayTest extends TestCase
{

public function testFunctionExists()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use PHPUnit\Framework\TestCase;

class TestIterableToTraversable extends TestCase
final class IterableToTraversableTest extends TestCase
{

public function testFunctionExists()
Expand Down