File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 9
9
jobs :
10
10
code-style :
11
11
name : Code Style & Static Analysis
12
- runs-on : ubuntu-20.04
12
+ runs-on : ubuntu-latest
13
13
steps :
14
14
- name : Checkout
15
- uses : actions/checkout@v2
15
+ uses : actions/checkout@v4
16
16
17
17
- name : Setup PHP
18
18
uses : shivammathur/setup-php@v2
@@ -32,18 +32,22 @@ jobs:
32
32
33
33
tests :
34
34
name : Test Suite
35
- runs-on : ubuntu-20.04
35
+ runs-on : ubuntu-latest
36
36
strategy :
37
37
max-parallel : 10
38
38
matrix :
39
39
php :
40
40
- 7.4
41
41
- 8.0
42
42
- 8.1
43
+ - 8.2
44
+ - 8.3
45
+ - 8.4
46
+ - 8.5
43
47
44
48
steps :
45
49
- name : Checkout
46
- uses : actions/checkout@v2
50
+ uses : actions/checkout@v4
47
51
48
52
- name : Setup PHP
49
53
uses : shivammathur/setup-php@v2
Original file line number Diff line number Diff line change 19
19
},
20
20
"require" : {
21
21
"php" : " >=7.4" ,
22
- "bentools/cartesian-product" : " ^1.1 "
22
+ "bentools/cartesian-product" : " ^1.5|^2.0 "
23
23
},
24
24
"require-dev" : {
25
25
"phpunit/phpunit" : " ^8.0|^9.0" ,
Original file line number Diff line number Diff line change 2
2
3
3
namespace BenTools \StringCombinations ;
4
4
5
- use function BenTools \CartesianProduct \cartesian_product ;
5
+ use function BenTools \CartesianProduct \combinations ;
6
6
use Countable ;
7
7
use IteratorAggregate ;
8
8
use Traversable ;
@@ -54,7 +54,7 @@ public function count(): int
54
54
{
55
55
if (null === $ this ->count ) {
56
56
$ this ->count = array_sum (array_map (function ($ set ) {
57
- return count (cartesian_product ($ set ));
57
+ return count (combinations ($ set ));
58
58
}, iterator_to_array ($ this ->generateSets ())));
59
59
}
60
60
return $ this ->count ;
@@ -63,7 +63,7 @@ public function count(): int
63
63
public function getIterator (): Traversable
64
64
{
65
65
foreach ($ this ->generateSets () as $ set ) {
66
- foreach (cartesian_product ($ set ) as $ combination ) {
66
+ foreach (combinations ($ set ) as $ combination ) {
67
67
yield implode ($ this ->glue , $ combination );
68
68
}
69
69
}
You can’t perform that action at this time.
0 commit comments