Skip to content

Commit de5a0d3

Browse files
navarrslavvka
authored andcommitted
Add ReadFactory and WriteFactory to Magento's public API
These classes are necessary/useful for creating instances of ReadInterface and WriteInterface using the public API.
1 parent 15d448d commit de5a0d3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/internal/Magento/Framework/Filesystem/File/ReadFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
use Magento\Framework\Filesystem\DriverInterface;
99
use Magento\Framework\Filesystem\DriverPool;
1010

11+
/**
12+
* Opens a file for reading
13+
* @api
14+
*/
1115
class ReadFactory
1216
{
1317
/**
@@ -28,7 +32,7 @@ public function __construct(DriverPool $driverPool)
2832
}
2933

3034
/**
31-
* Create a readable file
35+
* Create a {@see ReaderInterface}
3236
*
3337
* @param string $path
3438
* @param DriverInterface|string $driver Driver or driver code

lib/internal/Magento/Framework/Filesystem/File/WriteFactory.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
use Magento\Framework\Filesystem\DriverInterface;
99
use Magento\Framework\Filesystem\DriverPool;
1010

11+
/**
12+
* Opens a file for reading and/or writing
13+
* @api
14+
*/
1115
class WriteFactory extends ReadFactory
1216
{
1317
/**
@@ -29,12 +33,12 @@ public function __construct(DriverPool $driverPool)
2933
}
3034

3135
/**
32-
* Create a readable file.
36+
* Create a {@see WriterInterface}
3337
*
3438
* @param string $path
3539
* @param DriverInterface|string $driver Driver or driver code
3640
* @param string $mode [optional]
37-
* @return Write
41+
* @return WriteInterface
3842
*/
3943
public function create($path, $driver, $mode = 'r')
4044
{

0 commit comments

Comments
 (0)