diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a67d1f43..41c7ab67 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,4 +1,3 @@ - name: PHP QA on: @@ -19,28 +18,30 @@ jobs: fail-fast: false matrix: php-version: ['7.4', '8.0', '8.1', '8.2', '8.3'] + # Sorted alphabetically to ease finding the desired run in the GitHub Workflow UI. project: [ 'Aws', 'Context/Swoole', + 'Instrumentation/CakePHP', + 'Instrumentation/CodeIgniter', 'Instrumentation/ExtAmqp', 'Instrumentation/ExtRdKafka', 'Instrumentation/Guzzle', 'Instrumentation/HttpAsyncClient', - 'Instrumentation/Slim', - 'Instrumentation/CakePHP', + 'Instrumentation/IO', + 'Instrumentation/Laravel', + 'Instrumentation/MongoDB', + 'Instrumentation/OpenAIPHP', + 'Instrumentation/PDO', + # Sort PSRs numerically. 'Instrumentation/Psr3', 'Instrumentation/Psr6', 'Instrumentation/Psr14', 'Instrumentation/Psr15', 'Instrumentation/Psr16', 'Instrumentation/Psr18', - 'Instrumentation/IO', - 'Instrumentation/PDO', + 'Instrumentation/Slim', 'Instrumentation/Symfony', - 'Instrumentation/OpenAIPHP', - 'Instrumentation/Laravel', - 'Instrumentation/MongoDB', - 'Instrumentation/CodeIgniter', 'Instrumentation/Yii', 'Logs/Monolog', 'Propagation/ServerTiming', @@ -49,7 +50,7 @@ jobs: 'ResourceDetectors/Container', 'Sampler/RuleBased', 'Shims/OpenTracing', - 'Symfony' + 'Symfony', ] exclude: - project: 'Instrumentation/Guzzle' diff --git a/src/Instrumentation/Laravel/src/Watchers/RedisCommand/Serializer.php b/src/Instrumentation/Laravel/src/Watchers/RedisCommand/Serializer.php index 9e76f7ce..a64c4081 100644 --- a/src/Instrumentation/Laravel/src/Watchers/RedisCommand/Serializer.php +++ b/src/Instrumentation/Laravel/src/Watchers/RedisCommand/Serializer.php @@ -69,6 +69,9 @@ public static function serializeCommand(string $command, array $params): string $paramsToSerialize[] = '[' . (count($params) - $paramsToSerializeNum) . ' other arguments]'; } + // In some cases (for example when using LUA scripts) arrays are valid parameters + $paramsToSerialize = array_map(function($param) { return is_array($param) ? json_encode($param) : $param; }, $paramsToSerialize); + return $command . ' ' . implode(' ', $paramsToSerialize); } } diff --git a/src/Instrumentation/Laravel/tests/Unit/Watches/RedisCommand/SerializerTest.php b/src/Instrumentation/Laravel/tests/Unit/Watches/RedisCommand/SerializerTest.php index 69c831f3..3749f65e 100644 --- a/src/Instrumentation/Laravel/tests/Unit/Watches/RedisCommand/SerializerTest.php +++ b/src/Instrumentation/Laravel/tests/Unit/Watches/RedisCommand/SerializerTest.php @@ -31,5 +31,8 @@ public function serializeCases(): iterable // Serialize all params yield ['DEL', ['param1', 'param2', 'param3', 'param4'], 'DEL param1 param2 param3 param4']; + + // Parameters of array type + yield ['EVAL', ['param1', 'param2', ['arg1', 'arg2']], 'EVAL param1 param2 ["arg1","arg2"]']; } }