44 * See COPYING.txt for license details.
55 */
66declare (strict_types=1 );
7+
78namespace Firegento \ContentProvisioning \Controller \Adminhtml \Block ;
89
910use Firegento \ContentProvisioning \Model \Command \ApplyBlockEntry ;
1011use Firegento \ContentProvisioning \Model \Query \GetBlockEntryByBlock ;
11- use Magento \Framework \App \Action \HttpPostActionInterface ;
1212use Magento \Backend \App \Action \Context ;
1313use Magento \Cms \Api \BlockRepositoryInterface ;
1414use Magento \Cms \Model \Block ;
1515use Magento \Cms \Model \BlockFactory ;
16+ use Magento \Framework \App \Action \HttpPostActionInterface ;
1617use Magento \Framework \App \Request \DataPersistorInterface ;
1718use Magento \Framework \Exception \LocalizedException ;
1819use Magento \Framework \Registry ;
@@ -138,11 +139,11 @@ private function processBlockReturn($model, $data, $resultRedirect)
138139 {
139140 $ redirect = $ data ['back ' ] ?? 'close ' ;
140141
141- if ($ redirect ==='continue ' ) {
142+ if ($ redirect === 'continue ' ) {
142143 $ resultRedirect ->setPath ('*/*/edit ' , ['block_id ' => $ model ->getId ()]);
143- } else if ($ redirect === 'close ' ) {
144+ } elseif ($ redirect === 'close ' ) {
144145 $ resultRedirect ->setPath ('*/*/ ' );
145- } else if ($ redirect === 'duplicate ' ) {
146+ } elseif ($ redirect === 'duplicate ' ) {
146147 $ duplicateModel = $ this ->blockFactory ->create (['data ' => $ data ]);
147148 $ duplicateModel ->setId (null );
148149 $ duplicateModel ->setIdentifier ($ data ['identifier ' ] . '- ' . uniqid ());
@@ -152,7 +153,7 @@ private function processBlockReturn($model, $data, $resultRedirect)
152153 $ this ->messageManager ->addSuccessMessage (__ ('You duplicated the block. ' ));
153154 $ this ->dataPersistor ->set ('cms_block ' , $ data );
154155 $ resultRedirect ->setPath ('*/*/edit ' , ['block_id ' => $ id ]);
155- } else if ($ redirect === 'applyDefault ' ) {
156+ } elseif ($ redirect === 'applyDefault ' ) {
156157 $ block = $ this ->getBlockEntryByBlock ->execute ($ model );
157158 $ this ->applyBlockEntry ->execute ($ block );
158159 $ resultRedirect ->setPath ('*/*/edit ' , ['block_id ' => $ model ->getId ()]);
0 commit comments