Skip to content

Commit b5ee415

Browse files
committed
- Expanded to ReadInterface to include the readAll function, since a class implementing the ReadInterface should have this function in order to substitute the Read class.
- Removed comment variable declarations from other file where the type is declared. This was necessary due to the missing function in the interface. Autocompleting this function now works properly, so these comments can be removed.
1 parent 24f2f07 commit b5ee415

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

app/code/Magento/Email/Model/Template/Config/FileIterator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public function current()
4747
);
4848
}
4949

50-
/** @var \Magento\Framework\Filesystem\File\Read $fileRead */
5150
$fileRead = $this->fileReadFactory->create($this->key(), DriverPool::FILE);
5251
$contents = $fileRead->readAll();
5352
return str_replace('<template ', '<template module="' . $moduleName . '" ', $contents);

app/code/Magento/Translation/Model/Js/DataProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ public function getData($themePath)
103103

104104
$dictionary = [];
105105
foreach ($files as $filePath) {
106-
/** @var \Magento\Framework\Filesystem\File\Read $read */
107106
$read = $this->fileReadFactory->create($filePath[0], \Magento\Framework\Filesystem\DriverPool::FILE);
108107
$content = $read->readAll();
109108
foreach ($this->getPhrases($content) as $phrase) {

lib/internal/Magento/Framework/Config/FileIterator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public function rewind()
6666
*/
6767
public function current()
6868
{
69-
/** @var \Magento\Framework\Filesystem\File\Read $fileRead */
7069
$fileRead = $this->fileReadFactory->create($this->key(), DriverPool::FILE);
7170
return $fileRead->readAll();
7271
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ interface ReadInterface
1919
*/
2020
public function read($length);
2121

22+
/**
23+
* Returns the complete content of the file.
24+
*
25+
* @param string|null $flag
26+
* @param resource|null $context
27+
* @return string
28+
*/
29+
public function readAll($flag = null, $context = null);
30+
2231
/**
2332
* Reads the line with specified number of bytes from the current position.
2433
*

0 commit comments

Comments
 (0)