diff --git a/Model/Console/AddBlockCommand.php b/Model/Console/AddBlockCommand.php index e3bc4ca055ee6da6017dddf7a03ec3c5bb98fcd6..01a0be42e007ce7681a95ed05a7663fae055623c 100644 --- a/Model/Console/AddBlockCommand.php +++ b/Model/Console/AddBlockCommand.php @@ -5,7 +5,7 @@ namespace Firegento\ContentProvisioning\Model\Console; use Firegento\ContentProvisioning\Model\Command\ApplyBlockEntry; use Firegento\ContentProvisioning\Model\Query\GetBlockEntryByKey; -use Firegento\ContentProvisioning\Model\Query\GetBlockEntryList\Proxy as GetBlockEntryList; +use Firegento\ContentProvisioning\Model\Query\GetBlockEntryByKeyFactory; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -18,7 +18,7 @@ class AddBlockCommand extends Command /** * @var GetBlockEntryByKey */ - private $getBlockEntryByKey; + private $getBlockEntryByKeyFactory; /** * @var ApplyBlockEntry @@ -26,17 +26,18 @@ class AddBlockCommand extends Command private $applyBlockEntry; /** - * @param GetBlockEntryList $getBlockEntryByKey + * @param GetBlockEntryByKeyFactory $getBlockEntryByKeyFactory + * @param ApplyBlockEntry $applyBlockEntry * @param string|null $name */ public function __construct( - GetBlockEntryByKey $getBlockEntryByKey, + GetBlockEntryByKeyFactory $getBlockEntryByKeyFactory, ApplyBlockEntry $applyBlockEntry, string $name = null ) { parent::__construct($name); - $this->getBlockEntryByKey = $getBlockEntryByKey; - $this->applyBlockEntry = $applyBlockEntry; + $this->getBlockEntryByKeyFactory = $getBlockEntryByKeyFactory; + $this->applyBlockEntry = $applyBlockEntry; } /** @@ -45,7 +46,7 @@ class AddBlockCommand extends Command protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument(self::ARG_BLOCK_KEY); - $block = $this->getBlockEntryByKey->get($key); + $block = $this->getBlockEntryByKeyFactory->create()->get($key); $this->applyBlockEntry->execute($block); } diff --git a/Model/Console/AddPageCommand.php b/Model/Console/AddPageCommand.php index fb34b57e413c4de00d8fdf1043d4e6eaa2c4bf4a..75f5993a0b3b1c71513e80787c8add8eae3d9798 100644 --- a/Model/Console/AddPageCommand.php +++ b/Model/Console/AddPageCommand.php @@ -5,8 +5,7 @@ namespace Firegento\ContentProvisioning\Model\Console; use Firegento\ContentProvisioning\Model\Command\ApplyPageEntry; use Firegento\ContentProvisioning\Model\Query\GetPageEntryByKey; -use Firegento\ContentProvisioning\Model\Query\GetPageEntryList\Proxy as GetPageEntryList; -use Firegento\ContentProvisioning\Model\Query\GetPagesByPageEntry\Proxy as GetPagesByPageEntry; +use Firegento\ContentProvisioning\Model\Query\GetPageEntryByKeyFactory; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -19,7 +18,7 @@ class AddPageCommand extends Command /** * @var GetPageEntryByKey */ - private $getPageEntryByKey; + private $getPageEntryByKeyFactory; /** * @var ApplyPageEntry @@ -27,18 +26,18 @@ class AddPageCommand extends Command private $applyPageEntry; /** - * @param GetPageEntryList $getAllContentEntries - * @param GetPagesByPageEntry $getPagesByPageEntry + * @param GetPageEntryByKeyFactory $getPageEntryByKey + * @param ApplyPageEntry $applyPageEntry * @param string|null $name */ public function __construct( - GetPageEntryByKey $getPageEntryByKey, + GetPageEntryByKeyFactory $getPageEntryByKeyFactory, ApplyPageEntry $applyPageEntry, string $name = null ) { parent::__construct($name); - $this->getPageEntryByKey = $getPageEntryByKey; - $this->applyPageEntry = $applyPageEntry; + $this->getPageEntryByKeyFactory = $getPageEntryByKeyFactory; + $this->applyPageEntry = $applyPageEntry; } /** @@ -47,7 +46,7 @@ class AddPageCommand extends Command protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument(self::ARG_PAGE_KEY); - $page = $this->getPageEntryByKey->get($key); + $page = $this->getPageEntryByKeyFactory->create()->get($key); $this->applyPageEntry->execute($page); } diff --git a/composer.json b/composer.json index f6892ff088add86650b503f81e8c604fe7295157..caf9ea2eca1a2c1581e3898a5ef156e11abe31fd 100644 --- a/composer.json +++ b/composer.json @@ -2,10 +2,10 @@ "name": "firegento/magento2-content-provisioning", "description": "N/A", "require": { - "php": "~7.1.3|~7.2.0|~7.3.0", - "magento/framework": "100.1.*|101.0.*|102.0.*", - "magento/module-cms": "101.0.*|102.0.*|103.0.*", - "magento/module-widget": "100.1.*|101.0.*|101.1.*" + "php": "~7.1.3|~7.2.0|~7.3.0|~7.4.0", + "magento/framework": "100.1.*|101.0.*|102.0.*|103.0.*", + "magento/module-cms": "101.0.*|102.0.*|103.0.*|104.0.*", + "magento/module-widget": "100.1.*|101.0.*|101.1.*|101.2.*" }, "require-dev": { "mikey179/vfsstream": "^1.6" diff --git a/etc/di.xml b/etc/di.xml index a00e2d47caec5122b9cef8ed1b8df0c8107854ff..fc3bc5511f61ea06cb8872d205cd22485dbb0da9 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -80,7 +80,7 @@ </arguments> </type> - <type name="Magento\Framework\Console\CommandList"> + <type name="Magento\Framework\Console\CommandListInterface"> <arguments> <argument name="commands" xsi:type="array"> <item name="contentProvisioning.PageList" xsi:type="object">Firegento\ContentProvisioning\Model\Console\PageListCommand</item>