Skip to content

Commit

Permalink
Merge branch 'release/2.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelstz committed Dec 7, 2022
2 parents 9dab3f2 + fe94aa7 commit 7f21824
Show file tree
Hide file tree
Showing 13 changed files with 2,155 additions and 3,736 deletions.
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ language: php

jobs:
include:
- php: 7.3
- php: 7.4
env:
- MAGENTO_VERSION=2.3.6 MAGENTO_EDITION=community ES_VERSION=6.8.8
- MAGENTO_VERSION=2.4.3 MAGENTO_EDITION=community ES_VERSION=7.16-amd64
- if: type != pull_request
php: 7.3
php: 7.4
env:
- MAGENTO_VERSION=2.3.6 MAGENTO_EDITION=enterprise ES_VERSION=6.8.8
- php: 7.3
- MAGENTO_VERSION=2.4.3 MAGENTO_EDITION=enterprise ES_VERSION=7.16-amd64
- php: 8.1
env:
- MAGENTO_VERSION=2.4.1 MAGENTO_EDITION=community ES_VERSION=7.6.2-amd64
- MAGENTO_VERSION=2.4.5 MAGENTO_EDITION=community ES_VERSION=7.17-amd64
- if: type != pull_request
php: 7.3
php: 8.1
env:
- MAGENTO_VERSION=2.4.1 MAGENTO_EDITION=enterprise ES_VERSION=7.6.2-amd64
- MAGENTO_VERSION=2.4.5 MAGENTO_EDITION=enterprise ES_VERSION=7.17-amd64

before_install:
- sudo service elasticsearch stop
Expand Down
9 changes: 9 additions & 0 deletions Block/Quicklink.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@
*/
class Quicklink extends Template
{
/**
* @var Template\Context
*/
private Template\Context $context;

/**
* @var array
*/
private array $data;

/**
* @var Data
*/
private Data $helper;

/**
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Changelog
All notable changes to this project will be documented in this file.

## [2.2.1] - Dec 07 2022

- 🐛 limit config and minor changes by @rangerz in https://github.com/rafaelstz/magento2-quicklink/pull/16
- 🐛 Avoid running it in development mode by @rafaelstz in https://github.com/rafaelstz/magento2-quicklink/pull/22
- 🤖 [Travis] Upgrade Magento 2.4.1 to 2.4.5 by @rafaelstz in https://github.com/rafaelstz/magento2-quicklink/pull/21
- ✨ Upgrade and test on M2.4.5 by @rafaelstz in https://github.com/rafaelstz/magento2-quicklink/pull/24
- 🐛 Ignoring `catalogsearch` by @rafaelstz in https://github.com/rafaelstz/magento2-quicklink/pull/23
- 🐛 PHPCS + Composer upgrade by @rafaelstz in https://github.com/rafaelstz/magento2-quicklink/pull/26

## [2.1.1] - May 27 2022

- 🐛 Support to Magento 2.4.4
Expand Down
23 changes: 12 additions & 11 deletions Model/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class Data extends AbstractHelper
/**
* Config paths for using throughout the code
*/
const XML_PATH_ACTIVE = 'quicklink/general/active';
const XML_PATH_TIMEOUT = 'quicklink/general/timeout';
const XML_PATH_REQUEST_LIMIT = 'quicklink/general/request_limit';
const XML_PATH_CONCURRENCY_LIMIT = 'quicklink/general/concurrency_limit';
const XML_PATH_PRIORITY = 'quicklink/general/priority';
const XML_PATH_DEVELOPER_MODE = 'quicklink/general/developer_mode';
public const XML_PATH_ACTIVE = 'quicklink/general/active';
public const XML_PATH_TIMEOUT = 'quicklink/general/timeout';
public const XML_PATH_REQUEST_LIMIT = 'quicklink/general/request_limit';
public const XML_PATH_CONCURRENCY_LIMIT = 'quicklink/general/concurrency_limit';
public const XML_PATH_PRIORITY = 'quicklink/general/priority';
public const XML_PATH_DEVELOPER_MODE = 'quicklink/general/developer_mode';

/**
* Get config
Expand Down Expand Up @@ -81,22 +81,23 @@ public function getPriority(): mixed
/**
* Whether Quicklink is ready to use
*
* @deprecated 2.2.0
* @param null $store
* @param int|string|null $store
* @return bool
* @deprecated 2.2.0
* @see Rafaelcg/Quicklink/view/frontend/layout/default.xml
*/
public function isQuicklinkEnabled($store = null): bool
public function isQuicklinkEnabled(int|string $store = null): bool
{
return $this->scopeConfig->isSetFlag(self::XML_PATH_ACTIVE, ScopeInterface::SCOPE_STORE, $store);
}

/**
* Check if you can run it in developer mode
*
* @param null $store
* @param int|string|null $store
* @return bool
*/
public function runInDeveloperMode($store = null): bool
public function runInDeveloperMode(int|string $store = null): bool
{
return $this->scopeConfig->isSetFlag(self::XML_PATH_DEVELOPER_MODE, ScopeInterface::SCOPE_STORE, $store);
}
Expand Down
9 changes: 9 additions & 0 deletions ViewModel/Quicklink.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Quicklink implements ArgumentInterface

/**
* Quicklink constructor.
*
* @param Data $helper
*/
public function __construct(
Expand All @@ -27,6 +28,8 @@ public function __construct(
}

/**
* Get timeout before cancelling the request
*
* @return string
*/
public function getTimeout()
Expand All @@ -36,6 +39,8 @@ public function getTimeout()
}

/**
* Get the maximum number of requests to be made
*
* @return string
*/
public function getLimit()
Expand All @@ -45,6 +50,8 @@ public function getLimit()
}

/**
* Get the maximum number of requests to be made at the same time
*
* @return string
*/
public function getConcurrencyLimit()
Expand All @@ -54,6 +61,8 @@ public function getConcurrencyLimit()
}

/**
* Get the priority of the request
*
* @return string
*/
public function getPriority()
Expand Down
17 changes: 11 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "rafaelcg/magento2-quicklink",
"description": "Faster subsequent page-loads by prefetching in-viewport links during idle time",
"homepage": "https://github.com/rafaelstz/magento2-quicklink",
"version": "2.2.0",
"version": "2.2.1",
"require": {
"php": "~7.4.0||~8.1.0",
"magento/framework": "~103.0.0||~104.0.0"
},
"require-dev": {
"magento/magento-coding-standard": "^5.0",
"magento/magento-coding-standard": "^27",
"friendsofphp/php-cs-fixer": "^2.2.0",
"phpmd/phpmd": "^2.6",
"phpcompatibility/php-compatibility": "*",
Expand Down Expand Up @@ -50,15 +50,20 @@
},
"scripts": {
"post-install-cmd": [
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)",
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility"
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility",
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/,../../phpcompatibility/php-compatibility)"
],
"post-update-cmd": [
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)",
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility"
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility",
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/,../../phpcompatibility/php-compatibility)"
],
"php": "vendor/bin/phpcs -p . --standard=PHPCompatibility --extensions=php,phtml --ignore=vendor -d memory_limit=-1",
"lint": "vendor/bin/phpcs --standard=Magento2 --ignore=vendor .",
"fix": "vendor/bin/phpcbf --standard=Magento2 --ignore=vendor ."
},
"config": {
"allow-plugins": {
"magento/composer-dependency-version-audit-plugin": true
}
}
}
Loading

0 comments on commit 7f21824

Please sign in to comment.