Skip to content

Commit cf4994a

Browse files
committed
Update function signature to match interface
When running `php bin/magento setup:di:compile` the following error is thrown: Compilation was started. Repositories code generation... 1/8 [===>------------------------] 12% 1 sec 100.0 MiBPHP Fatal error: Declaration of Magento\PageBuilder\Model\Dom\NodeList::item($index): ?Magento\PageBuilder\Model\Dom\Adapter\ElementInterface must be compatible with Magento\PageBuilder\Model\Dom\Adapter\NodeListInterface::item(int $index): ?Magento\PageBuilder\Model\Dom\Adapter\ElementInterface in /var/www/html/vendor/magento/module-page-builder/Model/Dom/NodeList.php on line 19 Fatal error: Declaration of Magento\PageBuilder\Model\Dom\NodeList::item($index): ?Magento\PageBuilder\Model\Dom\Adapter\ElementInterface must be compatible with Magento\PageBuilder\Model\Dom\Adapter\NodeListInterface::item(int $index): ?Magento\PageBuilder\Model\Dom\Adapter\ElementInterface in /var/www/html/vendor/magento/module-page-builder/Model/Dom/NodeList.php on line 19
1 parent aa71a04 commit cf4994a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/PageBuilder/Model/Dom/NodeList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(
4444
/**
4545
* @inheritDoc
4646
*/
47-
public function item($index): ?ElementInterface
47+
public function item(int $index): ?ElementInterface
4848
{
4949
return $this->objectManager->create(ElementInterface::class, [ 'element' => $this->nodeList->item($index) ]);
5050
}

0 commit comments

Comments
 (0)