From 0c8a1d2f0e8aec35571b84a8a8afa581ab89cd8d Mon Sep 17 00:00:00 2001 From: Bilge Date: Sat, 30 Mar 2024 10:42:16 +0000 Subject: [PATCH] Added forward compatibility for PHP 8.1+. Removed trailing whitespace from some files. --- bin/phpsdk_deps.bat | 1 - lib/php/libsdk/SDK/Config.php | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/phpsdk_deps.bat b/bin/phpsdk_deps.bat index b9345af..b507d0d 100644 --- a/bin/phpsdk_deps.bat +++ b/bin/phpsdk_deps.bat @@ -13,4 +13,3 @@ if "%PHP_SDK_PHP_CMD%"=="" ( call %PHP_SDK_PHP_CMD% %PHP_SDK_BIN_PATH%\phpsdk_deps.php %* exit /b %errorlevel% - diff --git a/lib/php/libsdk/SDK/Config.php b/lib/php/libsdk/SDK/Config.php index 89f3d8d..e73ccdb 100644 --- a/lib/php/libsdk/SDK/Config.php +++ b/lib/php/libsdk/SDK/Config.php @@ -197,7 +197,7 @@ public static function guessCurrentBranchName() : ?string } /* Try to figure out the branch. The worky scenarios are - - CWD is in php-src + - CWD is in php-src - phpize is on the path FIXME for the dev package, there should be a php-config utility */ @@ -230,12 +230,12 @@ public static function guessCurrentBranchName() : ?string /* Verify that we use an available branch name. Master has some version, but no dedicated series. For master, it rather makes sense to use master as branch name. */ - $git = trim(shell_exec("where git.exe")); + $git = trim((string)shell_exec("where git.exe")); if ($git && is_dir(".git")) { $cmd = "\"$git\" branch"; $ret = trim(shell_exec($cmd)); - if (preg_match_all(",\*\s+master,", $ret) > 0) { + if (preg_match_all(",\*\s+master,", $ret) > 0) { $branch = "master"; } } @@ -250,7 +250,7 @@ public static function getCurrentBranchName() : string $branch = self::guessCurrentBranchName(); self::setCurrentBranchName($branch); } - + return self::$currentBranchName; }/*}}}*/ @@ -313,7 +313,7 @@ public static function getCurrentBranchData() : array throw new Exception("Failed to find config with arch '" . self::getCurrentArchName() . "'"); } - return $ret; + return $ret; }/*}}}*/ public static function getSdkNugetFeedUrl() : string @@ -368,7 +368,7 @@ public static function getDepsLocalPath() : ?string self::setDepsLocalPath($tmp); } } - + if (NULL == self::$depsLocalPath) { $tmp = realpath("../deps"); if (is_dir($tmp)) {