File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,8 +97,8 @@ private function calculatePackageDepths(
9797 ++$ depth ;
9898
9999 $ dependencies = $ includingDev
100- ? array_keys ($ package ->getRequires ())
101- : [... array_keys ($ package ->getRequires ()), ... array_keys ( $ package -> getDevRequires ())] ;
100+ ? [... array_keys ($ package ->getRequires ()), ... array_keys ( $ package -> getDevRequires ())]
101+ : array_keys ($ package ->getRequires ());
102102
103103 foreach ($ dependencies as $ dependency ) {
104104 if (array_key_exists ($ dependency , $ allPackages )) {
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Yiisoft \Config \Tests \Integration ;
6+
7+ final class PackagesListBuilderWithDevTest extends ComposerTest
8+ {
9+ protected function getStartComposerConfig (): array
10+ {
11+ return [
12+ 'name ' => 'yiisoft/testpackage ' ,
13+ 'type ' => 'library ' ,
14+ 'minimum-stability ' => 'dev ' ,
15+ 'require ' => [
16+ 'yiisoft/config ' => '* ' ,
17+ 'test/d-dev-c ' => '* ' ,
18+ ],
19+ 'require-dev ' => [
20+ 'test/a ' => '* ' ,
21+ ],
22+ 'repositories ' => [
23+ [
24+ 'type ' => 'path ' ,
25+ 'url ' => '../../ ' ,
26+ ],
27+ [
28+ 'type ' => 'path ' ,
29+ 'url ' => '../Packages/test/a ' ,
30+ 'options ' => [
31+ 'symlink ' => false ,
32+ ],
33+ ],
34+ [
35+ 'type ' => 'path ' ,
36+ 'url ' => '../Packages/test/c ' ,
37+ 'options ' => [
38+ 'symlink ' => false ,
39+ ],
40+ ],
41+ [
42+ 'type ' => 'path ' ,
43+ 'url ' => '../Packages/test/d-dev-c ' ,
44+ 'options ' => [
45+ 'symlink ' => false ,
46+ ],
47+ ],
48+ ],
49+ ];
50+ }
51+
52+ public function testBase (): void
53+ {
54+ $ this ->assertMergePlan ([
55+ 'params ' => [
56+ 'test/a ' => [
57+ 'config/params.php ' ,
58+ ],
59+ ],
60+ 'web ' => [
61+ 'test/d-dev-c ' => [
62+ 'config/web.php ' ,
63+ ],
64+ 'test/a ' => [
65+ 'config/web.php ' ,
66+ ],
67+ ],
68+ ]);
69+ }
70+
71+ private function assertMergePlan (array $ mergePlan ): void
72+ {
73+ $ this ->assertSame ($ mergePlan , require $ this ->workingDirectory . '/config/packages/merge_plan.php ' );
74+ }
75+ }
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " test/d-dev-c" ,
3+ "version" : " 1.0.0" ,
4+ "autoload" : {
5+ "psr-4" : {
6+ "Test\\ Yii\\ View\\ " : " src"
7+ }
8+ },
9+ "require-dev" : {
10+ "test/c" : " *"
11+ },
12+ "extra" : {
13+ "config-plugin" : {
14+ "web" : " config/web.php"
15+ }
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /** @var array $params */
6+
7+ return [
8+ stdClass::class => stdClass::class,
9+ ];
You can’t perform that action at this time.
0 commit comments