From 457fd29c9b477aaee5e4381f4c13b4f59a20ce01 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Tue, 26 Jul 2022 18:15:25 +0200 Subject: [PATCH 1/2] allow compatibility with recent vendors --- .travis.yml | 3 +++ composer.json | 12 ++++++------ tests/CodeSampleCompilerTest.php | 8 ++++++++ tests/Extractor/MarkdownTest.php | 2 +- tests/Extractor/RstTest.php | 2 +- tests/Lint/PHPParserLinterTest.php | 2 +- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5ed27f0..74ccd1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,9 @@ sudo: false php: - 7.2 - 7.3 + - 7.4 + - 8.0 + - 8.1 matrix: fast_finish: true diff --git a/composer.json b/composer.json index 5f84391..89a56e6 100644 --- a/composer.json +++ b/composer.json @@ -5,18 +5,18 @@ "license": "MIT", "bin": ["bin/rusty"], "require": { - "php": "^7.2", + "php": "^7.2|^8.0", - "symfony/process": "^4.4|^5.0", - "symfony/console": "^4.4|^5.0", - "symfony/finder": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", "nikic/php-parser": "^3.0", - "league/commonmark": "^0.18,>=0.18.3", + "league/commonmark": "^0.19|^1.0", "gregwar/rst": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^7.0", + "phpunit/phpunit": "^7.0|^8.5|^9.5", "mikey179/vfsstream": "^1.6" }, "autoload": { diff --git a/tests/CodeSampleCompilerTest.php b/tests/CodeSampleCompilerTest.php index 05e142b..bb58639 100644 --- a/tests/CodeSampleCompilerTest.php +++ b/tests/CodeSampleCompilerTest.php @@ -19,6 +19,14 @@ public function testItTransformsAssertCalls() require_once "/dir/file.php"; \Rusty\Runtime\Asserter::assert('assert(42 === 42);', 42 === 42); CODE; + if (PHP_MAJOR_VERSION > 7) { + $expectedCode = <<expectException(\Rusty\Lint\Exception\SyntaxError::class); /** @var \SplFileInfo $splFileInfoMock */ $splFileInfoMock = $this->createMock(\SplFileInfo::class); $sample = new CodeSample($splFileInfoMock, 42, $code); From fb8d790f63f2454e027483a7702f4ece8e1c994a Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Sat, 13 Aug 2022 13:30:01 +0200 Subject: [PATCH 2/2] allow PHP-Parser 4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 89a56e6..a017ee2 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "symfony/console": "^4.4|^5.0|^6.0", "symfony/finder": "^4.4|^5.0|^6.0", - "nikic/php-parser": "^3.0", + "nikic/php-parser": "^3.0|*4.0", "league/commonmark": "^0.19|^1.0", "gregwar/rst": "^1.0" },