Skip to content

Commit

Permalink
Merge pull request #25 from AmpersandHQ/fix-static-analysis
Browse files Browse the repository at this point in the history
Fix static analysis
  • Loading branch information
Liam Toohey authored Jun 9, 2020
2 parents 3442189 + 801be69 commit a3e654b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install:
- cd vendor/ampersand/travis-vanilla-magento/instances/disablestockres
- export COMPOSER_MEMORY_LIMIT=-1
- composer config repo.disablestockres git "../../../../../"
- composer require ampersand/magento2-disable-stock-reservation dev-$TRAVIS_BRANCH || composer require ampersand/magento2-disable-stock-reservation $TRAVIS_BRANCH
- composer require -vvv ampersand/magento2-disable-stock-reservation dev-$TRAVIS_BRANCH || composer require -vvv ampersand/magento2-disable-stock-reservation $TRAVIS_BRANCH
- php bin/magento setup:upgrade
# compile magento
- php bin/magento setup:di:compile
Expand Down
3 changes: 1 addition & 2 deletions dev/tests/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


/**
* Inherited Methods
* @method void wantToTest($text)
Expand All @@ -15,7 +14,7 @@
* @method void pause()
*
* @SuppressWarnings(PHPMD)
*/
*/
class AcceptanceTester extends \Codeception\Actor
{
use _generated\AcceptanceTesterActions;
Expand Down
2 changes: 1 addition & 1 deletion dev/tests/acceptance/CheckoutCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function stockDeductionPreventsSubsequentAddToBasket(Step\Acceptance\Mage

// Add 30 of unit, 10 over the limit, this should error with "Requested qty is not available"
$newCartId = $I->getGuestQuote();
$I->expectThrowable(Exception\RequestedQtyNotAvailable::class, function() use ($newCartId, $I) {
$I->expectThrowable(Exception\RequestedQtyNotAvailable::class, function () use ($newCartId, $I) {
$I->addSimpleProductToQuote($newCartId, 'amp_verify_stock_deduction_prevents_add_to_basket', 30);
});

Expand Down
2 changes: 1 addition & 1 deletion src/Model/GetInventoryRequestFromOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function execute(OrderInterface $order, array $requestItems): InventoryRe
*/
private function getAddressFromOrder(OrderInterface $order): ?AddressInterface
{
/** @var Address $shippingAddress */
/** @var Address|null $shippingAddress */
$shippingAddress = $order->getShippingAddress();
if ($shippingAddress === null) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/Model/GetItemsToDeductFromOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function execute(Order $order): array
{
$itemsToOrder = [];

/** @var \Magento\Sales\Model\Order\Item $orderItem */
/** @var \Magento\Sales\Model\Order\Item|null $orderItem */
foreach ($order->getAllVisibleItems() as $orderItem) {
if ($orderItem->getParentItem() !== null) {
continue;
Expand Down
5 changes: 3 additions & 2 deletions src/Model/GetSourceSelectionResultFromOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ public function execute(OrderInterface $order): SourceSelectionResultInterface
/**
* Get selection request items
*
* @param OrderItemInterface[]|Traversable $orderItems
* @param OrderItemInterface[] $orderItems
* @return array
*/
private function getSelectionRequestItems(iterable $orderItems): array
private function getSelectionRequestItems($orderItems): array
{
$selectionRequestItems = [];
/** @var \Magento\Sales\Model\Order\Item $orderItem */
foreach ($orderItems as $orderItem) {
if ($orderItem->isDummy()) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/SourceDeductionProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct(
* @param OrderService $subject
* @param OrderInterface $result
*
* @return OrderInterface
* @return OrderInterface|void
* @throws CouldNotSaveException
* @throws InputException
* @throws LocalizedException
Expand Down

0 comments on commit a3e654b

Please sign in to comment.