Skip to content
Draft
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
8 changes: 1 addition & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
11 changes: 4 additions & 7 deletions src/ClassAliasMapGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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) {
Expand Down
5 changes: 2 additions & 3 deletions src/IncludeFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading