Skip to content

Commit 86d9427

Browse files
committed
shorten functions
1 parent 0a78010 commit 86d9427

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/Unit/Complex/FullNameTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,11 @@
5959
});
6060

6161
test('full name is macroable', function () {
62-
FullName::macro('surname', function () {
63-
return $this->split[1];
64-
});
62+
FullName::macro('surname', fn () => $this->split[1]);
6563
$valueObject = new FullName('Anna Ewa Kowalska');
6664
$this->assertSame('Ewa', $valueObject->surname());
6765

68-
FullName::macro('inverse', function () {
69-
return $this->split = $this->split->reverse();
70-
});
66+
FullName::macro('inverse', fn () => $this->split = $this->split->reverse());
7167
$valueObject = new FullName('Nowak-Kowalska Ewa Anna');
7268
$valueObject->inverse();
7369
$this->assertSame('Anna', $valueObject->firstName());

0 commit comments

Comments
 (0)