From da6ad5b966ec8b4b26d23217f0481a4ab21e897c Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 Jun 2020 14:40:02 +0700 Subject: [PATCH 1/2] Clean code --- Block/Adminhtml/Checklist.php | 4 ++-- Helper/Data.php | 4 ++-- composer.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Block/Adminhtml/Checklist.php b/Block/Adminhtml/Checklist.php index ba21f90..85b717c 100644 --- a/Block/Adminhtml/Checklist.php +++ b/Block/Adminhtml/Checklist.php @@ -136,14 +136,14 @@ public function checkLatestVersion() $arr = json_decode($releases); $versionArr = []; foreach ($arr as $ver => $item) { - list($major, $minor, $patch) = explode('.', $ver); + [$major, $minor, $patch] = explode('.', $ver); if ($major == 2) { $versionArr[$major . '.' . $minor][] = $ver; } } $currentVersion = $this->_metadata->getVersion(); - list($currentMajor, $currentMinor, $currentPatch) = explode('.', $currentVersion); + [$currentMajor, $currentMinor, $currentPatch] = explode('.', $currentVersion); $latestVer = $currentVersion; foreach ($versionArr[$currentMajor . '.' . $currentMinor] as $version) { if (version_compare($latestVer, $version, '<')) { diff --git a/Helper/Data.php b/Helper/Data.php index 1b91317..acd15cc 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -89,14 +89,14 @@ public function checkIp($ip, $range) if (strpos($range, '*') !== false) { $low = $high = $range; if (strpos($range, '-') !== false) { - list($low, $high) = explode('-', $range, 2); + [$low, $high] = explode('-', $range, 2); } $low = str_replace('*', '0', $low); $high = str_replace('*', '255', $high); $range = $low . '-' . $high; } if (strpos($range, '-') !== false) { - list($low, $high) = explode('-', $range, 2); + [$low, $high] = explode('-', $range, 2); return $this->ipCompare($ip, $low, 1) && $this->ipcompare($ip, $high, -1); } diff --git a/composer.json b/composer.json index 6ec7ff0..5518e43 100644 --- a/composer.json +++ b/composer.json @@ -2,13 +2,13 @@ "name": "mageplaza/module-security", "description": "Mageplaza Security Extension", "require": { - "mageplaza/module-core": "^1.4.4", + "mageplaza/module-core": "^1.4.5", "mageplaza/module-google-recaptcha": "^1.0.2", "mageplaza/module-two-factor-authentication": "^1.0.0", "sinergi/browser-detector": "*" }, "type": "magento2-module", - "version": "1.1.5", + "version": "1.1.6", "license": "proprietary", "authors": [ { From 8ce602480cbfe0eebf9cc3fce4e04e56b9c10709 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 Jun 2020 14:43:54 +0700 Subject: [PATCH 2/2] Clean code --- Block/Adminhtml/Checklist.php | 4 ++-- Helper/Data.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Block/Adminhtml/Checklist.php b/Block/Adminhtml/Checklist.php index 85b717c..ba21f90 100644 --- a/Block/Adminhtml/Checklist.php +++ b/Block/Adminhtml/Checklist.php @@ -136,14 +136,14 @@ public function checkLatestVersion() $arr = json_decode($releases); $versionArr = []; foreach ($arr as $ver => $item) { - [$major, $minor, $patch] = explode('.', $ver); + list($major, $minor, $patch) = explode('.', $ver); if ($major == 2) { $versionArr[$major . '.' . $minor][] = $ver; } } $currentVersion = $this->_metadata->getVersion(); - [$currentMajor, $currentMinor, $currentPatch] = explode('.', $currentVersion); + list($currentMajor, $currentMinor, $currentPatch) = explode('.', $currentVersion); $latestVer = $currentVersion; foreach ($versionArr[$currentMajor . '.' . $currentMinor] as $version) { if (version_compare($latestVer, $version, '<')) { diff --git a/Helper/Data.php b/Helper/Data.php index acd15cc..1b91317 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -89,14 +89,14 @@ public function checkIp($ip, $range) if (strpos($range, '*') !== false) { $low = $high = $range; if (strpos($range, '-') !== false) { - [$low, $high] = explode('-', $range, 2); + list($low, $high) = explode('-', $range, 2); } $low = str_replace('*', '0', $low); $high = str_replace('*', '255', $high); $range = $low . '-' . $high; } if (strpos($range, '-') !== false) { - [$low, $high] = explode('-', $range, 2); + list($low, $high) = explode('-', $range, 2); return $this->ipCompare($ip, $low, 1) && $this->ipcompare($ip, $high, -1); }