Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.5
coverage: none

- name: Download dependencies
Expand Down
28 changes: 14 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
"license": "proprietary",
"type": "project",
"require": {
"php": ">=8.0",
"php": ">=8.5",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"doctrine/rst-parser": "^0.4",
"nikic/php-parser": "^4.10",
"symfony-tools/docs-builder": "^0.15.0",
"symfony/console": "^5.2",
"symfony/dotenv": "^5.2",
"symfony/event-dispatcher": "^5.2",
"symfony/filesystem": "^5.2",
"symfony/finder": "^5.2",
"doctrine/rst-parser": "^0.5",
"nikic/php-parser": "^5.7",
"symfony-tools/docs-builder": "^0.27.6",
"symfony/console": "^8.0",
"symfony/dotenv": "^8.0",
"symfony/event-dispatcher": "^8.0",
"symfony/filesystem": "^8.0",
"symfony/finder": "^8.0",
"symfony/flex": "^1.3.1",
"symfony/framework-bundle": "^5.2",
"symfony/process": "^5.2",
"symfony/twig-bridge": "^5.4",
"symfony/yaml": "^5.2",
"symfony/framework-bundle": "^8.0",
"symfony/process": "^8.0",
"symfony/twig-bridge": "^8.0",
"symfony/yaml": "^8.0",
"twig/twig": "^3.3"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4.1",
"phpunit/phpunit": "^9.3.10"
"phpunit/phpunit": "^13.0"
},
"replace": {
"symfony/polyfill-ctype": "*",
Expand Down
23 changes: 5 additions & 18 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,13 @@
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
<exclude>tests/Service/CodeRunner/BaseCodeRunnerTest.php</exclude>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<source>
<include>
<directory suffix=".php">src</directory>
</whitelist>
</filter>

<!-- Run `composer require symfony/phpunit-bridge` before enabling this extension -->
<!--
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
-->

<!-- Run `composer require symfony/panther` before enabling this extension -->
<!--
<extensions>
<extension class="Symfony\Component\Panther\ServerExtension" />
</extensions>
-->
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion src/Service/CodeValidator/PhpValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function validate(CodeNode $node, IssueCollection $issues): void
private function getParser(): Parser
{
if (null === $this->parser) {
$this->parser = (new ParserFactory())->create(ParserFactory::ONLY_PHP7);
$this->parser = (new ParserFactory())->createForNewestSupportedVersion();
}

return $this->parser;
Expand Down
7 changes: 3 additions & 4 deletions tests/Service/Validator/PhpValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Doctrine\RST\Configuration;
use Doctrine\RST\Environment;
use Doctrine\RST\Nodes\CodeNode;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use SymfonyTools\CodeBlockChecker\Issue\IssueCollection;
use SymfonyTools\CodeBlockChecker\Service\CodeValidator\PhpValidator;
Expand Down Expand Up @@ -53,9 +54,7 @@ public function testLocalLine()
$this->assertEquals(5, $issues->first()->getLocalLine());
}

/**
* @dataProvider getCodeExamples
*/
#[DataProvider('getCodeExamples')]
public function testCodeExamples(int $errors, string $code, ?string $language = null)
{
$node = new CodeNode(explode(PHP_EOL, $code));
Expand All @@ -65,7 +64,7 @@ public function testCodeExamples(int $errors, string $code, ?string $language =
$this->assertCount($errors, $issues);
}

public function getCodeExamples(): iterable
public static function getCodeExamples(): iterable
{
yield [0, '
namespace Symfony\Component\HttpKernel;
Expand Down
Loading