Skip to content

Commit

Permalink
Merge pull request #766 from Nosto/feature/2.4.4-compatibility
Browse files Browse the repository at this point in the history
Feature/2.4.4 compatibility
  • Loading branch information
supercid authored May 3, 2022
2 parents bee4390 + ffb49e7 commit 3dee14d
Show file tree
Hide file tree
Showing 205 changed files with 4,045 additions and 2,330 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2, pecl
tools: composer:v2.1.14, pecl
extensions: ast, bcmath, gd
coverage: none

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install Magento
id: install-magento
run: |
composer create-project magento/community-edition=2.4.2 magento --no-dev
composer create-project magento/community-edition=2.4.4 magento --no-dev
cd magento
composer config minimum-stability dev
composer config prefer-stable true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Install Magento
id: install-magento
run: |
composer create-project magento/community-edition=2.4.2 magento --no-dev
composer create-project magento/community-edition=2.4.4 magento --no-dev
cd magento
composer config minimum-stability dev
composer config prefer-stable true
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Unit Tests

on: [push]

jobs:

phpcs:
name: Code Sniffer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

############################################################################
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
extensions: ast, bcmath, gd
coverage: none

#https://github.com/actions/cache/blob/master/examples.md#php---composer
- name: Cache composer packages
id: composer-cache
run: |
composer config cache-files-dir
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Update project dependencies
env:
REPO_USR: ${{ secrets.REPO_USR }}
REPO_PSW: ${{ secrets.REPO_PSW }}
run: |
composer config repositories.0 composer https://repo.magento.com
composer config http-basic.repo.magento.com "$REPO_USR" "$REPO_PSW"
composer install --prefer-dist --no-progress --no-suggest
############################################################################

- name: Run unit tests
run: |
./vendor/bin/phpunit Test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ bin
phan.xml
chk*xml
output
.phpunit.cache
4 changes: 2 additions & 2 deletions Api/CustomerRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function save(CustomerInterface $customer);
*
* @return CustomerInterface|null
*/
public function getOneByNostoIdAndQuoteId($nostoId, $quoteId);
public function getOneByNostoIdAndQuoteId(string $nostoId, int $quoteId);

/**
* Get customer entry by restore cart hash. If multiple entries
Expand All @@ -68,5 +68,5 @@ public function getOneByNostoIdAndQuoteId($nostoId, $quoteId);
*
* @return CustomerInterface|null
*/
public function getOneByRestoreCartHash($hash);
public function getOneByRestoreCartHash(string $hash);
}
22 changes: 11 additions & 11 deletions Api/Data/CustomerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@

interface CustomerInterface
{
const CUSTOMER_ID = 'customer_id';
const QUOTE_ID = 'quote_id';
const NOSTO_ID = 'nosto_id';
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
const RESTORE_CART_HASH = 'restore_cart_hash';
public const CUSTOMER_ID = 'customer_id';
public const QUOTE_ID = 'quote_id';
public const NOSTO_ID = 'nosto_id';
public const CREATED_AT = 'created_at';
public const UPDATED_AT = 'updated_at';
public const RESTORE_CART_HASH = 'restore_cart_hash';

/**
* @var int The length of the restore cart attribute
*/
const NOSTO_TAGGING_RESTORE_CART_ATTRIBUTE_LENGTH = 64;
public const NOSTO_TAGGING_RESTORE_CART_ATTRIBUTE_LENGTH = 64;

/**
* Get customer id
Expand Down Expand Up @@ -100,22 +100,22 @@ public function getRestoreCartHash();
* @param int $customerId
* @return self
*/
public function setCustomerId($customerId);
public function setCustomerId(int $customerId);

/**
* Set quote id
*
* @param int $quoteId
*/
public function setQuoteId($quoteId);
public function setQuoteId(int $quoteId);

/**
* Set Nosto Id
*
* @param string $nostoId
* @return self
*/
public function setNostoId($nostoId);
public function setNostoId(string $nostoId);

/**
* Set created at time
Expand All @@ -139,5 +139,5 @@ public function setUpdatedAt(DateTime $updatedAt);
* @param string $restoreCartHash
* @return self
*/
public function setRestoreCartHash($restoreCartHash);
public function setRestoreCartHash(string $restoreCartHash);
}
38 changes: 19 additions & 19 deletions Api/Data/ProductUpdateQueueInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@
*/
interface ProductUpdateQueueInterface
{
const ID = 'id';
const CREATED_AT = 'created_at';
const STARTED_AT = 'started_at';
const COMPLETED_AT = 'completed_at';
const STORE_ID = 'store_id';
const PRODUCT_IDS = 'product_ids';
const PRODUCT_ID_COUNT = 'product_id_count';
const ACTION = 'action';
const ACTION_VALUE_UPSERT = 'upsert';
const ACTION_VALUE_DELETE = 'delete';
const STATUS = 'status';
const STATUS_VALUE_NEW = 'new';
const STATUS_VALUE_PROCESSING = 'processing';
const STATUS_VALUE_DONE = 'done';
public const ID = 'id';
public const CREATED_AT = 'created_at';
public const STARTED_AT = 'started_at';
public const COMPLETED_AT = 'completed_at';
public const STORE_ID = 'store_id';
public const PRODUCT_IDS = 'product_ids';
public const PRODUCT_ID_COUNT = 'product_id_count';
public const ACTION = 'action';
public const ACTION_VALUE_UPSERT = 'upsert';
public const ACTION_VALUE_DELETE = 'delete';
public const STATUS = 'status';
public const STATUS_VALUE_NEW = 'new';
public const STATUS_VALUE_PROCESSING = 'processing';
public const STATUS_VALUE_DONE = 'done';

/**
* Get row id
Expand Down Expand Up @@ -129,7 +129,7 @@ public function getProductIdCount();
* @return self
* @SuppressWarnings(PHPMD.ShortVariable)
*/
public function setId($id);
public function setId(int $id);

/**
* Set product id
Expand All @@ -145,7 +145,7 @@ public function setProductIds(array $productIds);
* @param int $storeId
* @return self
*/
public function setStoreId($storeId);
public function setStoreId(int $storeId);

/**
* Set created at time
Expand Down Expand Up @@ -181,17 +181,17 @@ public function setStore(StoreInterface $store);
* @param string $status
* @return self
*/
public function setStatus($status);
public function setStatus(string $status);

/**
* @param string $action
* @return self
*/
public function setAction($action);
public function setAction(string $action);

/**
* @param int $count
* @return self
*/
public function setProductIdCount($count);
public function setProductIdCount(int $count);
}
4 changes: 2 additions & 2 deletions Block/Addtocart.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class Addtocart extends Template
TaggingTrait::__construct as taggingConstruct; // @codingStandardsIgnoreLine
}

private $urlEncoder;
private $nostoHelperData;
private EncoderInterface $urlEncoder;
private NostoHelperData $nostoHelperData;

/**
* Constructor.
Expand Down
7 changes: 4 additions & 3 deletions Block/Adminhtml/Account/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
use Magento\Backend\Block\Template\Context as BlockContext;
use Nosto\Tagging\Helper\Scope as NostoHelperScope;
use Nosto\Tagging\Helper\Url as NostoHelperUrl;
use Psr\Log\LoggerInterface;

class Config extends BlockTemplate
{
private $urlHelper;
private $nostoHelperScope;
private $logger;
private NostoHelperUrl $urlHelper;
private NostoHelperScope $nostoHelperScope;
private LoggerInterface $logger;

/**
* Constructor.
Expand Down
16 changes: 8 additions & 8 deletions Block/Adminhtml/Account/Iframe.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ class Iframe extends BlockTemplate
{
use IframeTrait;

const IFRAME_VERSION = 1;

private $nostoHelperAccount;
private $backendAuthSession;
private $iframeMetaBuilder;
private $currentUserBuilder;
private $nostoHelperScope;
private $logger;
public const IFRAME_VERSION = 1;

private NostoHelperAccount $nostoHelperAccount;
private Session $backendAuthSession;
private NostoIframeMetaBuilder $iframeMetaBuilder;
private NostoCurrentUserBuilder $currentUserBuilder;
private NostoHelperScope $nostoHelperScope;
private NostoLogger $logger;

/**
* Constructor.
Expand Down
6 changes: 3 additions & 3 deletions Block/Adminhtml/Form/Field/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
class Tokens extends Field
{
/** @var NostoHelperAccount $nostoHelperAccount */
public $nostoHelperAccount;
public NostoHelperAccount $nostoHelperAccount;

/** @var NostoHelperScope $nostoHelperScope */
public $nostoHelperScope;
public NostoHelperScope $nostoHelperScope;

/** @var Http $request */
public $request;
public Http $request;

/**
* Tokens constructor.
Expand Down
8 changes: 4 additions & 4 deletions Block/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ class Category extends Template
/**
* @var Registry
*/
private $registry;
private Registry $registry;

/**
* @var NostoCategoryBuilder
*/
private $categoryBuilder;
private NostoCategoryBuilder $categoryBuilder;

/**
* @var NostoHelperScope
*/
private $nostoHelperScope;
private NostoHelperScope $nostoHelperScope;

/**
* @var NostoHelperAccount
*/
private $nostoHelperAccount;
private NostoHelperAccount $nostoHelperAccount;

/**
* Constructor.
Expand Down
6 changes: 3 additions & 3 deletions Block/Email/ImageUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
*/
class ImageUrl extends Template
{
private $nostoHelperScope;
private $nostoHelperAccount;
private $logger;
private NostoHelperScope $nostoHelperScope;
private NostoHelperAccount $nostoHelperAccount;
private NostoLogger $logger;

/**
* Constructor.
Expand Down
4 changes: 2 additions & 2 deletions Block/Email/Visible.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
*/
class Visible extends Template
{
private $nostoHelperScope;
private $nostoHelperAccount;
private NostoHelperScope $nostoHelperScope;
private NostoHelperAccount $nostoHelperAccount;

/**
* Constructor.
Expand Down
10 changes: 5 additions & 5 deletions Block/Knockout.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@
class Knockout extends Template
{
/** @var NostoHelperAccount */
private $nostoHelperAccount;
private NostoHelperAccount $nostoHelperAccount;

/** @var NostoHelperScope */
private $nostoHelperScope;
private NostoHelperScope $nostoHelperScope;

/** @var NostoHelperData */
private $nostoHelperData;
private NostoHelperData $nostoHelperData;

/** @var StoreManagerInterface */
private $storeManager;
private StoreManagerInterface $storeManager;

/** @var Logger */
private $logger;
private Logger $logger;

/**
* Knockout constructor.
Expand Down
2 changes: 1 addition & 1 deletion Block/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Meta extends Template
TaggingTrait::__construct as taggingConstruct; // @codingStandardsIgnoreLine
}

private $nostoHelperData;
private NostoHelperData $nostoHelperData;

/**
* Constructor.
Expand Down
Loading

0 comments on commit 3dee14d

Please sign in to comment.