Skip to content

Commit

Permalink
Add support for arm64 machine type (#271)
Browse files Browse the repository at this point in the history
* Add support for arm64 machine type

This patch adds support for Apple M2 Pro

Fixes: #270

* Fix CI errors

Fixes: #270

* Remove obsolete comment

Fixes: #270
  • Loading branch information
peterkraume authored May 26, 2023
1 parent a413d8c commit f81b62b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
7 changes: 0 additions & 7 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/EditorconfigChecker/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use EditorconfigChecker\Utilities;

define('CORE_VERSION', '2.3.5');
define('CORE_VERSION', '2.7.0');

class Cli
{
Expand Down
7 changes: 3 additions & 4 deletions src/EditorconfigChecker/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -79,8 +79,7 @@ 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' && version_compare(CORE_VERSION, '2.6.0', '<')) {
if (self::getCurrentOs() === 'windows') {
$releaseSuffix = '.exe.tar.gz';
}
$releaseUrl = sprintf(
Expand Down

0 comments on commit f81b62b

Please sign in to comment.