Skip to content

Commit 3e7a6cd

Browse files
committed
Use static functions
1 parent 7f40039 commit 3e7a6cd

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

.php-cs-fixer.dist.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
'array_syntax' => [
2525
'syntax' => 'short',
2626
],
27-
'braces' => [
28-
'allow_single_line_closure' => true,
29-
],
30-
'compact_nullable_typehint' => true,
3127
'doctrine_annotation_array_assignment' => [
3228
'operator' => '=',
3329
],

src/EventListener/RequestResponseListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ protected function getRedirectResponse(Request $request, string $view): ?Redirec
272272
*/
273273
protected function prepareResponseModification(string $view): void
274274
{
275-
$this->modifyResponseClosure = function (DeviceView $deviceView, ResponseEvent $event) use ($view) {
275+
$this->modifyResponseClosure = static function (DeviceView $deviceView, ResponseEvent $event) use ($view) {
276276
return $deviceView->modifyResponse($view, $event->getResponse());
277277
};
278278
}

tests/DataCollector/DeviceDataCollectorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ public function testCollectCurrentViewMobileCanUseTablet(): void
114114
$this->request->expects(self::any())->method('getBaseUrl')->willReturn('/base-url');
115115
$this->request->expects(self::any())->method('getPathInfo')->willReturn('/path-info');
116116
$test = $this;
117-
$this->request->expects(self::any())->method('getQueryString')->willReturnCallback(function () use ($test) {
117+
$this->request->expects(self::any())->method('getQueryString')->willReturnCallback(static function () use ($test) {
118118
$qs = Request::normalizeQueryString($test->request->server->get('QUERY_STRING'));
119119

120120
return '' === $qs ? null : $qs;
121121
});
122-
$this->request->expects(self::any())->method('getUri')->willReturnCallback(function () use ($test) {
122+
$this->request->expects(self::any())->method('getUri')->willReturnCallback(static function () use ($test) {
123123
if (null !== $qs = $test->request->getQueryString()) {
124124
$qs = '?'.$qs;
125125
}
@@ -177,12 +177,12 @@ public function testCollectCurrentViewFullCanUseMobile(): void
177177
$this->request->expects(self::any())->method('getBaseUrl')->willReturn('/base-url');
178178
$this->request->expects(self::any())->method('getPathInfo')->willReturn('/path-info');
179179
$test = $this;
180-
$this->request->expects(self::any())->method('getQueryString')->willReturnCallback(function () use ($test) {
180+
$this->request->expects(self::any())->method('getQueryString')->willReturnCallback(static function () use ($test) {
181181
$qs = Request::normalizeQueryString($test->request->server->get('QUERY_STRING'));
182182

183183
return '' === $qs ? null : $qs;
184184
});
185-
$this->request->expects(self::any())->method('getUri')->willReturnCallback(function () use ($test) {
185+
$this->request->expects(self::any())->method('getUri')->willReturnCallback(static function () use ($test) {
186186
if (null !== $qs = $test->request->getQueryString()) {
187187
$qs = '?'.$qs;
188188
}
@@ -240,12 +240,12 @@ public function testCollectCurrentViewFullCantUseMobile(): void
240240
$this->request->expects(self::any())->method('getBaseUrl')->willReturn('/base-url');
241241
$this->request->expects(self::any())->method('getPathInfo')->willReturn('/path-info');
242242
$test = $this;
243-
$this->request->expects(self::any())->method('getQueryString')->willReturnCallback(function () use ($test) {
243+
$this->request->expects(self::any())->method('getQueryString')->willReturnCallback(static function () use ($test) {
244244
$qs = Request::normalizeQueryString($test->request->server->get('QUERY_STRING'));
245245

246246
return '' === $qs ? null : $qs;
247247
});
248-
$this->request->expects(self::any())->method('getUri')->willReturnCallback(function () use ($test) {
248+
$this->request->expects(self::any())->method('getUri')->willReturnCallback(static function () use ($test) {
249249
if (null !== $qs = $test->request->getQueryString()) {
250250
$qs = '?'.$qs;
251251
}

0 commit comments

Comments
 (0)