Skip to content

Commit a791362

Browse files
Support first class callable syntax
1 parent 39deee9 commit a791362

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/MethodsTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ public function it can transform a value using a callable string method
4949
);
5050
}
5151

52+
/**
53+
* @test
54+
* @requires PHP >= 8.1
55+
*/
56+
public function it can transform a value using a first call callable string method using the method directly(): void
57+
{
58+
$this->assertSame(
59+
'stringggg',
60+
take('STRINGGgg')
61+
->pipe(strtolower(...))
62+
->get()
63+
);
64+
}
65+
5266
/**
5367
* @test
5468
*/
@@ -90,6 +104,20 @@ public function it can transform a value using a public class method():
90104
);
91105
}
92106

107+
/**
108+
* @test
109+
* @requires PHP >= 8.1
110+
*/
111+
public function it can transform a value using a first class callable class method(): void
112+
{
113+
$this->assertSame(
114+
'UPPERCASE',
115+
take('uppercase')
116+
->pipe($this->uppercase(...))
117+
->get()
118+
);
119+
}
120+
93121
/**
94122
* @test
95123
*/

0 commit comments

Comments
 (0)