From 1e23956ac312c677d27b5847eeecff92034e78d2 Mon Sep 17 00:00:00 2001 From: peterjaap Date: Fri, 9 May 2025 11:04:52 +0200 Subject: [PATCH] Add PHP 8.4 compatibility --- src/ConfigResolver.php | 13 +-- src/Factory/ProcessFactory.php | 4 +- src/Factory/ProcessFactoryInterface.php | 2 - src/Installer/ArchiveExcludeInstaller.php | 43 +++------- src/Installer/ConfigInstaller.php | 16 ++-- src/Installer/FilesInstaller.php | 81 ++++++------------- src/Installer/InstallerInterface.php | 2 - src/Installer/PackagesInstaller.php | 35 ++------ src/MappingResolver.php | 10 +-- src/Plugin.php | 26 +++--- src/ProjectTypeResolver.php | 9 +-- src/installers.php | 4 +- tests/ConfigResolverTest.php | 1 - tests/Factory/ProcessFactoryTest.php | 4 +- .../Installer/ArchiveExcludeInstallerTest.php | 24 +----- tests/Installer/ConfigInstallerTest.php | 4 - tests/Installer/FilesInstallerTest.php | 22 +---- tests/Installer/PackagesInstallerTest.php | 11 +-- tests/MappingResolverTest.php | 3 +- tests/PluginTest.php | 12 +-- tests/ProjectTypeResolverTest.php | 7 -- 21 files changed, 82 insertions(+), 251 deletions(-) diff --git a/src/ConfigResolver.php b/src/ConfigResolver.php index 7c2da85..92c8494 100644 --- a/src/ConfigResolver.php +++ b/src/ConfigResolver.php @@ -11,30 +11,21 @@ class ConfigResolver { - /** @var ProjectTypeResolver */ - private $typeResolver; - /** @var string */ private $template = __DIR__ . '/../templates/config/%s.json'; /** * Constructor. - * - * @param ProjectTypeResolver $typeResolver - * @param string $template */ public function __construct( - ProjectTypeResolver $typeResolver, - string $template = null + private readonly ProjectTypeResolver $typeResolver, + ?string $template = null ) { - $this->typeResolver = $typeResolver; $this->template = $template ?? $this->template; } /** * Resolve config. - * - * @return array */ public function resolve(): array { diff --git a/src/Factory/ProcessFactory.php b/src/Factory/ProcessFactory.php index 99b0429..be4521a 100644 --- a/src/Factory/ProcessFactory.php +++ b/src/Factory/ProcessFactory.php @@ -9,6 +9,7 @@ namespace Youwe\TestingSuite\Composer\Factory; +use Override; use Symfony\Component\Process\Process; class ProcessFactory implements ProcessFactoryInterface @@ -16,10 +17,9 @@ class ProcessFactory implements ProcessFactoryInterface /** * Create a new Process instance. * - * @param string $commandLine * - * @return Process */ + #[Override] public function create(string $commandLine): Process { // See https://github.com/composer/composer/blob/1.10.17/src/Composer/Util/ProcessExecutor.php#L68:L72 diff --git a/src/Factory/ProcessFactoryInterface.php b/src/Factory/ProcessFactoryInterface.php index bb11e6a..d1add38 100644 --- a/src/Factory/ProcessFactoryInterface.php +++ b/src/Factory/ProcessFactoryInterface.php @@ -16,9 +16,7 @@ interface ProcessFactoryInterface /** * Create a new Process instance. * - * @param string $commandLine * - * @return Process */ public function create(string $commandLine): Process; } diff --git a/src/Installer/ArchiveExcludeInstaller.php b/src/Installer/ArchiveExcludeInstaller.php index acfe782..ed20533 100644 --- a/src/Installer/ArchiveExcludeInstaller.php +++ b/src/Installer/ArchiveExcludeInstaller.php @@ -9,6 +9,7 @@ namespace Youwe\TestingSuite\Composer\Installer; +use Override; use Composer\Factory; use Composer\IO\IOInterface; use Composer\Json\JsonFile; @@ -21,17 +22,9 @@ */ class ArchiveExcludeInstaller implements InstallerInterface { - /** @var JsonFile */ - private $file; + private readonly JsonFile $file; - /** @var MappingResolver */ - private $resolver; - - /** @var IOInterface */ - private $io; - - /** @var string */ - private $destination; + private readonly string|bool $destination; /** @var array */ private $defaults = [ @@ -47,21 +40,16 @@ class ArchiveExcludeInstaller implements InstallerInterface /** * Constructor. * - * @param MappingResolver $resolver - * @param IOInterface $io * @param JsonFile|null $file - * @param string $destination * @param array|null $defaults */ public function __construct( - MappingResolver $resolver, - IOInterface $io, - JsonFile $file = null, - string $destination = null, - array $defaults = null + private readonly MappingResolver $resolver, + private readonly IOInterface $io, + ?JsonFile $file = null, + ?string $destination = null, + ?array $defaults = null ) { - $this->resolver = $resolver; - $this->io = $io; $this->file = $file ?? new JsonFile(Factory::getComposerFile()); $this->destination = $destination ?? getcwd(); $this->defaults = $defaults ?? $this->defaults; @@ -69,29 +57,24 @@ public function __construct( /** * Install. - * - * @return void */ + #[Override] public function install(): void { $definition = $this->file->read(); $excluded = $definition['archive']['exclude'] ?? []; $excluded = array_map( - function (string $exclude): string { - return substr($exclude, 0, 1) !== '/' - ? '/' . $exclude - : $exclude; - }, + fn(string $exclude): string => str_starts_with($exclude, '/') + ? $exclude + : '/' . $exclude, $excluded ); $files = array_merge( $this->defaults, array_map( - function (FileMappingInterface $mapping): string { - return '/' . $mapping->getRelativeDestination(); - }, + fn(FileMappingInterface $mapping): string => '/' . $mapping->getRelativeDestination(), iterator_to_array( $this->resolver->resolve() ) diff --git a/src/Installer/ConfigInstaller.php b/src/Installer/ConfigInstaller.php index 3b5dbdd..f9ba071 100644 --- a/src/Installer/ConfigInstaller.php +++ b/src/Installer/ConfigInstaller.php @@ -9,6 +9,7 @@ namespace Youwe\TestingSuite\Composer\Installer; +use Override; use Composer\Factory; use Composer\IO\IOInterface; use Composer\Json\JsonFile; @@ -20,31 +21,24 @@ */ class ConfigInstaller implements InstallerInterface { - /** @var JsonFile */ - private $file; - - /** @var ConfigResolver */ - private $resolver; + private readonly JsonFile $file; /** * Constructor. * - * @param ConfigResolver $resolver * @param JsonFile|null $file */ public function __construct( - ConfigResolver $resolver, - JsonFile $file = null + private readonly ConfigResolver $resolver, + ?JsonFile $file = null ) { - $this->resolver = $resolver; $this->file = $file ?? new JsonFile(Factory::getComposerFile()); } /** * Install. - * - * @return void */ + #[Override] public function install(): void { $definition = $this->file->read(); diff --git a/src/Installer/FilesInstaller.php b/src/Installer/FilesInstaller.php index 2f2da5d..7f7fbb3 100644 --- a/src/Installer/FilesInstaller.php +++ b/src/Installer/FilesInstaller.php @@ -9,6 +9,7 @@ namespace Youwe\TestingSuite\Composer\Installer; +use Override; use Composer\IO\IOInterface; use Youwe\Composer\FileInstaller as ComposerFileInstaller; use Youwe\FileMapping\FileMappingInterface; @@ -19,37 +20,17 @@ */ class FilesInstaller implements InstallerInterface { - /** @var MappingResolver */ - private $mappingResolver; - - /** @var ComposerFileInstaller */ - private $fileInstaller; - - /** @var IOInterface */ - private $io; - /** * Constructor. - * - * @param MappingResolver $mappingResolver - * @param ComposerFileInstaller $fileInstaller - * @param IOInterface $io */ - public function __construct( - MappingResolver $mappingResolver, - ComposerFileInstaller $fileInstaller, - IOInterface $io - ) { - $this->mappingResolver = $mappingResolver; - $this->fileInstaller = $fileInstaller; - $this->io = $io; + public function __construct(private readonly MappingResolver $mappingResolver, private readonly ComposerFileInstaller $fileInstaller, private readonly IOInterface $io) + { } /** * Install. - * - * @return void */ + #[Override] public function install(): void { foreach ($this->mappingResolver->resolve() as $mapping) { @@ -70,11 +51,9 @@ public function install(): void } /** - * @param FileMappingInterface $unixFileMapping * * @SuppressWarnings(PHPMD.CyclomaticComplexity) * - * @return void */ private function resolveYouwePathing(FileMappingInterface $unixFileMapping): void { @@ -119,39 +98,31 @@ private function resolveYouwePathing(FileMappingInterface $unixFileMapping): voi './vendor/youwe/coding-standard-magento1/src/Magento1' ); } - } else { - if ($name === "phpcs.xml") { - $this->updatePath( - $unixFileMapping->getDestination(), - ['./vendor/mediact/coding-standard/src/MediaCT'], - './vendor/youwe/coding-standard/src/Global' - ); - } elseif ($name === "phpmd.xml") { - $this->updatePath( - $unixFileMapping->getDestination(), - [ - './vendor/mediact/coding-standard/src/MediaCT/phpmd.xml', - './vendor/youwe/coding-standard-magento2/src/Magento2/phpmd.xml' - ], - './vendor/youwe/coding-standard/src/Global/phpmd.xml' - ); - } elseif ($name === "grumphp.yml") { - $this->updatePath( - $unixFileMapping->getDestination(), - ['vendor/mediact/testing-suite/config/default/grumphp.yml'], - 'vendor/youwe/testing-suite/config/default/grumphp.yml' - ); - } + } elseif ($name === "phpcs.xml") { + $this->updatePath( + $unixFileMapping->getDestination(), + ['./vendor/mediact/coding-standard/src/MediaCT'], + './vendor/youwe/coding-standard/src/Global' + ); + } elseif ($name === "phpmd.xml") { + $this->updatePath( + $unixFileMapping->getDestination(), + [ + './vendor/mediact/coding-standard/src/MediaCT/phpmd.xml', + './vendor/youwe/coding-standard-magento2/src/Magento2/phpmd.xml' + ], + './vendor/youwe/coding-standard/src/Global/phpmd.xml' + ); + } elseif ($name === "grumphp.yml") { + $this->updatePath( + $unixFileMapping->getDestination(), + ['vendor/mediact/testing-suite/config/default/grumphp.yml'], + 'vendor/youwe/testing-suite/config/default/grumphp.yml' + ); } } - /** - * @param string $destination - * @param array $oldPaths - * @param string $newPath - * - * @return void - */ + private function updatePath( string $destination, array $oldPaths, diff --git a/src/Installer/InstallerInterface.php b/src/Installer/InstallerInterface.php index 7dda08d..0928862 100644 --- a/src/Installer/InstallerInterface.php +++ b/src/Installer/InstallerInterface.php @@ -13,8 +13,6 @@ interface InstallerInterface { /** * Install. - * - * @return void */ public function install(): void; } diff --git a/src/Installer/PackagesInstaller.php b/src/Installer/PackagesInstaller.php index c3f9258..32d6b90 100644 --- a/src/Installer/PackagesInstaller.php +++ b/src/Installer/PackagesInstaller.php @@ -9,6 +9,7 @@ namespace Youwe\TestingSuite\Composer\Installer; +use Override; use Composer\Composer; use Composer\IO\IOInterface; use Youwe\Composer\DependencyInstaller\DependencyInstaller; @@ -20,18 +21,6 @@ */ class PackagesInstaller implements InstallerInterface { - /** @var DependencyInstaller */ - private $installer; - - /** @var Composer */ - private $composer; - - /** @var ProjectTypeResolver */ - private $typeResolver; - - /** @var IOInterface */ - private $io; - /** @var array */ private $mapping = [ MappingResolver::DEFAULT_MAPPING_TYPE => [], @@ -71,31 +60,23 @@ class PackagesInstaller implements InstallerInterface /** * Constructor. * - * @param Composer $composer - * @param ProjectTypeResolver $typeResolver - * @param IOInterface $io * @param DependencyInstaller|null $installer * @param array|null $mapping */ public function __construct( - Composer $composer, - ProjectTypeResolver $typeResolver, - IOInterface $io, - DependencyInstaller $installer = null, - array $mapping = null + private readonly Composer $composer, + private readonly ProjectTypeResolver $typeResolver, + private readonly IOInterface $io, + private readonly DependencyInstaller $installer = new DependencyInstaller(), + ?array $mapping = null ) { - $this->composer = $composer; - $this->typeResolver = $typeResolver; - $this->io = $io; - $this->installer = $installer ?? new DependencyInstaller(); $this->mapping = $mapping ?? $this->mapping; } /** * Install. - * - * @return void */ + #[Override] public function install(): void { $type = $this->typeResolver->resolve(); @@ -120,9 +101,7 @@ public function install(): void /** * Whether a package has been required. * - * @param string $packageName * - * @return bool */ private function isPackageRequired(string $packageName, string $version): bool { diff --git a/src/MappingResolver.php b/src/MappingResolver.php index 388b0ed..23ae5dd 100644 --- a/src/MappingResolver.php +++ b/src/MappingResolver.php @@ -14,25 +14,17 @@ class MappingResolver { - /** @var ProjectTypeResolver */ - private $typeResolver; - public const DEFAULT_MAPPING_TYPE = 'default'; /** * Constructor. - * - * @param ProjectTypeResolver $typeResolver */ - public function __construct(ProjectTypeResolver $typeResolver) + public function __construct(private readonly ProjectTypeResolver $typeResolver) { - $this->typeResolver = $typeResolver; } /** * Resolve mapping files. - * - * @return FileMappingReaderInterface */ public function resolve(): FileMappingReaderInterface { diff --git a/src/Plugin.php b/src/Plugin.php index 83d423d..9ec1f99 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -9,6 +9,7 @@ namespace Youwe\TestingSuite\Composer; +use Override; use Composer\Composer; use Composer\EventDispatcher\EventSubscriberInterface; use Composer\IO\IOInterface; @@ -21,7 +22,7 @@ class Plugin implements PluginInterface, EventSubscriberInterface { /** @var InstallerInterface[] */ - private $installers; + private array $installers; /** * Constructor. @@ -36,12 +37,10 @@ public function __construct(InstallerInterface ...$installers) /** * Apply plugin modifications to Composer. * - * @param Composer $composer - * @param IOInterface $io * - * @return void */ - public function activate(Composer $composer, IOInterface $io) + #[Override] + public function activate(Composer $composer, IOInterface $io): void { $this->addInstallers( ...include __DIR__ . '/installers.php' @@ -51,11 +50,10 @@ public function activate(Composer $composer, IOInterface $io) /** * Remove any hooks from Composer. * - * @param Composer $composer - * @param IOInterface $io * * @return void */ + #[Override] public function deactivate(Composer $composer, IOInterface $io) { } @@ -63,11 +61,10 @@ public function deactivate(Composer $composer, IOInterface $io) /** * Prepare the plugin to be uninstalled * - * @param Composer $composer - * @param IOInterface $io * * @return void */ + #[Override] public function uninstall(Composer $composer, IOInterface $io) { } @@ -76,20 +73,16 @@ public function uninstall(Composer $composer, IOInterface $io) * Add installers. * * @param InstallerInterface[] ...$installers - * - * @return void */ - public function addInstallers(InstallerInterface ...$installers) + public function addInstallers(InstallerInterface ...$installers): void { $this->installers = array_merge($this->installers, $installers); } /** * Run the installers. - * - * @return void */ - public function install() + public function install(): void { foreach ($this->installers as $installer) { $installer->install(); @@ -98,9 +91,8 @@ public function install() /** * Subscribe to post update and post install command. - * - * @return array */ + #[Override] public static function getSubscribedEvents(): array { return [ diff --git a/src/ProjectTypeResolver.php b/src/ProjectTypeResolver.php index 40ad900..c0c7931 100644 --- a/src/ProjectTypeResolver.php +++ b/src/ProjectTypeResolver.php @@ -29,9 +29,6 @@ class ProjectTypeResolver */ public const COMPOSER_CONFIG_TYPE_KEY = 'type'; - /** @var Composer */ - private $composer; - /** @var array */ private $mapping = [ 'magento2-module' => 'magento2', @@ -48,19 +45,15 @@ class ProjectTypeResolver /** * Constructor. * - * @param Composer $composer * @param array|null $mapping */ - public function __construct(Composer $composer, array $mapping = null) + public function __construct(private readonly Composer $composer, ?array $mapping = null) { - $this->composer = $composer; $this->mapping = $mapping ?? $this->mapping; } /** * Get the type. - * - * @return string */ public function resolve(): string { diff --git a/src/installers.php b/src/installers.php index d322159..17e3c72 100644 --- a/src/installers.php +++ b/src/installers.php @@ -7,6 +7,7 @@ declare(strict_types=1); +use Composer\IO\IOInterface; use Youwe\Composer\FileInstaller; use Youwe\FileMapping\UnixFileMappingReader; use Youwe\TestingSuite\Composer\ConfigResolver; @@ -20,9 +21,8 @@ /** * @var Composer\Composer $composer - * @var Composer\IO\IOInterface $io + * @var IOInterface $io */ - $typeResolver = new ProjectTypeResolver($composer); $mappingResolver = new MappingResolver($typeResolver); $configResolver = new ConfigResolver($typeResolver); diff --git a/tests/ConfigResolverTest.php b/tests/ConfigResolverTest.php index b43fb6a..862400b 100644 --- a/tests/ConfigResolverTest.php +++ b/tests/ConfigResolverTest.php @@ -21,7 +21,6 @@ class ConfigResolverTest extends TestCase { /** - * @return void * * @covers ::__construct * @covers ::resolve diff --git a/tests/Factory/ProcessFactoryTest.php b/tests/Factory/ProcessFactoryTest.php index fcf0464..e17e711 100644 --- a/tests/Factory/ProcessFactoryTest.php +++ b/tests/Factory/ProcessFactoryTest.php @@ -19,11 +19,9 @@ class ProcessFactoryTest extends TestCase { /** - * @return void - * * @covers ::create */ - public function testCreate() + public function testCreate(): void { $factory = new ProcessFactory(); diff --git a/tests/Installer/ArchiveExcludeInstallerTest.php b/tests/Installer/ArchiveExcludeInstallerTest.php index 241fec1..3d3da17 100644 --- a/tests/Installer/ArchiveExcludeInstallerTest.php +++ b/tests/Installer/ArchiveExcludeInstallerTest.php @@ -27,13 +27,6 @@ class ArchiveExcludeInstallerTest extends TestCase { /** - * @param array $existingFiles - * @param array $files - * @param array $defaults - * @param array $definition - * @param array $expected - * - * @return void * * @dataProvider dataProvider * @@ -46,7 +39,7 @@ public function testInstall( array $defaults, array $definition, array $expected - ) { + ): void { $file = $this->createMock(JsonFile::class); $resolver = $this->createMock(MappingResolver::class); $io = $this->createMock(IOInterface::class); @@ -79,9 +72,6 @@ public function testInstall( $installer->install(); } - /** - * @return array - */ public function dataProvider(): array { return [ @@ -121,11 +111,7 @@ public function dataProvider(): array ]; } - /** - * @param array $files - * - * @return FileMappingReaderInterface - */ + private function createReaderMock(array $files): FileMappingReaderInterface { /** @var FileMappingReaderInterface|MockObject $mock */ @@ -166,11 +152,7 @@ function (string $file): FileMappingInterface { return $mock; } - /** - * @param array $files - * - * @return vfsStreamDirectory - */ + private function createFilesystem(array $files): vfsStreamDirectory { return vfsStream::setup( diff --git a/tests/Installer/ConfigInstallerTest.php b/tests/Installer/ConfigInstallerTest.php index 70b3937..de14331 100644 --- a/tests/Installer/ConfigInstallerTest.php +++ b/tests/Installer/ConfigInstallerTest.php @@ -22,7 +22,6 @@ class ConfigInstallerTest extends TestCase { /** - * @return void * * @covers ::__construct * @covers ::install @@ -60,9 +59,6 @@ public function testInstall(): void $installer->install(); } - /** - * @return array - */ public function dataProvider(): array { return [ diff --git a/tests/Installer/FilesInstallerTest.php b/tests/Installer/FilesInstallerTest.php index 545c7d0..46b7a46 100644 --- a/tests/Installer/FilesInstallerTest.php +++ b/tests/Installer/FilesInstallerTest.php @@ -27,11 +27,7 @@ class FilesInstallerTest extends TestCase { /** - * @param array $existingFiles - * @param array $files - * @param int $expectedInstalls * - * @return void * @dataProvider dataProvider * * @covers ::__construct @@ -41,7 +37,7 @@ public function testInstall( array $existingFiles, array $files, int $expectedInstalls - ) { + ): void { $filesystem = $this->createFilesystem($existingFiles); $reader = $this->createReaderMock($files, $filesystem->url()); $resolver = $this->createMock(MappingResolver::class); @@ -61,9 +57,6 @@ public function testInstall( $installer->install(); } - /** - * @return array - */ public function dataProvider(): array { return [ @@ -81,12 +74,7 @@ public function dataProvider(): array ]; } - /** - * @param array $files - * @param string $destination - * - * @return FileMappingReaderInterface - */ + private function createReaderMock(array $files, string $destination): FileMappingReaderInterface { /** @var FileMappingReaderInterface|MockObject $mock */ @@ -127,11 +115,7 @@ function (string $file) use ($destination): FileMappingInterface { return $mock; } - /** - * @param array $files - * - * @return vfsStreamDirectory - */ + private function createFilesystem(array $files): vfsStreamDirectory { return vfsStream::setup( diff --git a/tests/Installer/PackagesInstallerTest.php b/tests/Installer/PackagesInstallerTest.php index 9e8210f..3e594ff 100644 --- a/tests/Installer/PackagesInstallerTest.php +++ b/tests/Installer/PackagesInstallerTest.php @@ -25,11 +25,7 @@ class PackagesInstallerTest extends TestCase { /** - * @param string $type - * @param array $requires - * @param array|null $expected * - * @return void * @dataProvider dataProvider * * @covers ::__construct @@ -39,8 +35,8 @@ class PackagesInstallerTest extends TestCase public function testInstall( string $type, array $requires, - array $expected = null - ) { + ?array $expected = null + ): void { $composer = $this->createMock(Composer::class); $typeResolver = $this->createMock(ProjectTypeResolver::class); $depInstaller = $this->createMock(DependencyInstaller::class); @@ -72,9 +68,6 @@ public function testInstall( $installer->install(); } - /** - * @return array - */ public function dataProvider(): array { return [ diff --git a/tests/MappingResolverTest.php b/tests/MappingResolverTest.php index 10014d1..2374711 100644 --- a/tests/MappingResolverTest.php +++ b/tests/MappingResolverTest.php @@ -20,12 +20,11 @@ class MappingResolverTest extends TestCase { /** - * @return void * * @covers ::__construct * @covers ::resolve */ - public function testResolve() + public function testResolve(): void { $typeResolver = $this->createMock(ProjectTypeResolver::class); $typeResolver diff --git a/tests/PluginTest.php b/tests/PluginTest.php index 826b004..058060e 100644 --- a/tests/PluginTest.php +++ b/tests/PluginTest.php @@ -23,12 +23,11 @@ class PluginTest extends TestCase { /** - * @return void * * @covers ::activate * @covers ::addInstallers */ - public function testActivate() + public function testActivate(): void { $plugin = new Plugin(); $plugin->activate( @@ -46,12 +45,11 @@ public function testActivate() } /** - * @return void * * @covers ::__construct * @covers ::install */ - public function testInstall() + public function testInstall(): void { $installers = [ $this->createMock(InstallerInterface::class), @@ -69,15 +67,13 @@ public function testInstall() } /** - * @return void - * * @covers ::getSubscribedEvents */ - public function testGetSubscribesEvents() + public function testGetSubscribesEvents(): void { $plugin = new Plugin(); - foreach (Plugin::getSubscribedEvents() as $event => $methods) { + foreach (Plugin::getSubscribedEvents() as $methods) { foreach ($methods as $method) { $this->assertTrue(method_exists($plugin, $method)); } diff --git a/tests/ProjectTypeResolverTest.php b/tests/ProjectTypeResolverTest.php index 01b2459..d63c7ef 100644 --- a/tests/ProjectTypeResolverTest.php +++ b/tests/ProjectTypeResolverTest.php @@ -21,10 +21,7 @@ class ProjectTypeResolverTest extends TestCase { /** - * @param string $packageType - * @param string $expected * - * @return void * * @dataProvider dataProvider * @@ -57,7 +54,6 @@ public function testToString(string $packageType, string $expected): void } /** - * @return void * * @covers ::__construct * @covers ::resolve @@ -92,9 +88,6 @@ public function testToStringOverwrite(): void $this->assertEquals('magento2', $decider->resolve()); } - /** - * @return array - */ public function dataProvider(): array { return [