refactor: Fix phpstan codeigniter.frameworkExceptionInstance (#9389)

This commit is contained in:
neznaika0 2025-01-13 07:49:37 +03:00 committed by GitHub
parent c3ac0f9483
commit a3704a1df4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 2 additions and 16 deletions

View File

@ -124,7 +124,7 @@ final class ExceptionsTest extends CIUnitTestCase
$this->assertSame([500, EXIT_ERROR], $determineCodes(new RuntimeException('There.', 404)));
$this->assertSame([500, EXIT_ERROR], $determineCodes(new RuntimeException('This.', 167)));
$this->assertSame([500, EXIT_CONFIG], $determineCodes(new ConfigException('This.')));
$this->assertSame([500, EXIT_CONFIG], $determineCodes(new CastException('This.')));
$this->assertSame([500, EXIT_CONFIG], $determineCodes(CastException::forInvalidInterface('This.')));
$this->assertSame([500, EXIT_DATABASE], $determineCodes(new DatabaseException('This.')));
}

View File

@ -28,7 +28,7 @@ final class DebugTraceableTraitTest extends CIUnitTestCase
{
public function testFactoryInstanceReturnsWhereItIsRaised(): void
{
$e1 = new FrameworkException('Hello.');
$e1 = new FrameworkException('Hello.'); // @phpstan-ignore codeigniter.frameworkExceptionInstance
$e2 = FrameworkException::forEnabledZlibOutputCompression();
$this->assertContainsEquals(DebugTraceableTrait::class, class_uses(FrameworkException::class));

View File

@ -1,13 +0,0 @@
# total 2 errors
parameters:
ignoreErrors:
-
message: '#^Instantiating CastException using new is not allowed\. Use one of its named constructors instead\.$#'
count: 1
path: ../../tests/system/Debug/ExceptionsTest.php
-
message: '#^Instantiating FrameworkException using new is not allowed\. Use one of its named constructors instead\.$#'
count: 1
path: ../../tests/system/DebugTraceableTraitTest.php

View File

@ -2,7 +2,6 @@ includes:
- argument.type.neon
- assign.propertyType.neon
- codeigniter.cacheHandlerInstance.neon
- codeigniter.frameworkExceptionInstance.neon
- codeigniter.getReassignArray.neon
- codeigniter.modelArgumentInstanceof.neon
- codeigniter.modelArgumentType.neon