Skip to content

Commit 44d57f0

Browse files
committed
Mark all tests as final, update psalm config
Signed-off-by: Aleksei Khudiakov <[email protected]>
1 parent b45b005 commit 44d57f0

File tree

75 files changed

+463
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+463
-206
lines changed

psalm-baseline.xml

Lines changed: 380 additions & 109 deletions
Large diffs are not rendered by default.

psalm.xml.dist

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
</projectFiles>
1919

2020
<issueHandlers>
21+
<ClassMustBeFinal>
22+
<errorLevel type="suppress">
23+
<directory name="src" />
24+
</errorLevel>
25+
</ClassMustBeFinal>
26+
2127
<InternalClass>
2228
<errorLevel type="suppress">
2329
<referencedClass name="Mezzio\Swoole\Log\StrftimeToICUFormatMap"/>
@@ -28,26 +34,14 @@
2834
<errorLevel type="suppress">
2935
<referencedMethod name="Mezzio\Swoole\Log\StrftimeToICUFormatMap::mapStrftimeToICU"/>
3036
</errorLevel>
31-
32-
<errorLevel type="suppress">
33-
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::method"/>
34-
</errorLevel>
35-
36-
<errorLevel type="suppress">
37-
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturn"/>
38-
</errorLevel>
39-
40-
<errorLevel type="suppress">
41-
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::with"/>
42-
</errorLevel>
4337
</InternalMethod>
4438

4539
<MissingClosureParamType errorLevel="suppress"/>
40+
<MissingOverrideAttribute errorLevel="suppress"/>
4641
<MixedArgument errorLevel="suppress"/>
4742
<MixedArgumentTypeCoercion errorLevel="suppress"/>
4843
<MixedArrayAccess errorLevel="suppress"/>
4944
<MixedAssignment errorLevel="suppress"/>
50-
<MixedInferredReturnType errorLevel="suppress"/>
5145
<MixedMethodCall errorLevel="suppress"/>
5246
<MixedReturnStatement errorLevel="suppress"/>
5347
<PossiblyNullArgument errorLevel="suppress"/>

src/Log/AccessLogDataMap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ public function getResponseMessageSize($default = null): ?int
402402
*/
403403
public function getRequestTime(string $format): string
404404
{
405-
$begin = $this->getServerParam('request_time_float');
405+
$begin = (float) $this->getServerParam('request_time_float');
406406
$time = $begin;
407407

408408
if (str_starts_with($format, 'begin:')) {
@@ -434,7 +434,7 @@ public function getRequestTime(string $format): string
434434
*/
435435
public function getRequestDuration(string $format): string
436436
{
437-
$begin = $this->getServerParam('request_time_float');
437+
$begin = (float) $this->getServerParam('request_time_float');
438438
return match ($format) {
439439
'us' => (string) round(($this->endTime - $begin) * 1E6),
440440
'ms' => (string) round(($this->endTime - $begin) * 1E3),

test/Command/ReloadCommandFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use const SWOOLE_BASE;
1818
use const SWOOLE_PROCESS;
1919

20-
class ReloadCommandFactoryTest extends TestCase
20+
final class ReloadCommandFactoryTest extends TestCase
2121
{
2222
use AttributeAssertionTrait;
2323

test/Command/ReloadCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
use const SWOOLE_BASE;
2727
use const SWOOLE_PROCESS;
2828

29-
class ReloadCommandTest extends TestCase
29+
final class ReloadCommandTest extends TestCase
3030
{
3131
use AttributeAssertionTrait;
3232
use ReflectMethodTrait;

test/Command/StartCommandFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Psr\Container\ContainerInterface;
1616

17-
class StartCommandFactoryTest extends TestCase
17+
final class StartCommandFactoryTest extends TestCase
1818
{
1919
use AttributeAssertionTrait;
2020

test/Command/StartCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
use const PATH_SEPARATOR;
3434

35-
class StartCommandTest extends TestCase
35+
final class StartCommandTest extends TestCase
3636
{
3737
use AttributeAssertionTrait;
3838
use ReflectMethodTrait;

test/Command/StatusCommandFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Psr\Container\ContainerInterface;
1616

17-
class StatusCommandFactoryTest extends TestCase
17+
final class StatusCommandFactoryTest extends TestCase
1818
{
1919
use AttributeAssertionTrait;
2020

test/Command/StatusCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
use function getmypid;
2121

22-
class StatusCommandTest extends TestCase
22+
final class StatusCommandTest extends TestCase
2323
{
2424
use AttributeAssertionTrait;
2525
use ReflectMethodTrait;

test/Command/StopCommandFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Psr\Container\ContainerInterface;
1616

17-
class StopCommandFactoryTest extends TestCase
17+
final class StopCommandFactoryTest extends TestCase
1818
{
1919
use AttributeAssertionTrait;
2020

0 commit comments

Comments
 (0)