Skip to content

Commit 56ab0f5

Browse files
committed
remove dependency in dev to webforge/collections, because its really just used in one place
1 parent fb65a22 commit 56ab0f5

3 files changed

Lines changed: 173 additions & 92 deletions

File tree

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"require-dev": {
1616
"mikey179/vfsstream": "^1.6@stable",
1717
"mockery/mockery": "@stable",
18-
"webforge/collections": "^1.0@dev",
1918
"friendsofphp/php-cs-fixer": "^3",
20-
"phpunit/phpunit": "^10.5"
19+
"phpunit/phpunit": "^10.5",
20+
"doctrine/collections": "^2.3"
2121
},
2222
"autoload": {
2323
"psr-0": {"Webforge\\Common": ["src/php/", "tests/php/"]}
@@ -30,7 +30,7 @@
3030
},
3131
"extra": {
3232
"branch-alias": {
33-
"dev-master": "2.0.x-dev"
33+
"dev-master": "3.0.x-dev"
3434
}
3535
}
3636
}

composer.lock

Lines changed: 165 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/php/Webforge/Common/UtilTest.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Webforge\Common;
44

55
use ArrayIterator;
6+
use Doctrine\Common\Collections\ArrayCollection;
67
use stdClass;
7-
use Webforge\Collections\TraversableCollection;
88

99
class UtilTest extends \PHPUnit\Framework\TestCase
1010
{
@@ -64,17 +64,12 @@ public function testCastArray($item, $expected): void
6464
);
6565
}
6666

67-
public static function provideCastArray()
67+
public static function provideCastArray(): array
6868
{
6969
$tests = [];
70-
71-
$test = function () use (&$tests): void {
72-
$tests[] = func_get_args();
73-
};
74-
75-
$test($iterator = new ArrayIterator([1, 2, 3]), [1, 2, 3]);
76-
$test([1, 2, 3], [1, 2, 3]);
77-
$test(new TraversableCollection(['0' => 'nil', '1' => 'one']), ['0' => 'nil', '1' => 'one']);
70+
$tests[] = [$iterator = new ArrayIterator([1, 2, 3]), [1, 2, 3]];
71+
$tests[] = [[1, 2, 3], [1, 2, 3]];
72+
$tests[] = [new ArrayCollection(['0' => 'nil', '1' => 'one']), ['0' => 'nil', '1' => 'one']];
7873

7974
return $tests;
8075
}

0 commit comments

Comments
 (0)