Skip to content

Commit

Permalink
- Expanded to ReadInterface to include the readAll function, since a …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
dverkade committed Aug 26, 2017
1 parent 24f2f07 commit b5ee415
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public function current()
);
}

/** @var \Magento\Framework\Filesystem\File\Read $fileRead */
$fileRead = $this->fileReadFactory->create($this->key(), DriverPool::FILE);
$contents = $fileRead->readAll();
return str_replace('<template ', '<template module="' . $moduleName . '" ', $contents);
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/Translation/Model/Js/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ public function getData($themePath)

$dictionary = [];
foreach ($files as $filePath) {
/** @var \Magento\Framework\Filesystem\File\Read $read */
$read = $this->fileReadFactory->create($filePath[0], \Magento\Framework\Filesystem\DriverPool::FILE);
$content = $read->readAll();
foreach ($this->getPhrases($content) as $phrase) {
Expand Down
1 change: 0 additions & 1 deletion lib/internal/Magento/Framework/Config/FileIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public function rewind()
*/
public function current()
{
/** @var \Magento\Framework\Filesystem\File\Read $fileRead */
$fileRead = $this->fileReadFactory->create($this->key(), DriverPool::FILE);
return $fileRead->readAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ interface ReadInterface
*/
public function read($length);

/**
* Returns the complete content of the file.
*
* @param string|null $flag
* @param resource|null $context
* @return string
*/
public function readAll($flag = null, $context = null);

/**
* Reads the line with specified number of bytes from the current position.
*
Expand Down

0 comments on commit b5ee415

Please sign in to comment.