Skip to content

Commit 1a1daa0

Browse files
Merge remote-tracking branch 'upstream/main' into spi/laravel
2 parents a3cf950 + 0a41216 commit 1a1daa0

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

.github/workflows/php.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: PHP QA
32

43
on:
@@ -19,28 +18,30 @@ jobs:
1918
fail-fast: false
2019
matrix:
2120
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
21+
# Sorted alphabetically to ease finding the desired run in the GitHub Workflow UI.
2222
project: [
2323
'Aws',
2424
'Context/Swoole',
25+
'Instrumentation/CakePHP',
26+
'Instrumentation/CodeIgniter',
2527
'Instrumentation/ExtAmqp',
2628
'Instrumentation/ExtRdKafka',
2729
'Instrumentation/Guzzle',
2830
'Instrumentation/HttpAsyncClient',
29-
'Instrumentation/Slim',
30-
'Instrumentation/CakePHP',
31+
'Instrumentation/IO',
32+
'Instrumentation/Laravel',
33+
'Instrumentation/MongoDB',
34+
'Instrumentation/OpenAIPHP',
35+
'Instrumentation/PDO',
36+
# Sort PSRs numerically.
3137
'Instrumentation/Psr3',
3238
'Instrumentation/Psr6',
3339
'Instrumentation/Psr14',
3440
'Instrumentation/Psr15',
3541
'Instrumentation/Psr16',
3642
'Instrumentation/Psr18',
37-
'Instrumentation/IO',
38-
'Instrumentation/PDO',
43+
'Instrumentation/Slim',
3944
'Instrumentation/Symfony',
40-
'Instrumentation/OpenAIPHP',
41-
'Instrumentation/Laravel',
42-
'Instrumentation/MongoDB',
43-
'Instrumentation/CodeIgniter',
4445
'Instrumentation/Yii',
4546
'Logs/Monolog',
4647
'Propagation/ServerTiming',
@@ -49,7 +50,7 @@ jobs:
4950
'ResourceDetectors/Container',
5051
'Sampler/RuleBased',
5152
'Shims/OpenTracing',
52-
'Symfony'
53+
'Symfony',
5354
]
5455
exclude:
5556
- project: 'Instrumentation/Guzzle'

src/Instrumentation/Laravel/src/Watchers/RedisCommand/Serializer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ public static function serializeCommand(string $command, array $params): string
6969
$paramsToSerialize[] = '[' . (count($params) - $paramsToSerializeNum) . ' other arguments]';
7070
}
7171

72+
// In some cases (for example when using LUA scripts) arrays are valid parameters
73+
$paramsToSerialize = array_map(function($param) { return is_array($param) ? json_encode($param) : $param; }, $paramsToSerialize);
74+
7275
return $command . ' ' . implode(' ', $paramsToSerialize);
7376
}
7477
}

src/Instrumentation/Laravel/tests/Unit/Watches/RedisCommand/SerializerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@ public function serializeCases(): iterable
3131

3232
// Serialize all params
3333
yield ['DEL', ['param1', 'param2', 'param3', 'param4'], 'DEL param1 param2 param3 param4'];
34+
35+
// Parameters of array type
36+
yield ['EVAL', ['param1', 'param2', ['arg1', 'arg2']], 'EVAL param1 param2 ["arg1","arg2"]'];
3437
}
3538
}

0 commit comments

Comments
 (0)