Skip to content

Commit f58acab

Browse files
committed
feature: use strict_types
1 parent cf828b3 commit f58acab

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
git config --global core.eol lf
6767
6868
- name: Checkout code
69-
uses: actions/checkout@v3
69+
uses: actions/checkout@v4
7070

7171
- name: Setup PHP
7272
uses: shivammathur/setup-php@v2
@@ -76,7 +76,7 @@ jobs:
7676
tools: composer:v2
7777

7878
- name: Install dependencies
79-
uses: nick-invision/retry@v2
79+
uses: nick-fields/retry@v2
8080
with:
8181
timeout_minutes: 5
8282
max_attempts: 5

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"require-dev": {
1111
"phpunit/phpunit": "^9.6",
12-
"friendsofphp/php-cs-fixer": "^3.41"
12+
"friendsofphp/php-cs-fixer": "^3.46"
1313
},
1414
"authors": [
1515
{

src/Php.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Syntax;
46

57
use Symfony\Component\Process\Process;
@@ -182,11 +184,11 @@ protected static function formatCode(string $source, int $line, string $cssCodeC
182184
{
183185
$array = self::formatXhtmlHighlight($source);
184186
$all = \count($array);
185-
$len = \strlen($all);
187+
$len = \strlen((string) $all);
186188
$page = '';
187189
for ($i = 0; $i < $all; ++$i) {
188190
$next = $i + 1;
189-
$l = \strlen($next);
191+
$l = \strlen((string) $next);
190192
$page .= '<span class="'.\htmlspecialchars($line === $next ? $cssCodeIncorrectLineClass : $cssCodeCorrectLineClass).'">'.($l < $len ? \str_repeat('&#160;', $len - $l) : '').$next.'</span> '.$array[$i]."\n";
191193
}
192194

tests/PhpTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Syntax\Tests;
46

57
use PHPUnit\Framework\TestCase;

0 commit comments

Comments
 (0)