Skip to content

Commit c7219e6

Browse files
author
Stefan Boonstra
committed
WIP
1 parent 3e1206b commit c7219e6

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
If a PR is approved please ask one of the following maintainers to get it merged:
2-
[Igor Wulff](https://github.com/igorwulff)
3-
[Dan Wallis](https://github.com/fredden)
2+
3+
- [Igor Wulff](https://github.com/igorwulff)
4+
- [Leon Helmus](https://github.com/leonhelmus)
5+
- [Rutger Rademakers](https://github.com/rutgerrademaker)

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@
3131
"php-parallel-lint/php-parallel-lint": "^1.2",
3232
"phpro/grumphp-shim": "^1.13",
3333
"phpstan/phpstan": "@stable",
34-
"phpunit/phpunit": "@stable",
3534
"youwe/coding-standard": "^3.5.0",
36-
"youwe/coding-standard-phpstorm": "^2.3.0",
3735
"youwe/composer-dependency-installer": "^1.4.0",
3836
"youwe/composer-file-installer": "^1.2.0"
3937
},
38+
"suggest": {
39+
"phpunit/phpunit": "^9.6 || ^10.5 || ^11.5 || ^12.0",
40+
"youwe/coding-standard-phpstorm": "^2.3.0"
41+
},
4042
"require-dev": {
4143
"composer/composer": "@stable",
42-
"mikey179/vfsstream": "@stable"
44+
"mikey179/vfsstream": "@stable",
45+
"phpunit/phpunit": "@stable"
4346
},
4447
"replace": {
4548
"sensiolabs/security-checker": "*"

src/Installer/PackagesInstaller.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ class PackagesInstaller implements InstallerInterface
3434

3535
/** @var array */
3636
private $mapping = [
37-
MappingResolver::DEFAULT_MAPPING_TYPE => [],
37+
MappingResolver::DEFAULT_MAPPING_TYPE => [
38+
[
39+
'name' => 'phpunit/phpunit',
40+
'version' => '@stable',
41+
'dev' => true
42+
]
43+
],
3844
'magento1' => [
3945
[
4046
'name' => 'youwe/coding-standard-magento1',
@@ -99,11 +105,10 @@ public function __construct(
99105
public function install(): void
100106
{
101107
$type = $this->typeResolver->resolve();
102-
if (!isset($this->mapping[$type])) {
103-
return;
104-
}
108+
$projectTypePackages = $this->mapping[$type] ?? [];
109+
$packagesToInstall = array_merge($projectTypePackages, $this->mapping[MappingResolver::DEFAULT_MAPPING_TYPE]);
105110

106-
foreach ($this->mapping[$type] as $package) {
111+
foreach ($packagesToInstall as $package) {
107112
if (!$this->isPackageRequired($package['name'], $package['version'])) {
108113
$this->io->write(
109114
sprintf('Requiring package %s', $package['name'])

0 commit comments

Comments
 (0)