Skip to content

Commit f237ee3

Browse files
committed
Apply phpcs
1 parent b6427f7 commit f237ee3

6 files changed

Lines changed: 16 additions & 17 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
php: [ '8.1', '8.2', '8.3', '8.4' ]
19+
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
2020
os: [ ubuntu-latest, macos-latest, windows-latest ]
2121
stability: [ prefer-lowest, prefer-stable ]
2222
steps:

composer.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"ext-pcre": "*",
2222
"ext-json": "*",
2323
"ext-mbstring": "*",
24-
"phplrt/source": "^3.7",
25-
"phplrt/position": "^3.7",
26-
"phplrt/exception-contracts": "^3.7"
24+
"phplrt/source": "^4.0",
25+
"phplrt/position": "^4.0",
26+
"phplrt/exception-contracts": "^4.0"
2727
},
2828
"autoload": {
2929
"psr-4": {
@@ -42,19 +42,16 @@
4242
}
4343
},
4444
"provide": {
45-
"phplrt/exception-contracts-implementation": "^3.7"
45+
"phplrt/exception-contracts-implementation": "^4.0"
4646
},
4747
"extra": {
4848
"branch-alias": {
49-
"dev-master": "3.x-dev",
50-
"dev-main": "3.x-dev"
49+
"dev-master": "4.x-dev",
50+
"dev-main": "4.x-dev"
5151
}
5252
},
5353
"config": {
54-
"sort-packages": true,
55-
"allow-plugins": {
56-
"phpstan/extension-installer": true
57-
}
54+
"sort-packages": true
5855
},
5956
"minimum-stability": "dev",
6057
"prefer-stable": true

src/ErrorInformationRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class ErrorInformationRenderer
2626
*/
2727
public const DEFAULT_HIGHLIGHT_CHAR = '^';
2828

29-
private readonly PositionInterface $position;
29+
private PositionInterface $position;
3030

31-
private readonly LineReader $reader;
31+
private LineReader $reader;
3232

3333
private string $sourceTemplate = self::DEFAULT_SOURCE_TEMPLATE;
3434

src/RuntimeException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ protected function sync(): void
5151
{
5252
$file = $this->getSource();
5353

54-
if ($file instanceof FileInterface && $this->token !== null) {
54+
if ($file instanceof FileInterface && $this->token) {
5555
$this->file = $file->getPathname();
5656
$this->line = $this->getPosition()->getLine();
5757
}
5858

59-
if ($this->source !== null && $this->token !== null) {
59+
if ($this->source && $this->token) {
6060
$this->message = $this->original . $this->getMessageSuffix($this->source, $this->token);
6161
}
6262
}

src/UndefinedToken.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Phplrt\Contracts\Lexer\TokenInterface;
88
use Phplrt\Contracts\Position\PositionInterface;
9+
use Phplrt\Lexer\Token\EndOfInput;
910

1011
/**
1112
* @internal This class can be used for internal representation of exceptions
@@ -18,7 +19,7 @@ public function __construct(
1819

1920
public function getName(): string
2021
{
21-
return TokenInterface::END_OF_INPUT;
22+
return EndOfInput::DEFAULT_TOKEN_NAME;
2223
}
2324

2425
public function getOffset(): int

tests/Unit/UndefinedTokenTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Phplrt\Contracts\Lexer\TokenInterface;
88
use Phplrt\Exception\UndefinedToken;
9+
use Phplrt\Lexer\Token\EndOfInput;
910
use Phplrt\Position\Position;
1011

1112
class UndefinedTokenTest extends TestCase
@@ -19,7 +20,7 @@ public function testName(): void
1920
{
2021
$token = $this->create();
2122

22-
$this->assertSame(TokenInterface::END_OF_INPUT, $token->getName());
23+
$this->assertSame(EndOfInput::DEFAULT_TOKEN_NAME, $token->getName());
2324
}
2425

2526
public function testOffset(): void

0 commit comments

Comments
 (0)