@@ -74,7 +74,7 @@ public function getServiceClasses(): array {
7474 /**
7575 * Gets service definition.
7676 *
77- * @psalm-return array<string, string> |null
77+ * @psalm-return array{class: class- string} |null
7878 */
7979 public function getServiceDefinition (string $ service_id ): ?array {
8080 $ serialized_definitions = $ this ->getSerializedDefinitions ();
@@ -91,6 +91,7 @@ public function getServiceDefinition(string $service_id): ?array {
9191 * @todo Add extended description.
9292 */
9393 public function getServiceMeta (string $ service_id ): array {
94+ /** @psalm-suppress UnresolvableInclude */
9495 $ dumped_meta = require Application::ROOT . '/resources/service-meta.php ' ;
9596 // Most used core services are described statically.
9697 if (\array_key_exists ($ service_id , $ dumped_meta )) {
@@ -99,10 +100,11 @@ public function getServiceMeta(string $service_id): array {
99100 // For services from contrib and custom modules we build meta on demand.
100101 elseif ($ definition = $ this ->getServiceDefinition ($ service_id )) {
101102 $ class = $ definition ['class ' ];
103+ /** @psalm-var class-string $interface */
102104 $ interface = $ class . 'Interface ' ;
103105 $ meta = [
104106 'name ' => Utils::camelize ($ service_id , FALSE ),
105- 'type ' => \is_subclass_of ($ class , $ interface ) ? $ interface : $ class
107+ 'type ' => \is_subclass_of ($ class , $ interface ) ? $ interface : $ class,
106108 ];
107109 }
108110 else {
@@ -115,6 +117,7 @@ public function getServiceMeta(string $service_id): array {
115117 $ type_parts = \explode ('\\' , $ meta ['type ' ]);
116118 $ meta ['short_type ' ] = \end ($ type_parts );
117119
120+ \ksort ($ meta );
118121 return $ meta ;
119122 }
120123
0 commit comments