Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Boonstra committed Feb 14, 2025
1 parent 3e1206b commit c7219e6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
If a PR is approved please ask one of the following maintainers to get it merged:
[Igor Wulff](https://github.com/igorwulff)
[Dan Wallis](https://github.com/fredden)

- [Igor Wulff](https://github.com/igorwulff)
- [Leon Helmus](https://github.com/leonhelmus)
- [Rutger Rademakers](https://github.com/rutgerrademaker)
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpro/grumphp-shim": "^1.13",
"phpstan/phpstan": "@stable",
"phpunit/phpunit": "@stable",
"youwe/coding-standard": "^3.5.0",
"youwe/coding-standard-phpstorm": "^2.3.0",
"youwe/composer-dependency-installer": "^1.4.0",
"youwe/composer-file-installer": "^1.2.0"
},
"suggest": {
"phpunit/phpunit": "^9.6 || ^10.5 || ^11.5 || ^12.0",
"youwe/coding-standard-phpstorm": "^2.3.0"
},
"require-dev": {
"composer/composer": "@stable",
"mikey179/vfsstream": "@stable"
"mikey179/vfsstream": "@stable",
"phpunit/phpunit": "@stable"
},
"replace": {
"sensiolabs/security-checker": "*"
Expand Down
15 changes: 10 additions & 5 deletions src/Installer/PackagesInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ class PackagesInstaller implements InstallerInterface

/** @var array */
private $mapping = [
MappingResolver::DEFAULT_MAPPING_TYPE => [],
MappingResolver::DEFAULT_MAPPING_TYPE => [
[
'name' => 'phpunit/phpunit',
'version' => '@stable',
'dev' => true
]
],
'magento1' => [
[
'name' => 'youwe/coding-standard-magento1',
Expand Down Expand Up @@ -99,11 +105,10 @@ public function __construct(
public function install(): void
{
$type = $this->typeResolver->resolve();
if (!isset($this->mapping[$type])) {
return;
}
$projectTypePackages = $this->mapping[$type] ?? [];
$packagesToInstall = array_merge($projectTypePackages, $this->mapping[MappingResolver::DEFAULT_MAPPING_TYPE]);

foreach ($this->mapping[$type] as $package) {
foreach ($packagesToInstall as $package) {
if (!$this->isPackageRequired($package['name'], $package['version'])) {
$this->io->write(
sprintf('Requiring package %s', $package['name'])
Expand Down

0 comments on commit c7219e6

Please sign in to comment.