Skip to content

Commit 5fe59cb

Browse files
update
1 parent 4738813 commit 5fe59cb

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

.phpunit.cache/test-results

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":1,"defects":{"Tests\\ExampleTest::testTwoNumbersAreSame":8,"Tests\\ExampleTest::testSetName":8},"times":{"Tests\\ExampleTest::testTwoNumbersAreSame":0.001}}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
3535
],
3636
"test:unit": "phpunit",
37-
"test:type": "phpstan analyse src",
37+
"test:type": "phpstan analyse --ansi",
3838
"test": ["@test:unit", "@test:type"]
3939
},
4040
"config": {

config/ErrorHandler.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313

1414
// Custom error handler
15-
function errorHandler($errNo, $errStr, $errFile, $errLine)
15+
function errorHandler(string $errNo, string $errStr, string $errFile, string $errLine): mixed
1616
{
1717
$errorTypes = [
1818
E_ERROR => 'Error',
@@ -41,7 +41,7 @@ function errorHandler($errNo, $errStr, $errFile, $errLine)
4141
}
4242

4343
// Custom exception handler
44-
function exceptionHandler(Throwable $exception)
44+
function exceptionHandler(Throwable $exception): void
4545
{
4646
$timestamp = date('Y-m-d H:i:s');
4747
$message = "[$timestamp] Uncaught Exception: " . $exception->getMessage() .
@@ -54,4 +54,3 @@ function exceptionHandler(Throwable $exception)
5454

5555
set_error_handler('errorHandler');
5656
set_exception_handler('exceptionHandler');
57-

phpstan.neon.dist

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
parameters:
2+
level: 6
3+
4+
reportUnmatchedIgnoredErrors: false
5+
treatPhpDocTypesAsCertain: false
6+
7+
paths:
8+
- 'app/'
9+

tests/ExampleTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,29 @@
55
namespace Tests;
66

77
use PHPUnit\Framework\TestCase;
8-
use App\App;
8+
//use App\App;
99

1010
final class ExampleTest extends TestCase
1111
{
1212
private $app;
1313

14+
/*
1415
public function setUp(): void
1516
{
1617
$this->app = new App("sushil");
1718
// $this->app->getName();
1819
}
20+
*/
1921

2022
public function testTwoNumbersAreSame(): void
2123
{
2224
$this->assertSame(1, 1);
2325
}
2426

27+
/*
2528
public function testSetName()
2629
{
2730
$this->assertSame('sushil', $this->app->getName());
2831
}
32+
*/
2933
}

0 commit comments

Comments
 (0)