Skip to content

Commit 423f751

Browse files
committed
Apply PHP 7.4 syntax and typed property
Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
1 parent f8e12c6 commit 423f751

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

psalm-baseline.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
<code>$e-&gt;getCode()</code>
165165
</InvalidScalarArgument>
166166
<MissingClosureReturnType occurrences="1">
167-
<code>function ($count, $param) {</code>
167+
<code>static function ($count, $param) {</code>
168168
</MissingClosureReturnType>
169169
<MixedArgument occurrences="7">
170170
<code>$argv</code>

src/Cache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static function saveSmd($filename, Server $server)
4141
return false;
4242
}
4343

44-
set_error_handler(function ($errno, $errstr) {
44+
set_error_handler(static function ($errno, $errstr): void {
4545
// swallow errors; method returns false on failure
4646
}, E_WARNING);
4747

@@ -75,7 +75,7 @@ public static function getSmd($filename)
7575
return false;
7676
}
7777

78-
set_error_handler(function ($errno, $errstr) {
78+
set_error_handler(static function ($errno, $errstr): void {
7979
// swallow errors; method returns false on failure
8080
}, E_WARNING);
8181

src/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ private function validateAndPrepareNamedParams(
675675
*/
676676
private function validateAndPrepareOrderedParams(array $requestedParams, array $serviceParams)
677677
{
678-
$requiredParamsCount = array_reduce($serviceParams, function ($count, $param) {
678+
$requiredParamsCount = array_reduce($serviceParams, static function ($count, $param) {
679679
$count += $param['optional'] ? 0 : 1;
680680
return $count;
681681
}, 0);

test/ResponseTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
class ResponseTest extends TestCase
1414
{
15-
/** @var Response */
16-
private $response;
15+
private Response $response;
1716
/**
1817
* Sets up the fixture, for example, open a network connection.
1918
* This method is called before a test is executed.

0 commit comments

Comments
 (0)