From 08bd9b83c48571a9be27daf607a17f2e1d82806d Mon Sep 17 00:00:00 2001 From: Peter Kraume Date: Fri, 12 May 2023 09:07:16 +0200 Subject: [PATCH 1/3] Add support for arm64 machine type This patch adds support for Apple M2 Pro Fixes: #270 --- src/EditorconfigChecker/Cli.php | 2 +- src/EditorconfigChecker/Utilities.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EditorconfigChecker/Cli.php b/src/EditorconfigChecker/Cli.php index 5175e12..a9cc945 100644 --- a/src/EditorconfigChecker/Cli.php +++ b/src/EditorconfigChecker/Cli.php @@ -4,7 +4,7 @@ use EditorconfigChecker\Utilities; -define('CORE_VERSION', '2.3.5'); +define('CORE_VERSION', '2.7.0'); class Cli { diff --git a/src/EditorconfigChecker/Utilities.php b/src/EditorconfigChecker/Utilities.php index f958142..3fdbbad 100644 --- a/src/EditorconfigChecker/Utilities.php +++ b/src/EditorconfigChecker/Utilities.php @@ -12,12 +12,12 @@ public static function getCurrentArch(): string $arch = php_uname('m'); switch ($arch) { - case 'AMD64': - return "amd64"; case 'x86_64': + case 'AMD64': return "amd64"; case 'i386': return "386"; + case 'arm64': case 'aarch64': return "arm64"; default: From 2babd54756f2fb875e5ef61299ce0c6657bb3f7f Mon Sep 17 00:00:00 2001 From: Peter Kraume Date: Wed, 17 May 2023 08:42:13 +0200 Subject: [PATCH 2/3] Fix CI errors Fixes: #270 --- phpstan.neon.dist | 7 ------- src/EditorconfigChecker/Utilities.php | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 1dfa542..735cc3e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -9,10 +9,3 @@ parameters: checkMissingCallableSignature: true checkUninitializedProperties: true checkTooWideReturnTypesInProtectedAndPublicMethods: true - - ignoreErrors: - - - # CORE_VERSION constant may change in the future - message: '~Right side of && is always true~' - path: 'src/EditorconfigChecker/Utilities.php' - count: 1 diff --git a/src/EditorconfigChecker/Utilities.php b/src/EditorconfigChecker/Utilities.php index 3fdbbad..3634b34 100644 --- a/src/EditorconfigChecker/Utilities.php +++ b/src/EditorconfigChecker/Utilities.php @@ -80,7 +80,7 @@ public static function downloadReleaseArchive(string $releaseName, string $versi $releaseSuffix = '.tar.gz'; // Windows release archive suffix changed from 2.5 to 2.6 - if (self::getCurrentOs() === 'windows' && version_compare(CORE_VERSION, '2.6.0', '<')) { + if (self::getCurrentOs() === 'windows') { $releaseSuffix = '.exe.tar.gz'; } $releaseUrl = sprintf( From 2111d336b644961abc14e4082a6cedefdb058b42 Mon Sep 17 00:00:00 2001 From: Peter Kraume Date: Fri, 19 May 2023 08:24:12 +0200 Subject: [PATCH 3/3] Remove obsolete comment Fixes: #270 --- src/EditorconfigChecker/Utilities.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/EditorconfigChecker/Utilities.php b/src/EditorconfigChecker/Utilities.php index 3634b34..f631b1b 100644 --- a/src/EditorconfigChecker/Utilities.php +++ b/src/EditorconfigChecker/Utilities.php @@ -79,7 +79,6 @@ public static function downloadReleaseArchive(string $releaseName, string $versi $archivePath = sprintf('%s/%s.tar.gz', Utilities::getBasePath(), $releaseName); $releaseSuffix = '.tar.gz'; - // Windows release archive suffix changed from 2.5 to 2.6 if (self::getCurrentOs() === 'windows') { $releaseSuffix = '.exe.tar.gz'; }