|
12 | 12 | use Magento\Framework\Config\Composer\Package;
|
13 | 13 | use Magento\Framework\Config\Composer\PackageFactory;
|
14 | 14 | use Magento\Framework\Filesystem;
|
| 15 | +use Magento\Framework\Filesystem\Directory\ReadInterfaceFactory; |
15 | 16 |
|
16 | 17 | /**
|
17 | 18 | * Sample Data dependency
|
@@ -39,32 +40,32 @@ class Dependency
|
39 | 40 | private $componentRegistrar;
|
40 | 41 |
|
41 | 42 | /**
|
42 |
| - * @var Filesystem\Directory\ReadInterfaceFactory |
| 43 | + * @var ReadInterfaceFactory |
43 | 44 | */
|
44 | 45 | private $directoryReadFactory;
|
45 | 46 |
|
46 | 47 | /**
|
| 48 | + * Initialize dependencies. |
| 49 | + * |
47 | 50 | * @param ComposerInformation $composerInformation
|
48 | 51 | * @param Filesystem $filesystem @deprecated 2.3.0 $directoryReadFactory is used instead
|
49 | 52 | * @param PackageFactory $packageFactory
|
50 | 53 | * @param ComponentRegistrarInterface $componentRegistrar
|
51 |
| - * @param Filesystem\Directory\ReadInterfaceFactory $directoryReadFactory |
52 |
| - * @throws \RuntimeException |
| 54 | + * @param Filesystem\Directory\ReadInterfaceFactory|null $directoryReadFactory |
53 | 55 | * @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
54 | 56 | */
|
55 | 57 | public function __construct(
|
56 | 58 | ComposerInformation $composerInformation,
|
57 |
| - Filesystem $filesystem, // $filesystem kept for BC |
| 59 | + Filesystem $filesystem, |
58 | 60 | PackageFactory $packageFactory,
|
59 | 61 | ComponentRegistrarInterface $componentRegistrar,
|
60 |
| - Filesystem\Directory\ReadInterfaceFactory $directoryReadFactory = null |
| 62 | + \Magento\Framework\Filesystem\Directory\ReadInterfaceFactory $directoryReadFactory = null |
61 | 63 | ) {
|
62 | 64 | $this->composerInformation = $composerInformation;
|
63 | 65 | $this->packageFactory = $packageFactory;
|
64 | 66 | $this->componentRegistrar = $componentRegistrar;
|
65 |
| - $this->directoryReadFactory = $directoryReadFactory ?: ObjectManager::getInstance()->get( |
66 |
| - Filesystem\Directory\ReadInterfaceFactory::class |
67 |
| - ); |
| 67 | + $this->directoryReadFactory = $directoryReadFactory ?: |
| 68 | + ObjectManager::getInstance()->get(ReadInterfaceFactory::class); |
68 | 69 | }
|
69 | 70 |
|
70 | 71 | /**
|
|
0 commit comments