File tree Expand file tree Collapse file tree 2 files changed +1
-34
lines changed Expand file tree Collapse file tree 2 files changed +1
-34
lines changed Original file line number Diff line number Diff line change 19
19
"php" : " ^7.0" ,
20
20
"php-di/php-di" : " ^5.4" ,
21
21
"doctrine/cache" : " ^1.6" ,
22
- "mindplay/composer-locator" : " ^2.1.1 "
22
+ "mindplay/composer-locator" : " ^2.1.2 "
23
23
},
24
24
"require-dev" : {
25
25
"phpunit/phpunit" : " ^5.7"
Original file line number Diff line number Diff line change 2
2
3
3
namespace DI \Kernel \Test \Fixture ;
4
4
5
- use RuntimeException ;
6
-
7
5
class FakeComposerLocator extends \ComposerLocator
8
6
{
9
7
public static $ paths = [];
10
8
11
9
public static $ rootPath ;
12
10
13
- public static function getPath ($ name )
14
- {
15
- $ name = strtolower ($ name );
16
- if (!isset (self ::$ paths [$ name ])) {
17
- throw new RuntimeException ("Composer package not found: {$ name }" );
18
- }
19
-
20
- return self ::getRootPath ().self ::$ paths [$ name ];
21
- }
22
-
23
11
public static function getRootPath ()
24
12
{
25
13
return self ::$ rootPath ?: parent ::getRootPath ();
26
14
}
27
-
28
- public static function isInstalled ($ name )
29
- {
30
- return isset (self ::$ paths [$ name ]);
31
- }
32
-
33
- public static function getPackages ()
34
- {
35
- return array_keys (self ::$ paths );
36
- }
37
-
38
- public static function getPaths ()
39
- {
40
- $ paths = [];
41
-
42
- foreach (self ::$ paths as $ name => $ path ) {
43
- $ paths [$ name ] = self ::getRootPath ().$ path ;
44
- }
45
-
46
- return $ paths ;
47
- }
48
15
}
You can’t perform that action at this time.
0 commit comments