@@ -68,11 +68,11 @@ public function formatResult(mixed $readResult, string $uri, ?string $mimeType =
6868 return [$ readResult ->resource ];
6969 }
7070
71- $ _meta = $ this ->schema ->_meta ;
71+ $ meta = $ this ->schema ->meta ;
7272
7373 if (\is_array ($ readResult )) {
7474 if (empty ($ readResult )) {
75- return [new TextResourceContents ($ uri , 'application/json ' , '[] ' , $ _meta )];
75+ return [new TextResourceContents ($ uri , 'application/json ' , '[] ' , $ meta )];
7676 }
7777
7878 $ allAreResourceContents = true ;
@@ -120,15 +120,15 @@ public function formatResult(mixed $readResult, string $uri, ?string $mimeType =
120120 if (\is_string ($ readResult )) {
121121 $ mimeType = $ mimeType ?? $ this ->guessMimeTypeFromString ($ readResult );
122122
123- return [new TextResourceContents ($ uri , $ mimeType , $ readResult , $ _meta )];
123+ return [new TextResourceContents ($ uri , $ mimeType , $ readResult , $ meta )];
124124 }
125125
126126 if (\is_resource ($ readResult ) && 'stream ' === get_resource_type ($ readResult )) {
127127 $ result = BlobResourceContents::fromStream (
128128 $ uri ,
129129 $ readResult ,
130130 $ mimeType ?? 'application/octet-stream ' ,
131- $ _meta
131+ $ meta
132132 );
133133
134134 @fclose ($ readResult );
@@ -139,21 +139,21 @@ public function formatResult(mixed $readResult, string $uri, ?string $mimeType =
139139 if (\is_array ($ readResult ) && isset ($ readResult ['blob ' ]) && \is_string ($ readResult ['blob ' ])) {
140140 $ mimeType = $ readResult ['mimeType ' ] ?? $ mimeType ?? 'application/octet-stream ' ;
141141
142- return [new BlobResourceContents ($ uri , $ mimeType , $ readResult ['blob ' ], $ _meta )];
142+ return [new BlobResourceContents ($ uri , $ mimeType , $ readResult ['blob ' ], $ meta )];
143143 }
144144
145145 if (\is_array ($ readResult ) && isset ($ readResult ['text ' ]) && \is_string ($ readResult ['text ' ])) {
146146 $ mimeType = $ readResult ['mimeType ' ] ?? $ mimeType ?? 'text/plain ' ;
147147
148- return [new TextResourceContents ($ uri , $ mimeType , $ readResult ['text ' ], $ _meta )];
148+ return [new TextResourceContents ($ uri , $ mimeType , $ readResult ['text ' ], $ meta )];
149149 }
150150
151151 if ($ readResult instanceof \SplFileInfo && $ readResult ->isFile () && $ readResult ->isReadable ()) {
152152 if ($ mimeType && str_contains (strtolower ($ mimeType ), 'text ' )) {
153- return [new TextResourceContents ($ uri , $ mimeType , file_get_contents ($ readResult ->getPathname ()), $ _meta )];
153+ return [new TextResourceContents ($ uri , $ mimeType , file_get_contents ($ readResult ->getPathname ()), $ meta )];
154154 }
155155
156- return [BlobResourceContents::fromSplFileInfo ($ uri , $ readResult , $ mimeType , $ _meta )];
156+ return [BlobResourceContents::fromSplFileInfo ($ uri , $ readResult , $ mimeType , $ meta )];
157157 }
158158
159159 if (\is_array ($ readResult )) {
@@ -162,7 +162,7 @@ public function formatResult(mixed $readResult, string $uri, ?string $mimeType =
162162 try {
163163 $ jsonString = json_encode ($ readResult , \JSON_THROW_ON_ERROR | \JSON_PRETTY_PRINT );
164164
165- return [new TextResourceContents ($ uri , $ mimeType , $ jsonString , $ _meta )];
165+ return [new TextResourceContents ($ uri , $ mimeType , $ jsonString , $ meta )];
166166 } catch (\JsonException $ e ) {
167167 throw new RuntimeException (\sprintf ('Failed to encode array as JSON for URI "%s": %s ' , $ uri , $ e ->getMessage ()));
168168 }
@@ -172,7 +172,7 @@ public function formatResult(mixed $readResult, string $uri, ?string $mimeType =
172172 $ jsonString = json_encode ($ readResult , \JSON_THROW_ON_ERROR | \JSON_PRETTY_PRINT );
173173 $ mimeType = $ mimeType ?? 'application/json ' ;
174174
175- return [new TextResourceContents ($ uri , $ mimeType , $ jsonString , $ _meta )];
175+ return [new TextResourceContents ($ uri , $ mimeType , $ jsonString , $ meta )];
176176 } catch (\JsonException $ e ) {
177177 throw new RuntimeException (\sprintf ('Failed to encode array as JSON for URI "%s": %s ' , $ uri , $ e ->getMessage ()));
178178 }
0 commit comments