mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
refactor: Fix phpstan codeigniter.frameworkExceptionInstance (#9389)
This commit is contained in:
parent
c3ac0f9483
commit
a3704a1df4
@ -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('There.', 404)));
|
||||||
$this->assertSame([500, EXIT_ERROR], $determineCodes(new RuntimeException('This.', 167)));
|
$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 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.')));
|
$this->assertSame([500, EXIT_DATABASE], $determineCodes(new DatabaseException('This.')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ final class DebugTraceableTraitTest extends CIUnitTestCase
|
|||||||
{
|
{
|
||||||
public function testFactoryInstanceReturnsWhereItIsRaised(): void
|
public function testFactoryInstanceReturnsWhereItIsRaised(): void
|
||||||
{
|
{
|
||||||
$e1 = new FrameworkException('Hello.');
|
$e1 = new FrameworkException('Hello.'); // @phpstan-ignore codeigniter.frameworkExceptionInstance
|
||||||
$e2 = FrameworkException::forEnabledZlibOutputCompression();
|
$e2 = FrameworkException::forEnabledZlibOutputCompression();
|
||||||
|
|
||||||
$this->assertContainsEquals(DebugTraceableTrait::class, class_uses(FrameworkException::class));
|
$this->assertContainsEquals(DebugTraceableTrait::class, class_uses(FrameworkException::class));
|
||||||
|
@ -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
|
|
@ -2,7 +2,6 @@ includes:
|
|||||||
- argument.type.neon
|
- argument.type.neon
|
||||||
- assign.propertyType.neon
|
- assign.propertyType.neon
|
||||||
- codeigniter.cacheHandlerInstance.neon
|
- codeigniter.cacheHandlerInstance.neon
|
||||||
- codeigniter.frameworkExceptionInstance.neon
|
|
||||||
- codeigniter.getReassignArray.neon
|
- codeigniter.getReassignArray.neon
|
||||||
- codeigniter.modelArgumentInstanceof.neon
|
- codeigniter.modelArgumentInstanceof.neon
|
||||||
- codeigniter.modelArgumentType.neon
|
- codeigniter.modelArgumentType.neon
|
||||||
|
Loading…
x
Reference in New Issue
Block a user