Skip to content

Commit

Permalink
Merge pull request #1444 from magento-engcom/develop-prs
Browse files Browse the repository at this point in the history
Public Pull Requests:

#10718
#10672
  • Loading branch information
Oleksii Korshenko authored Aug 31, 2017
2 parents b9d696e + d490d5c commit 2808f2d
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 11 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
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@
<module value="Magento_Customer" strict="1" />
<module value="Magento_CustomerImportExport" strict="1" />
<module value="Magento_Dhl" strict="1" />
<module value="Magento_Directory" strict="1" />
<module value="Magento_Downloadable" strict="1" />
<module value="Magento_Email" strict="1" />
<module value="Magento_Fedex" strict="1" />
<module value="Magento_GiftMessage" strict="1" />
<module value="Magento_GroupedImportExport" strict="1" />
<module value="Magento_GroupedProduct" strict="1" />
<module value="Magento_ImportExport" strict="1" />
<module value="Magento_Indexer" strict="1" />
<module value="Magento_Install" strict="1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<module value="Magento_ConfigurableProduct" strict="1" />
<module value="Magento_Checkout" strict="1" />
<module value="Magento_LayeredNavigation" strict="1" />
<module value="Magento_Msrp" strict="1" />
<module value="Magento_Multishipping" strict="1" />
<module value="Magento_Newsletter" strict="1" />
<module value="Magento_OfflinePayments" strict="1" />
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/Magento/Framework/Code/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ protected function shouldSkipGeneration($resultEntityType, $sourceClassName, $re
{
if (!$resultEntityType || !$sourceClassName) {
return self::GENERATION_ERROR;
} elseif ($this->definedClasses->isClassLoadableFromDisc($resultClass)) {
} elseif ($this->definedClasses->isClassLoadableFromDisk($resultClass)) {
$generatedFileName = $this->_ioObject->generateResultFileName($resultClass);
/**
* Must handle two edge cases: a competing process has generated the class and written it to disc already,
Expand Down
16 changes: 14 additions & 2 deletions lib/internal/Magento/Framework/Code/Generator/DefinedClasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DefinedClasses
*/
public function isClassLoadable($className)
{
return $this->isClassLoadableFromMemory($className) || $this->isClassLoadableFromDisc($className);
return $this->isClassLoadableFromMemory($className) || $this->isClassLoadableFromDisk($className);
}

/**
Expand All @@ -36,12 +36,24 @@ public function isClassLoadableFromMemory($className)
}

/**
* Determine if a class exists on disc
* Determine if a class exists on disk
*
* @param string $className
* @return bool
* @deprecated
*/
public function isClassLoadableFromDisc($className)
{
return $this->isClassLoadableFromDisk($className);
}

/**
* Determine if a class exists on disk
*
* @param string $className
* @return bool
*/
public function isClassLoadableFromDisk($className)
{
try {
return (bool)AutoloaderRegistry::getAutoloader()->findFile($className);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ protected function _prepareMocksForValidateData(
->willReturn($sourceClassExists);
if ($resultClassExists) {
$definedClassesMock->expects($this->once())
->method('isClassLoadableFromDisc')
->method('isClassLoadableFromDisk')
->with($this->resultClass)
->willReturn($resultClassExists);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function testGenerateClassWithError()
public function testGenerateClassWithExistName($fileExists)
{
$this->definedClassesMock->expects($this->any())
->method('isClassLoadableFromDisc')
->method('isClassLoadableFromDisk')
->willReturn(true);

$resultClassFileName = '/Magento/Path/To/Class.php';
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 2808f2d

Please sign in to comment.