Skip to content

Commit 21cabca

Browse files
committed
#192 #99 - Add Strict Typing
1 parent 7efde87 commit 21cabca

58 files changed

Lines changed: 107 additions & 8 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Inventory/Controller/Adminhtml/Source/Index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Inventory\Controller\Adminhtml\Source;
79

810
use Magento\Backend\App\Action;

Inventory/Controller/Adminhtml/Source/InlineEdit.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Inventory\Controller\Adminhtml\Source;
79

810
use Magento\Backend\App\Action;

Inventory/Controller/Adminhtml/Source/NewAction.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
declare(strict_types=1);
8+
79
namespace Magento\Inventory\Controller\Adminhtml\Source;
810

911
use Magento\Backend\App\Action;

Inventory/Controller/Adminhtml/Source/Save.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Inventory\Controller\Adminhtml\Source;
79

810
use Exception;

Inventory/Controller/Adminhtml/Source/SourceCarrierDataProcessor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Inventory\Controller\Adminhtml\Source;
79

810
use Magento\Framework\Exception\InputException;

Inventory/Controller/Adminhtml/Source/SourceHydrator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Inventory\Controller\Adminhtml\Source;
79

810
use Magento\Framework\Api\DataObjectHelper;

Inventory/Controller/Adminhtml/Stock/Delete.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Inventory\Controller\Adminhtml\Stock;
79

810
use Magento\Backend\App\Action;
@@ -46,7 +48,7 @@ public function execute()
4648
{
4749
$resultRedirect = $this->resultRedirectFactory->create();
4850

49-
$stockId = $this->getRequest()->getPost(StockInterface::STOCK_ID);
51+
$stockId = (int) $this->getRequest()->getPost(StockInterface::STOCK_ID);
5052
if ($stockId === null) {
5153
$this->messageManager->addErrorMessage(__('Wrong request.'));
5254
return $resultRedirect->setPath('*/*');

Inventory/Controller/Adminhtml/Stock/Edit.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Inventory\Controller\Adminhtml\Stock;
79

810
use Magento\Backend\App\Action;
@@ -46,9 +48,9 @@ public function __construct(
4648
*/
4749
public function execute()
4850
{
49-
$stockId = $this->getRequest()->getParam(StockInterface::STOCK_ID);
51+
$stockId = (int) $this->getRequest()->getParam(StockInterface::STOCK_ID);
5052
try {
51-
$stock = $this->stockRepository->get((int)$stockId);
53+
$stock = $this->stockRepository->get($stockId);
5254

5355
/** @var Page $result */
5456
$result = $this->resultFactory->create(ResultFactory::TYPE_PAGE);

Inventory/Controller/Adminhtml/Stock/Index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Inventory\Controller\Adminhtml\Stock;
79

810
use Magento\Backend\App\Action;

Inventory/Controller/Adminhtml/Stock/InlineEdit.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Inventory\Controller\Adminhtml\Stock;
79

810
use Magento\Backend\App\Action;

0 commit comments

Comments
 (0)