Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/2.4.4 compatibility #766

Merged
merged 78 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
d158298
Add auto generated OperationInterfaceFactory class to constructor
supercid Mar 18, 2022
b9f9e66
Add db_schema.xml
supercid Mar 21, 2022
b90c90c
Init DataPatch
supercid Mar 21, 2022
1ffac27
Bump module version to 6.0.0
supercid Mar 21, 2022
1bcb87c
Bump min PHP required version to 7.4
supercid Mar 21, 2022
f958685
Fix constant visibility warnings
supercid Mar 21, 2022
bd85b81
Code Sniffer
supercid Mar 22, 2022
688b5da
CS fix: Tag @package MUST NOT be used.
supercid Mar 23, 2022
89af457
PHPCS fix: Static method cannot be intercepted and its use is discour…
supercid Mar 23, 2022
c024791
PHPCS fix: Static method cannot be intercepted and its use is discour…
supercid Mar 23, 2022
043ffb5
PHPCS fixes
supercid Mar 23, 2022
6c153ab
CS fix short array syntax
supercid Mar 23, 2022
2b5d8a3
Upgrade compile project
supercid Mar 23, 2022
0b61895
Update magento/magento-coding-standard
supercid Mar 23, 2022
265b8de
Update phpcs ruleset
supercid Mar 23, 2022
5acdc84
Update magento version on phan workflow
supercid Mar 23, 2022
1ae6992
BuildName should return string
supercid Mar 23, 2022
7916008
Phan fix
supercid Mar 23, 2022
d21df81
Phan Suppress
supercid Mar 23, 2022
9035c6e
Code smells
supercid Mar 24, 2022
21f1eaf
Add parameter types
supercid Mar 24, 2022
e3d2005
Add parameter types
supercid Mar 24, 2022
a420993
Phan fix
supercid Mar 24, 2022
241aa85
Missing property types
supercid Mar 24, 2022
012e584
Qualifier can be replaced with an import
supercid Mar 24, 2022
40d45bd
Missing exception type
supercid Mar 24, 2022
680c53a
Nullable property type
supercid Mar 24, 2022
f7760bd
Property Types, unused code, supress invalid exceptions
supercid Mar 24, 2022
58cc413
Fix db_schema.xml
supercid Mar 24, 2022
e6ea319
Remove extra index
supercid Mar 24, 2022
19b8572
Initialize static typed properties
supercid Mar 24, 2022
84b3fb3
Initialize static typed properties
supercid Mar 24, 2022
654349e
Init unit tests
supercid Mar 24, 2022
eab7439
Update action name
supercid Mar 24, 2022
4352b21
Move phpunit to composer require-dev
supercid Mar 24, 2022
b212ede
Phan fix
supercid Mar 24, 2022
8da078f
Merge branch 'develop' into feature/2.4.4-compatibility
supercid Mar 24, 2022
2dcef8a
AccountTest
supercid Mar 25, 2022
7536027
Add PopulateCustomerReference data patch
supercid Mar 30, 2022
86a4f03
Add AlterCustomerReferenceNonEditable data patch
supercid Mar 30, 2022
7121536
Remove schema files
supercid Apr 5, 2022
a12685b
Remove db core files
supercid Apr 6, 2022
07f669f
add zip to packaging action
supercid Apr 6, 2022
03fecb0
Remove zip, add missing package path
supercid Apr 6, 2022
cde0f67
Add missing package path
supercid Apr 6, 2022
3a70988
Add missing package path
supercid Apr 6, 2022
7871519
Add missing package path
supercid Apr 6, 2022
4a7b22c
Revert Add missing package path
supercid Apr 6, 2022
c4e04c9
Downgrade composer version
supercid Apr 6, 2022
29f6f71
Change type of nosto_id in db_schema
dairbuirabass Apr 6, 2022
3a2b9d1
Fix product with no reviews
dairbuirabass Apr 7, 2022
f4c422e
Init quote in constructor
dairbuirabass Apr 7, 2022
869f42c
Fix 'Property declared dynamically' IDE issue in Proxy
dairbuirabass Apr 8, 2022
9b8bd1d
Fix IDE inspection errors
dairbuirabass Apr 8, 2022
2637729
Fix error
dairbuirabass Apr 8, 2022
033b2d3
Remove value assignation in class
dairbuirabass Apr 8, 2022
5acb51b
Fix inspections
dairbuirabass Apr 8, 2022
bbdda9c
Fix setup:upgrade failing
dairbuirabass Apr 8, 2022
170e519
Add type declarations
dairbuirabass Apr 8, 2022
032f0cb
Fix export API type error
supercid Apr 11, 2022
94178b5
Update nosto/php-sdk
dairbuirabass Apr 13, 2022
d65c494
Update workflow composer installation to update phpseclib
dairbuirabass Apr 13, 2022
2284c85
Fix old phpseclib reference
dairbuirabass Apr 13, 2022
5d845d7
Update workflow composer installation to update phpseclib
dairbuirabass Apr 13, 2022
114010c
Update workflow composer installation to update phpseclib
dairbuirabass Apr 13, 2022
a89702e
Update magento base version on action IDE and PHAN
supercid Apr 14, 2022
de5688e
Update magento base version on action IDE and PHAN
supercid Apr 14, 2022
660ef56
Suppress return
supercid Apr 28, 2022
d51365e
Suppress return
supercid Apr 28, 2022
5da5812
Suppress return
supercid Apr 28, 2022
5fc3b3a
Remove unused product_caching feature flag default value
dairbuirabass Apr 29, 2022
49b0077
Merge branch 'feature/2.4.4-compatibility' of github.com:Nosto/nosto-…
dairbuirabass Apr 29, 2022
7212272
SKU builder null check
supercid May 2, 2022
a2fd5d4
Fix product data table size
supercid May 2, 2022
5319cfc
Merge remote-tracking branch 'origin/develop' into feature/2.4.4-comp…
supercid May 2, 2022
8c3cacd
Bump php-sdk to 5.8.1
supercid May 2, 2022
2f72bd8
Bump compile.sh Magento version
supercid May 3, 2022
ffb49e7
Cosmetics in Helper/Price
supercid May 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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