Skip to content

Commit 028c0b4

Browse files
authored
Merge pull request #119 from phug-php/update/php-8-5
Test PHP 8.5
2 parents ebc1fb3 + c63e12d commit 028c0b4

14 files changed

Lines changed: 33 additions & 41 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ jobs:
3939
restore-keys: |
4040
${{ runner.os }}-${{ matrix.setup }}-coverage-${{ matrix.php }}-
4141
42-
- name: Code Climate Test Reporter Preparation
43-
run: |
44-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
45-
chmod +x ./cc-test-reporter
46-
./cc-test-reporter before-build
47-
env:
48-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
49-
5042
- name: Install dependencies
5143
if: steps.composer-cache.outputs.cache-hit != 'true'
5244
run: |
@@ -57,15 +49,15 @@ jobs:
5749
- name: Run test suite
5850
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml --default-time-limit=3
5951

60-
- name: Code Climate Test Reporter
61-
if: ${{ env.CC_TEST_REPORTER_ID != '' }}
62-
run: |
63-
cp coverage.xml clover.xml
64-
bash <(curl -s https://codecov.io/bash)
65-
./cc-test-reporter after-build --coverage-input-type clover --exit-code 0
66-
composer config version 1.9.0
67-
# composer require codacy/coverage
68-
# vendor/bin/codacycoverage clover coverage.xml
69-
env:
70-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
71-
# CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
52+
- name: Coverage - Qltysh
53+
uses: qltysh/qlty-action/coverage@v2
54+
if: matrix.coverage
55+
with:
56+
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
57+
files: clover.xml
58+
59+
- name: Coverage - Codecov
60+
if: matrix.coverage
61+
uses: codecov/codecov-action@v5
62+
with:
63+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/multi-tester.yml

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

1313
strategy:
1414
matrix:
15-
php: ['7.4', '8.2']
15+
php: ['8.2', '8.4']
1616
setup: ['stable']
1717

1818
name: PHP ${{ matrix.php }}
@@ -38,8 +38,7 @@ jobs:
3838
- name: Install dependencies
3939
if: steps.composer-cache.outputs.cache-hit != 'true'
4040
run: |
41-
composer config version 1.9.0
42-
composer require kylekatarnls/multi-tester:^2.5.2 --dev --no-update --no-interaction
41+
composer require kylekatarnls/multi-tester:^2.6.0 --dev --no-update --no-interaction
4342
composer update --prefer-dist --prefer-${{ matrix.setup }} --no-progress --no-interaction
4443
4544
- name: Run test suites

.github/workflows/tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
16+
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1717
setup: ['lowest', 'stable', 'next']
1818

1919
name: PHP ${{ matrix.php }} - ${{ matrix.setup }}
@@ -41,7 +41,6 @@ jobs:
4141
if: steps.composer-cache.outputs.cache-hit != 'true'
4242
run: |
4343
composer config version 1.9.0
44-
${{ matrix.php >= 7.2 && matrix.php < 8 && matrix.setup == 'lowest' && 'composer require --no-update "phpunit/phpunit:^5.7.27||^6.5.14||^7.5.20" --no-interaction;' || '' }}
4544
${{ matrix.php >= 8 && 'composer require --no-update phpunit/phpunit:^8.5.14 --no-interaction;' || '' }}
4645
composer update --prefer-dist ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }} --no-progress ${{ matrix.php >= 8.1 && '--ignore-platform-req=php' || '' }} --no-interaction
4746

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
"nodejs-php-fallback/less": "^1.0.5",
3434
"nodejs-php-fallback/stylus": "^1.0.4",
3535
"nodejs-php-fallback/uglify": "^1.0.4",
36-
"phpunit/phpunit": "^7.5.20 || ^8.5.41 || ^9.6.22",
36+
"phpunit/phpunit": "^7.5.20 || ^8.5.52 || ^9.6.34",
3737
"phpunit/php-code-coverage": "^6.1.4 || ^7.0.17 || ^9.2.32",
3838
"phpunit/php-invoker": "^1.1.4 || ^3.1.1",
3939
"pug-php/pug": "^3.4.1",
4040
"pug-php/pug-filter-coffee-script": "^1.3.1",
41-
"squizlabs/php_codesniffer": "^3.7.2"
41+
"squizlabs/php_codesniffer": "^3.13.5"
4242
},
4343
"replace": {
4444
"phug/ast": "self.version",

src/Phug/Util/CompatibilityUtil/TestCaseUntyped.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ protected function finishTest()
2121
// Override
2222
}
2323

24-
protected function setUp()
24+
protected function setUp(): void
2525
{
2626
$this->prepareTest();
2727
}
2828

29-
protected function tearDown()
29+
protected function tearDown(): void
3030
{
3131
$this->finishTest();
3232
}
3333

34-
public static function assertMatchesRegularExpression($pattern, $string, $message = '')
34+
public static function assertMatchesRegularExpression(string $pattern, string $string, string $message = ''): void
3535
{
3636
if (!method_exists(parent::class, 'assertMatchesRegularExpression')) {
3737
self::assertRegExp($pattern, $string, $message);
@@ -42,7 +42,7 @@ public static function assertMatchesRegularExpression($pattern, $string, $messag
4242
parent::assertMatchesRegularExpression($pattern, $string, $message);
4343
}
4444

45-
public static function assertFileDoesNotExist($filename, $message = '')
45+
public static function assertFileDoesNotExist(string $filename, string $message = ''): void
4646
{
4747
if (!method_exists(parent::class, 'assertFileDoesNotExist')) {
4848
self::assertFileNotExists($filename, $message);
@@ -53,7 +53,7 @@ public static function assertFileDoesNotExist($filename, $message = '')
5353
parent::assertFileDoesNotExist($filename, $message);
5454
}
5555

56-
public static function assertIsArray($actual, $message = '')
56+
public static function assertIsArray($actual, string $message = ''): void
5757
{
5858
if (!method_exists(parent::class, 'assertIsArray')) {
5959
self::assertSame('array', gettype($actual));

tests/Phug/AbstractLexerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function filterTokenClass($className)
4949
}
5050
}
5151

52-
protected function assertTokens($expression, array $classNames, Lexer $lexer = null, &$tokens = [])
52+
protected function assertTokens($expression, array $classNames, ?Lexer $lexer = null, &$tokens = [])
5353
{
5454
$lexer = $lexer ?: $this->lexer;
5555
$tokens = iterator_to_array($lexer->lex($expression));

tests/Phug/AbstractParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function prepareTest()
1717
$this->parser = new Parser();
1818
}
1919

20-
protected function assertNodes($expression, $expected, Parser $parser = null)
20+
protected function assertNodes($expression, $expected, ?Parser $parser = null)
2121
{
2222
if (is_array($expected)) {
2323
$expected = implode("\n", $expected);

tests/Phug/Compiler/NodeCompiler/BlockNodeCompilerTest/TestBlockNodeCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class TestBlockNodeCompiler extends BlockNodeCompiler
1111
{
12-
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
12+
public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
1313
{
1414
$blocks = &$this->getCompiler()->getBlocksByName('foo');
1515
$blocks[] = 'bar';

tests/Phug/FormatterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,8 +1354,6 @@ public function testDebugErrorOnRemovedFile()
13541354

13551355
try {
13561356
include $file;
1357-
} catch (\Exception $exception) {
1358-
$error = $exception;
13591357
} catch (\Throwable $exception) {
13601358
$error = $exception;
13611359
}
@@ -1364,6 +1362,8 @@ public function testDebugErrorOnRemovedFile()
13641362
unlink($file);
13651363
clearstatcache();
13661364

1365+
self::assertInstanceOf(\Throwable::class, $error);
1366+
13671367
/** @var LocatedException $error */
13681368
$error = $formatter->getDebugError($error, $php);
13691369

tests/Phug/RendererTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ public function testHandleErrorInString()
482482
$message = $error->getMessage();
483483
}
484484

485+
self::assertIsString($message);
485486
self::assertStringContains(
486487
'Division by zero',
487488
$message
@@ -579,6 +580,7 @@ public function testContextLines()
579580
$message = $error->getMessage();
580581
}
581582

583+
self::assertIsString($message);
582584
self::assertStringContains('Division by zero', $message);
583585
self::assertStringContains('div: p=12/0', $message);
584586
self::assertStringContains('// line -1', $message);

0 commit comments

Comments
 (0)