From 3c802119ede202c4a8512ce90fa248e9b425f0a6 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 5 Oct 2024 12:04:14 +0800 Subject: [PATCH] cs-fix and fix tests --- src/SPC/util/GlobalEnvManager.php | 3 ++- tests/SPC/builder/BuilderTest.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/SPC/util/GlobalEnvManager.php b/src/SPC/util/GlobalEnvManager.php index 70893b94..9a30f8d0 100644 --- a/src/SPC/util/GlobalEnvManager.php +++ b/src/SPC/util/GlobalEnvManager.php @@ -24,8 +24,9 @@ class GlobalEnvManager /** * Initialize the environment variables * - * @param BuilderBase $builder Builder + * @param null|BuilderBase $builder Builder * @throws RuntimeException + * @throws WrongUsageException */ public static function init(?BuilderBase $builder = null): void { diff --git a/tests/SPC/builder/BuilderTest.php b/tests/SPC/builder/BuilderTest.php index 3dbdc845..fe46b785 100644 --- a/tests/SPC/builder/BuilderTest.php +++ b/tests/SPC/builder/BuilderTest.php @@ -102,7 +102,7 @@ class BuilderTest extends TestCase { if (file_exists(SOURCE_PATH . '/php-src/main/php_version.h')) { $file = SOURCE_PATH . '/php-src/main/php_version.h'; - $cnt = preg_match('/PHP_VERSION "(\d+\.\d+\.\d+)"/', $file, $match); + $cnt = preg_match('/PHP_VERSION "(\d+\.\d+\.\d+)"/', file_get_contents($file), $match); if ($cnt !== 0) { $this->assertEquals($match[1], $this->builder->getPHPVersion()); } else {