Skip to content

Commit b642f06

Browse files
committed
MAGETWO-69964: PHPCS cannot parse correctly syntax of PHP 7.x return types
1 parent 41f483c commit b642f06

File tree

1 file changed

+6
-6
lines changed
  • lib/internal/Magento/Framework/ObjectManager/Code/Generator

1 file changed

+6
-6
lines changed

lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,13 @@ protected function _getGetMethod()
223223
/** @var ParameterReflection $parameterReflection */
224224
$parameterReflection = $methodReflection->getParameters()[0];
225225
$body = "if (!\$id) {\n"
226-
. " throw new " . InputException::class . "('ID required');\n"
226+
. " throw new \\" . InputException::class . "('ID required');\n"
227227
. "}\n"
228228
. "if (!isset(\$this->registry[\$id])) {\n"
229229
. " \$entity = \$this->" . $this->_getSourcePersistorPropertyName()
230230
. "->loadEntity(\$id);\n"
231231
. " if (!\$entity->getId()) {\n"
232-
. " throw new " . NoSuchEntityException::class . "('Requested entity doesn\\'t exist');\n"
232+
. " throw new \\" . NoSuchEntityException::class . "('Requested entity doesn\\'t exist');\n"
233233
. " }\n"
234234
. " \$this->registry[\$id] = \$entity;\n"
235235
. "}\n"
@@ -257,11 +257,11 @@ protected function _getGetMethod()
257257
],
258258
[
259259
'name' => 'throws',
260-
'description' => InputException::class,
260+
'description' => '\\' . InputException::class,
261261
],
262262
[
263263
'name' => 'throws',
264-
'description' => NoSuchEntityException::class,
264+
'description' => '\\' . NoSuchEntityException::class,
265265
],
266266
],
267267
]
@@ -510,7 +510,7 @@ protected function _getGetListMethod()
510510
'parameters' => [
511511
[
512512
'name' => 'searchCriteria',
513-
'type' => SearchCriteriaInterface::class,
513+
'type' => '\\' . SearchCriteriaInterface::class,
514514
],
515515
],
516516
'body' => $body,
@@ -519,7 +519,7 @@ protected function _getGetListMethod()
519519
'tags' => [
520520
[
521521
'name' => 'param',
522-
'description' => SearchCriteriaInterface::class . ' $searchCriteria',
522+
'description' => '\\' . SearchCriteriaInterface::class . ' $searchCriteria',
523523
],
524524
[
525525
'name' => 'return',

0 commit comments

Comments
 (0)