Skip to content

Commit 5aa5297

Browse files
author
Yevhen Miroshnychenko
committed
MAGETWO-92986: Write Logs for Failed Process of Generating Factories in Extensions
1 parent 79053d7 commit 5aa5297

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,12 @@ public function generate()
110110
} catch (FileSystemException $e) {
111111
$message = 'Error: an object of a generated class may be a dependency for another object, but this '
112112
. 'dependency has not been defined or set correctly in the signature of the related construct method. '
113-
. 'Due to the current error, executing the CLI commands `bin/magento setup:di:compile` or `bin/magento '
114-
. 'deploy:mode:set production` does not create the required generated classes. '
113+
. 'Due to the current error, executing the CLI commands `bin/magento setup:di:compile` or `bin/magento'
114+
. ' deploy:mode:set production` does not create the required generated classes. '
115115
. 'Magento cannot write a class file to the "generated" directory that is read-only. Before using the '
116-
. 'read-only file system, the classes to be generated must be created beforehand in the "generated" directory. '
117-
. 'For details, see the "File systems access permissions" topic at http://devdocs.magento.com.';
116+
. 'read-only file system, the classes to be generated must be created beforehand in the "generated" '
117+
. 'directory. For details, see the "File systems access permissions" topic '
118+
. 'at http://devdocs.magento.com.';
118119
$this->_addError($message);
119120
$this->_addError($e->getMessage());
120121
} catch (\Exception $e) {
@@ -261,9 +262,9 @@ protected function _validateData()
261262
$this->_addError('Source class ' . $sourceClassName . ' doesn\'t exist.');
262263
return false;
263264
} elseif (/**
264-
* If makeResultFileDirectory only fails because the file is already created,
265-
* a competing process has generated the file, no exception should be thrown.
266-
*/
265+
* If makeResultFileDirectory only fails because the file is already created,
266+
* a competing process has generated the file, no exception should be thrown.
267+
*/
267268
!$this->_ioObject->makeResultFileDirectory($resultClassName)
268269
&& !$this->_ioObject->fileExists($resultDir)
269270
) {
@@ -322,7 +323,8 @@ protected function _getNullDefaultValue()
322323
*/
323324
private function extractParameterType(
324325
\ReflectionParameter $parameter
325-
): ?string {
326+
): ?string
327+
{
326328
/** @var string|null $typeName */
327329
$typeName = null;
328330
if ($parameter->hasType()) {
@@ -339,7 +341,7 @@ private function extractParameterType(
339341
}
340342

341343
if ($parameter->allowsNull()) {
342-
$typeName = '?' .$typeName;
344+
$typeName = '?' . $typeName;
343345
}
344346
}
345347

@@ -353,7 +355,8 @@ private function extractParameterType(
353355
*/
354356
private function extractParameterDefaultValue(
355357
\ReflectionParameter $parameter
356-
): ?ValueGenerator {
358+
): ?ValueGenerator
359+
{
357360
/** @var ValueGenerator|null $value */
358361
$value = null;
359362
if ($parameter->isOptional() && $parameter->isDefaultValueAvailable()) {

0 commit comments

Comments
 (0)