Skip to content

Commit 10ac244

Browse files
committed
minor symfony#58283 [Contracts] closure to arrow functions (ibrahimBougaoua, OskarStark)
This PR was merged into the 7.2 branch. Discussion ---------- [Contracts] closure to arrow functions | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT Refactor some closure to arrow functions Commits ------- 70b5137 Fix CS 7396707 Refactor some closure to arrow functions
2 parents 2fe419e + 70b5137 commit 10ac244

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/Symfony/Contracts/Tests/Cache/CacheTraitTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ public function testSave()
4343
$cache->expects($this->once())
4444
->method('save');
4545

46-
$callback = function (CacheItemInterface $item) {
47-
return 'computed data';
48-
};
46+
$callback = fn (CacheItemInterface $item) => 'computed data';
4947

5048
$cache->get('key', $callback);
5149
}
@@ -101,9 +99,7 @@ public function testRecomputeOnBetaInf()
10199
$cache->expects($this->once())
102100
->method('save');
103101

104-
$callback = function (CacheItemInterface $item) {
105-
return 'computed data';
106-
};
102+
$callback = fn (CacheItemInterface $item) => 'computed data';
107103

108104
$cache->get('key', $callback, \INF);
109105
}
@@ -114,9 +110,7 @@ public function testExceptionOnNegativeBeta()
114110
->onlyMethods(['getItem', 'save'])
115111
->getMock();
116112

117-
$callback = function (CacheItemInterface $item) {
118-
return 'computed data';
119-
};
113+
$callback = fn (CacheItemInterface $item) => 'computed data';
120114

121115
$this->expectException(\InvalidArgumentException::class);
122116
$cache->get('key', $callback, -2);

0 commit comments

Comments
 (0)