From 6cee3d5a76762a89ceac42e8112c837285d9036d Mon Sep 17 00:00:00 2001 From: Gabeta Soro Date: Sun, 24 Mar 2024 13:42:47 +0000 Subject: [PATCH] fix: array_merge --- .phpunit.result.cache | 1 + src/GsmDetector.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 0000000..45a0b0d --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +{"version":1,"defects":{"Gabeta\\GsmDetector\\Test\\GsmDetectorTest::test_is_gsm":4,"Gabeta\\GsmDetector\\Test\\GsmDetectorTest::test_is_gsm_name":4,"Gabeta\\GsmDetector\\Test\\GsmDetectorTest::test_get_gsm_name":4},"times":{"Gabeta\\GsmDetector\\Test\\GsmDetectorTest::test_is_gsm":0.001,"Gabeta\\GsmDetector\\Test\\GsmDetectorTest::test_is_gsm_with_type":0,"Gabeta\\GsmDetector\\Test\\GsmDetectorTest::test_is_gsm_name":0,"Gabeta\\GsmDetector\\Test\\GsmDetectorTest::test_is_gsm_name_with_type":0,"Gabeta\\GsmDetector\\Test\\GsmDetectorTest::test_get_gsm_name":0,"Gabeta\\GsmDetector\\Test\\GsmDetectorTest::test_is_type":0}} \ No newline at end of file diff --git a/src/GsmDetector.php b/src/GsmDetector.php index 81747f1..39ba1cb 100644 --- a/src/GsmDetector.php +++ b/src/GsmDetector.php @@ -83,7 +83,7 @@ public function isGsm($name, $value) { $gsmConfig = self::$config[$name]; - $prefix = call_user_func_array('array_merge', $gsmConfig); + $prefix = call_user_func_array('array_merge', array_values($gsmConfig)); return $this->hasValue($prefix, $value); } @@ -143,7 +143,7 @@ public function isType($value, $type) public function getGsmName($value) { foreach (self::$config as $key => $config) { - $prefix = call_user_func_array('array_merge', $config); + $prefix = call_user_func_array('array_merge', array_values($config)); if ($this->hasValue($prefix, $value)) { return $key;