We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45aa554 commit 7292fdbCopy full SHA for 7292fdb
src/Strategy/Trim.php
@@ -7,6 +7,6 @@ class Trim extends Delegate
7
{
8
public function __invoke($data, $context = null)
9
10
- return trim(parent::__invoke($data, $context));
+ return trim((string)parent::__invoke($data, $context));
11
}
12
test/Integration/Mapper/Strategy/TrimTest.php
@@ -18,4 +18,14 @@ public function test(): void
18
19
self::assertSame('foo', $trim([]));
20
21
+
22
+ /**
23
+ * Tests that trimming null returns the empty string.
24
+ */
25
+ public function testNull(): void
26
+ {
27
+ $trim = (new Trim(null))->setMapper(new Mapper());
28
29
+ self::assertSame('', $trim([]));
30
+ }
31
0 commit comments