Skip to content

Commit 2a25cc5

Browse files
committed
A type-hinting for PHPStan
1 parent 809c5b2 commit 2a25cc5

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Component/ComponentFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public function createFromDefinition(ComponentDefinition $componentDefinition):
3636
$componentClass = $componentDefinition->getClassName();
3737

3838
try {
39-
return $this->objectManager->create($componentClass, $arguments);
39+
/** @var Component $component */
40+
$component = $this->objectManager->create($componentClass, $arguments);
41+
return $component;
4042
} catch (UnexpectedValueException $exception) {
4143
throw new UnexpectedValueException("Failed to create component: \n"
4244
. json_encode($arguments) . "\n"

Filter/FilterScopeFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public function __construct(
1313

1414
public function create(): FilterScope
1515
{
16-
return $this->objectManager->create(FilterScope::class);
16+
/** @var FilterScope $filterScope */
17+
$filterScope = $this->objectManager->create(FilterScope::class);
18+
return $filterScope;
1719
}
1820
}

0 commit comments

Comments
 (0)