Skip to content

Commit

Permalink
Added support for PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiang committed Jan 24, 2024
1 parent 54845f8 commit 26bb38b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ jobs:
matrix:
php:
- version: 8.0
coverage: true
coverage: false
- version: 8.1
coverage: false
- version: 8.2
coverage: true
- version: 8.3
coverage: false
prefer-lowest: ["", "--prefer-lowest"]

Expand Down Expand Up @@ -57,11 +59,11 @@ jobs:

- name: Run test suite
if: ${{ ! matrix.php.coverage }}
run: ./vendor/bin/phpunit --verbose
run: ./vendor/bin/phpunit

- name: Run test suite with code coverage
if: ${{ matrix.php.coverage }}
run: ./vendor/bin/phpunit --verbose --coverage-clover=build/logs/clover.xml
run: ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml
env:
XDEBUG_MODE: coverage

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"minimum-stability": "stable",
"require": {
"php": "^8.0",
"symfony/console": "^6.0",
"symfony/event-dispatcher": "^6.0",
"symfony/console": "^6.0 || ^7.0",
"symfony/event-dispatcher": "^6.0 || ^7.0",
"laminas/laminas-escaper": "^2.12",
"laminas/laminas-filter": "^2.31",
"laminas/laminas-servicemanager": "^3.0 || ^2.2",
Expand All @@ -30,7 +30,7 @@
"require-dev": {
"behat/behat": "^3.12",
"mikey179/vfsstream": "^1.6.11",
"phpunit/phpunit": "^9.6.3",
"phpunit/phpunit": "^9.6.3 || ^10.0",
"vimeo/psalm": "^5.6",
"laminas/laminas-coding-standard": "^2.5",
"phpspec/prophecy": "^1.17",
Expand Down
8 changes: 4 additions & 4 deletions tests/src/Cli/Command/ExceptionGeneratorCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function executeNoParents(): void
$input->getOption('no-parents')->willReturn(true);
$input->getOption('template-path')->willReturn(vfsStream::url('cwd/template_path'));

$input->bind(Argument::type(InputDefinition::class))->willReturn(null);
$input->validate()->willReturn(null);
$input->bind(Argument::type(InputDefinition::class))->shouldBeCalled();
$input->validate()->shouldBeCalled();

$output->writeln(
'Using path for templates: "vfs://cwd/template_path"',
Expand Down Expand Up @@ -148,8 +148,8 @@ public function executeParents(): void
$input->getOption('no-parents')->willReturn(false);
$input->getOption('template-path')->willReturn(vfsStream::url('cwd/template_path'));

$input->bind(Argument::type(InputDefinition::class))->willReturn(null);
$input->validate()->willReturn(null);
$input->bind(Argument::type(InputDefinition::class))->shouldBeCalled();
$input->validate()->shouldBeCalled();

$output->writeln(
'Using path for templates: "vfs://cwd/template_path"',
Expand Down
17 changes: 8 additions & 9 deletions tests/src/Generator/RecursiveNamespaceResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,14 @@ public static function provideTestDirectories(): array
public function testRegisterDefaultListeners(): void
{
$eventDispatcher = $this->prophesize(EventDispatcher::class);
$eventDispatcher->addSubscriber(Argument::type(EventSubscriberInterface::class))
->shouldBeCalledTimes(4)
->will(fn (array $args) => match (get_class($args[0])) {
PHPFileListener::class => true,
ComposerJsonListener::class => true,
GitDirectoryListener::class => true,
RootDirectoryListener::class => true,
default => $this->fail('Unknown listener')
});
$eventDispatcher->addSubscriber(Argument::that(fn (EventSubscriberInterface $es) => match (get_class($es)) {
PHPFileListener::class => true,
ComposerJsonListener::class => true,
GitDirectoryListener::class => true,
RootDirectoryListener::class => true,
default => $this->fail('Unknown listener')
}))
->shouldBeCalledTimes(4);

$object = new RecursiveNamespaceResolver($eventDispatcher->reveal());
$this->assertInstanceOf(EventDispatcher::class, $object->getEventDispatcher());
Expand Down
15 changes: 7 additions & 8 deletions tests/src/Generator/RecursiveParentExceptionResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,13 @@ public function resolveExceptionDirsRoot(): void
public function addDefaultSubscribers(): void
{
$eventDispatcher = $this->prophesize(EventDispatcherInterface::class);
$eventDispatcher->addSubscriber(Argument::type(EventSubscriberInterface::class))
->shouldBeCalledTimes(3)
->will(fn (array $args) => match (get_class($args[0])) {
GitDirectoryListener::class => true,
RootDirectoryListener::class => true,
ExceptionDirListener::class => true,
default => $this->fail('Unknown listener')
});
$eventDispatcher->addSubscriber(Argument::that(fn (EventSubscriberInterface $es) => match (get_class($es)) {
GitDirectoryListener::class => true,
RootDirectoryListener::class => true,
ExceptionDirListener::class => true,
default => $this->fail('Unknown listener')
}))
->shouldBeCalledTimes(3);

$object = new RecursiveParentExceptionResolver($eventDispatcher->reveal());
$this->assertInstanceOf(EventDispatcherInterface::class, $object->getEventDispatcher());
Expand Down

0 comments on commit 26bb38b

Please sign in to comment.