6
6
use function array_map ;
7
7
use function hash ;
8
8
use function serialize ;
9
+ use function sort ;
9
10
10
11
final class SymfonyContainerResultCacheMetaExtension implements ResultCacheMetaExtension
11
12
{
@@ -29,20 +30,32 @@ public function getHash(): string
29
30
{
30
31
return hash ('sha256 ' , serialize ([
31
32
'parameters ' => array_map (
32
- static fn (ParameterDefinition $ parameter ) => [
33
+ static fn (ParameterDefinition $ parameter ): array => [
33
34
'name ' => $ parameter ->getKey (),
34
35
'value ' => $ parameter ->getValue (),
35
36
],
36
37
$ this ->parameterMap ->getParameters (),
37
38
),
38
39
'services ' => array_map (
39
- static fn (ServiceDefinition $ service ) => [
40
- 'id ' => $ service ->getId (),
41
- 'class ' => $ service ->getClass (),
42
- 'public ' => $ service ->isPublic () ? 'yes ' : 'no ' ,
43
- 'synthetic ' => $ service ->isSynthetic () ? 'yes ' : 'no ' ,
44
- 'alias ' => $ service ->getAlias (),
45
- ],
40
+ static function (ServiceDefinition $ service ): array {
41
+ $ serviceTags = array_map (
42
+ static fn (ServiceTag $ tag ) => [
43
+ 'name ' => $ tag ->getName (),
44
+ 'attributes ' => $ tag ->getAttributes (),
45
+ ],
46
+ $ service ->getTags (),
47
+ );
48
+ sort ($ serviceTags );
49
+
50
+ return [
51
+ 'id ' => $ service ->getId (),
52
+ 'class ' => $ service ->getClass (),
53
+ 'public ' => $ service ->isPublic () ? 'yes ' : 'no ' ,
54
+ 'synthetic ' => $ service ->isSynthetic () ? 'yes ' : 'no ' ,
55
+ 'alias ' => $ service ->getAlias (),
56
+ 'tags ' => $ serviceTags ,
57
+ ];
58
+ },
46
59
$ this ->serviceMap ->getServices (),
47
60
),
48
61
]));
0 commit comments