@@ -43,33 +43,29 @@ class Dependency
43
43
*/
44
44
private $ directoryReadFactory ;
45
45
46
- //@codingStandardsIgnoreStart
47
46
/**
48
47
* @param ComposerInformation $composerInformation
49
- * @param Filesystem $filesystem
48
+ * @param Filesystem $filesystem @deprecated 2.3.0 $directoryReadFactory is used instead
50
49
* @param PackageFactory $packageFactory
51
50
* @param ComponentRegistrarInterface $componentRegistrar
52
51
* @param Filesystem\Directory\ReadInterfaceFactory $directoryReadFactory
53
52
* @throws \RuntimeException
53
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
54
54
*/
55
55
public function __construct (
56
56
ComposerInformation $ composerInformation ,
57
- // $filesystem kept for BC
58
- Filesystem $ filesystem ,
57
+ Filesystem $ filesystem , // $filesystem kept for BC
59
58
PackageFactory $ packageFactory ,
60
59
ComponentRegistrarInterface $ componentRegistrar ,
61
- // $directoryReadFactory optional for BC
62
60
Filesystem \Directory \ReadInterfaceFactory $ directoryReadFactory = null
63
61
) {
64
62
$ this ->composerInformation = $ composerInformation ;
65
63
$ this ->packageFactory = $ packageFactory ;
66
64
$ this ->componentRegistrar = $ componentRegistrar ;
67
- if ($ directoryReadFactory === null ) {
68
- $ directoryReadFactory = ObjectManager::getInstance ()->get (Filesystem \Directory \ReadInterfaceFactory::class);
69
- }
70
- $ this ->directoryReadFactory = $ directoryReadFactory ;
65
+ $ this ->directoryReadFactory = $ directoryReadFactory ?: ObjectManager::getInstance ()->get (
66
+ Filesystem \Directory \ReadInterfaceFactory::class
67
+ );
71
68
}
72
- //@codingStandardsIgnoreEnd
73
69
74
70
/**
75
71
* Retrieve list of sample data packages from suggests
0 commit comments