Skip to content

Commit

Permalink
fix: array_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
gabeta committed Mar 24, 2024
1 parent 02c9467 commit 6cee3d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -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}}
4 changes: 2 additions & 2 deletions src/GsmDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6cee3d5

Please sign in to comment.