diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d75021..4b70f0b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + php: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] steps: - uses: actions/checkout@v2 @@ -28,13 +28,7 @@ jobs: find src/ tests/ -name '*.php' -print0 | xargs -0 -n1 -P4 php -dxdebug.mode=off -l >/dev/null - name: Install dependencies - if: ${{ matrix.php <= '8.1' }} run: composer update - - name: Install dependencies PHP 8.2 - # @todo: Needed until prophecy (req by phpunit) allows PHP 8.2, https://github.com/phpspec/prophecy/issues/556 - if: ${{ matrix.php > '8.1' }} - run: composer update --ignore-platform-req=php+ - - name: Run test suite run: vendor/bin/phpunit diff --git a/src/ClassAliasMapGenerator.php b/src/ClassAliasMapGenerator.php index 8c09ee8..cec32f9 100644 --- a/src/ClassAliasMapGenerator.php +++ b/src/ClassAliasMapGenerator.php @@ -46,15 +46,12 @@ class ClassAliasMapGenerator * @param Composer $composer * @param IOInterface $io */ - public function __construct(Composer $composer, IOInterface $io = null, $config = null) + public function __construct(Composer $composer, IOInterface $io) { $this->composer = $composer; - $this->io = $io ?: new NullIO(); - if (\is_bool($config)) { - // Happens during upgrade from older versions, so try to be graceful - $config = new Config($this->composer->getPackage()); - } - $this->config = $config ?: new Config($this->composer->getPackage()); + $this->io = $io; + + $this->config = new Config($this->composer->getPackage(), $this->io); } /** diff --git a/src/Config.php b/src/Config.php index 8155459..eae777c 100644 --- a/src/Config.php +++ b/src/Config.php @@ -39,9 +39,9 @@ class Config * @param PackageInterface $package * @param IOInterface $io */ - public function __construct(PackageInterface $package, IOInterface $io = null) + public function __construct(PackageInterface $package, IOInterface $io) { - $this->io = $io ?: new NullIO(); + $this->io = $io; $this->setAliasLoaderConfigFromPackage($package); } @@ -55,7 +55,7 @@ public function get($configKey) throw new \InvalidArgumentException('Configuration key must not be empty', 1444039407); } // Extract parts of the path - $configKey = str_getcsv($configKey, '.'); + $configKey = str_getcsv($configKey, '.', '"', '\\'); // Loop through each part and extract its value $value = $this->config; foreach ($configKey as $segment) { diff --git a/src/IncludeFile.php b/src/IncludeFile.php index 308ad4b..5194d0e 100644 --- a/src/IncludeFile.php +++ b/src/IncludeFile.php @@ -46,14 +46,13 @@ class IncludeFile * @param IOInterface $io * @param Composer $composer * @param TokenInterface[] $tokens - * @param Filesystem $filesystem */ - public function __construct(IOInterface $io, Composer $composer, array $tokens, Filesystem $filesystem = null) + public function __construct(IOInterface $io, Composer $composer, array $tokens) { $this->io = $io; $this->composer = $composer; $this->tokens = $tokens; - $this->filesystem = $filesystem ?: new Filesystem(); + $this->filesystem = new Filesystem(); } public function register()