Skip to content

Commit

Permalink
Merge pull request #20 from telebugs/strict-types
Browse files Browse the repository at this point in the history
Add declare(strict_types=1);
  • Loading branch information
kyrylo authored Jul 30, 2024
2 parents 36e023e + 1bcf66f commit a41017d
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/Backtrace.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

class Backtrace
Expand Down
2 changes: 2 additions & 0 deletions src/BaseMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

abstract class BaseMiddleware
Expand Down
2 changes: 2 additions & 0 deletions src/CodeHunk.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

use Telebugs\MiddlewareStack;
Expand Down
2 changes: 2 additions & 0 deletions src/FileCache.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

class FileCache
Expand Down
2 changes: 2 additions & 0 deletions src/MiddlewareStack.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

use Telebugs\BaseMiddleware;
Expand Down
2 changes: 2 additions & 0 deletions src/Report.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

use Telebugs\Reporter;
Expand Down
2 changes: 2 additions & 0 deletions src/Reporter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

use GuzzleHttp\Promise\FulfilledPromise;
Expand Down
2 changes: 2 additions & 0 deletions src/Sender.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

use Telebugs\Config;
Expand Down
2 changes: 2 additions & 0 deletions src/Truncator.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

use JsonSerializable;
Expand Down
2 changes: 2 additions & 0 deletions src/WrappedError.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs;

class WrappedError
Expand Down
2 changes: 2 additions & 0 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs\Tests;

use PHPUnit\Framework\TestCase;
Expand Down
10 changes: 6 additions & 4 deletions tests/ReportTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs\Tests;

use PHPUnit\Framework\TestCase;
Expand All @@ -26,12 +28,12 @@ public function testDataWithNestedErrors(): void
$this->assertEquals("InvalidArgumentException", $error1['type']);
$this->assertEquals("error 2", $error1['message']);
$this->assertMatchesRegularExpression('/ReportTest.php$/', $error1['backtrace'][0]['file']);
$this->assertEquals(17, $error1['backtrace'][0]['line']);
$this->assertEquals(19, $error1['backtrace'][0]['line']);
$this->assertEquals('', $error1['backtrace'][0]['function']);
$this->assertEquals('testDataWithNestedErrors', $error1['backtrace'][1]['function']);
$this->assertMatchesRegularExpression('/ReportTest.php$/', $error1['backtrace'][0]['file']);
$this->assertEquals([
'start_line' => 15,
'start_line' => 17,
'lines' => [
' } catch (\Exception $e1) {',
' try {',
Expand All @@ -44,12 +46,12 @@ public function testDataWithNestedErrors(): void
$this->assertEquals("Exception", $error2['type']);
$this->assertEquals("error 1", $error2['message']);
$this->assertMatchesRegularExpression('/ReportTest.php$/', $error2['backtrace'][0]['file']);
$this->assertEquals(14, $error2['backtrace'][0]['line']);
$this->assertEquals(16, $error2['backtrace'][0]['line']);
$this->assertEquals('', $error2['backtrace'][0]['function']);
$this->assertEquals('testDataWithNestedErrors', $error2['backtrace'][1]['function']);
$this->assertMatchesRegularExpression('/ReportTest.php$/', $error2['backtrace'][0]['file']);
$this->assertEquals([
'start_line' => 12,
'start_line' => 14,
'lines' => [
' {',
' try {',
Expand Down
2 changes: 2 additions & 0 deletions tests/ReporterTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs\Tests;

use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/TruncatorTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Telebugs\Tests;

use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/WrappedErrorTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use PHPUnit\Framework\TestCase;

use Telebugs\WrappedError;
Expand Down

0 comments on commit a41017d

Please sign in to comment.