diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d75021..ff2acc2 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: ['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/composer.json b/composer.json index a6187d0..6f7b045 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "psr-4": { "TYPO3\\ClassAliasLoader\\Test\\": "tests/"} }, "require": { - "php": ">=5.3.7", + "php": ">=7.1", "composer-plugin-api": "^1.0 || ^2.0" }, "require-dev": { diff --git a/src/ClassAliasMapGenerator.php b/src/ClassAliasMapGenerator.php index 8c09ee8..ad59130 100644 --- a/src/ClassAliasMapGenerator.php +++ b/src/ClassAliasMapGenerator.php @@ -46,7 +46,7 @@ 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 = null, $config = null) { $this->composer = $composer; $this->io = $io ?: new NullIO(); diff --git a/src/Config.php b/src/Config.php index 8155459..a26b40d 100644 --- a/src/Config.php +++ b/src/Config.php @@ -39,7 +39,7 @@ class Config * @param PackageInterface $package * @param IOInterface $io */ - public function __construct(PackageInterface $package, IOInterface $io = null) + public function __construct(PackageInterface $package, ?IOInterface $io = null) { $this->io = $io ?: new NullIO(); $this->setAliasLoaderConfigFromPackage($package); @@ -55,7 +55,8 @@ 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..0ec2af6 100644 --- a/src/IncludeFile.php +++ b/src/IncludeFile.php @@ -48,7 +48,7 @@ class IncludeFile * @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, ?Filesystem $filesystem = null) { $this->io = $io; $this->composer = $composer;