Skip to content

Commit 52a4736

Browse files
committed
Php Stan Test
1 parent af83f9f commit 52a4736

File tree

13 files changed

+68
-56
lines changed

13 files changed

+68
-56
lines changed

src/Capability/Attribute/McpPrompt.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
final class McpPrompt
2222
{
2323
/**
24-
* @param ?string $name overrides the prompt name (defaults to method name)
25-
* @param ?string $description Optional description of the prompt. Defaults to method DocBlock summary.
26-
* @param ?array $_meta Optional metadata
24+
* @param ?string $name overrides the prompt name (defaults to method name)
25+
* @param ?string $description Optional description of the prompt. Defaults to method DocBlock summary.
26+
* @param ?array<string, mixed> $_meta Optional metadata
2727
*/
2828
public function __construct(
2929
public ?string $name = null,

src/Capability/Attribute/McpResource.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
final class McpResource
2424
{
2525
/**
26-
* @param string $uri The specific URI identifying this resource instance. Must be unique within the server.
27-
* @param ?string $name A human-readable name for this resource. If null, a default might be generated from the method name.
28-
* @param ?string $description An optional description of the resource. Defaults to class DocBlock summary.
29-
* @param ?string $mimeType the MIME type, if known and constant for this resource
30-
* @param ?int $size the size in bytes, if known and constant
31-
* @param Annotations|null $annotations optional annotations describing the resource
32-
* @param ?array $_meta optional metadata
26+
* @param string $uri The specific URI identifying this resource instance. Must be unique within the server.
27+
* @param ?string $name A human-readable name for this resource. If null, a default might be generated from the method name.
28+
* @param ?string $description An optional description of the resource. Defaults to class DocBlock summary.
29+
* @param ?string $mimeType the MIME type, if known and constant for this resource
30+
* @param ?int $size the size in bytes, if known and constant
31+
* @param Annotations|null $annotations optional annotations describing the resource
32+
* @param ?array<string, mixed> $_meta Optional metadata
3333
*/
3434
public function __construct(
3535
public string $uri,

src/Capability/Attribute/McpResourceTemplate.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
final class McpResourceTemplate
2424
{
2525
/**
26-
* @param string $uriTemplate the URI template string (RFC 6570)
27-
* @param ?string $name A human-readable name for the template type. If null, a default might be generated from the method name.
28-
* @param ?string $description Optional description. Defaults to class DocBlock summary.
29-
* @param ?string $mimeType optional default MIME type for matching resources
30-
* @param ?Annotations $annotations optional annotations describing the resource template
31-
* @param ?array $_meta optional metadata
26+
* @param string $uriTemplate the URI template string (RFC 6570)
27+
* @param ?string $name A human-readable name for the template type. If null, a default might be generated from the method name.
28+
* @param ?string $description Optional description. Defaults to class DocBlock summary.
29+
* @param ?string $mimeType optional default MIME type for matching resources
30+
* @param ?Annotations $annotations optional annotations describing the resource template
31+
* @param ?array<string, mixed> $_meta Optional metadata
3232
*/
3333
public function __construct(
3434
public string $uriTemplate,

src/Capability/Attribute/McpTool.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
class McpTool
2121
{
2222
/**
23-
* @param string|null $name The name of the tool (defaults to the method name)
24-
* @param string|null $description The description of the tool (defaults to the DocBlock/inferred)
25-
* @param ToolAnnotations|null $annotations Optional annotations describing tool behavior
26-
* @param ?array $_meta Optional metadata
23+
* @param string|null $name The name of the tool (defaults to the method name)
24+
* @param string|null $description The description of the tool (defaults to the DocBlock/inferred)
25+
* @param ToolAnnotations|null $annotations Optional annotations describing tool behavior
26+
* @param ?array<string, mixed> $_meta Optional metadata
2727
*/
2828
public function __construct(
2929
public ?string $name = null,

src/Capability/Registry/Loader/ArrayLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ final class ArrayLoader implements LoaderInterface
4545
* name: ?string,
4646
* description: ?string,
4747
* annotations: ?ToolAnnotations,
48+
* _meta: ?array<string, mixed>
4849
* }[] $tools
4950
* @param array{
5051
* handler: Handler,
@@ -54,6 +55,7 @@ final class ArrayLoader implements LoaderInterface
5455
* mimeType: ?string,
5556
* size: int|null,
5657
* annotations: ?Annotations,
58+
* _meta: ?array<string, mixed>
5759
* }[] $resources
5860
* @param array{
5961
* handler: Handler,
@@ -62,11 +64,13 @@ final class ArrayLoader implements LoaderInterface
6264
* description: ?string,
6365
* mimeType: ?string,
6466
* annotations: ?Annotations,
67+
* _meta: ?array<string, mixed>
6568
* }[] $resourceTemplates
6669
* @param array{
6770
* handler: Handler,
6871
* name: ?string,
6972
* description: ?string,
73+
* _meta: ?array<string, mixed>
7074
* }[] $prompts
7175
*/
7276
public function __construct(

src/Schema/Content/BlobResourceContents.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
class BlobResourceContents extends ResourceContents
2828
{
2929
/**
30-
* @param string $uri the URI of the resource or sub-resource
31-
* @param string|null $mimeType the MIME type of the resource or sub-resource
32-
* @param string $blob a base64-encoded string representing the binary data of the item
33-
* @param ?array $_meta Optional metadata
30+
* @param string $uri the URI of the resource or sub-resource
31+
* @param string|null $mimeType the MIME type of the resource or sub-resource
32+
* @param string $blob a base64-encoded string representing the binary data of the item
33+
* @param ?array<string, mixed> $_meta Optional metadata
3434
*/
3535
public function __construct(
3636
string $uri,
3737
?string $mimeType,
3838
public readonly string $blob,
39-
?array $_meta,
39+
?array $_meta = null,
4040
) {
4141
parent::__construct($uri, $mimeType, $_meta);
4242
}
@@ -57,15 +57,19 @@ public static function fromArray(array $data): self
5757
}
5858

5959
/**
60-
* @param resource $stream
61-
*/
60+
* @param resource $stream
61+
* @param ?array<string, mixed> $_meta Optional metadata
62+
* */
6263
public static function fromStream(string $uri, $stream, string $mimeType, ?array $_meta = null): self
6364
{
6465
$blob = stream_get_contents($stream);
6566

6667
return new self($uri, $mimeType, base64_encode($blob), $_meta);
6768
}
6869

70+
/**
71+
* @param ?array<string, mixed> $_meta Optional metadata
72+
* */
6973
public static function fromSplFileInfo(string $uri, \SplFileInfo $file, ?string $explicitMimeType = null, ?array $_meta = null): self
7074
{
7175
$mimeType = $explicitMimeType ?? mime_content_type($file->getPathname());

src/Schema/Content/ResourceContents.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
abstract class ResourceContents implements \JsonSerializable
2525
{
2626
/**
27-
* @param string $uri the URI of the resource or sub-resource
28-
* @param string|null $mimeType the MIME type of the resource or sub-resource
29-
* @param ?array $_meta Optional metadata
27+
* @param string $uri the URI of the resource or sub-resource
28+
* @param string|null $mimeType the MIME type of the resource or sub-resource
29+
* @param ?array<string, mixed> $_meta Optional metadata
3030
*/
3131
public function __construct(
3232
public readonly string $uri,

src/Schema/Content/TextResourceContents.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
class TextResourceContents extends ResourceContents
2828
{
2929
/**
30-
* @param string $uri the URI of the resource or sub-resource
31-
* @param string|null $mimeType the MIME type of the resource or sub-resource
32-
* @param string $text The text of the item. This must only be set if the item can actually be represented as text (not binary data).
33-
* @param ?array $_meta Optional metadata
30+
* @param string $uri the URI of the resource or sub-resource
31+
* @param string|null $mimeType the MIME type of the resource or sub-resource
32+
* @param string $text The text of the item. This must only be set if the item can actually be represented as text (not binary data).
33+
* @param ?array<string, mixed> $_meta Optional metadata
3434
*/
3535
public function __construct(
3636
string $uri,
3737
?string $mimeType,
3838
public readonly string $text,
39-
?array $_meta,
39+
?array $_meta = null,
4040
) {
4141
parent::__construct($uri, $mimeType, $_meta);
4242
}

src/Schema/Prompt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Prompt implements \JsonSerializable
3232
* @param string $name the name of the prompt or prompt template
3333
* @param string|null $description an optional description of what this prompt provides
3434
* @param PromptArgument[]|null $arguments A list of arguments for templating. Null if not a template.
35-
* @param array|null $_meta optional for additional metadata
35+
* @param ?array<string, mixed> $_meta Optional metadata
3636
*/
3737
public function __construct(
3838
public readonly string $name,

src/Schema/Resource.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ class Resource implements \JsonSerializable
4343
private const URI_PATTERN = '/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s]*$/';
4444

4545
/**
46-
* @param string $uri the URI of this resource
47-
* @param string $name A human-readable name for this resource. This can be used by clients to populate UI elements.
48-
* @param string|null $description A description of what this resource represents. This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
49-
* @param string|null $mimeType the MIME type of this resource, if known
50-
* @param Annotations|null $annotations optional annotations for the client
51-
* @param int|null $size The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
52-
* @param array|null $_meta optional for additional metadata
46+
* @param string $uri the URI of this resource
47+
* @param string $name A human-readable name for this resource. This can be used by clients to populate UI elements.
48+
* @param string|null $description A description of what this resource represents. This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
49+
* @param string|null $mimeType the MIME type of this resource, if known
50+
* @param Annotations|null $annotations optional annotations for the client
51+
* @param int|null $size The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
52+
* @param ?array<string, mixed> $_meta Optional metadata
5353
*
5454
* This can be used by Hosts to display file sizes and estimate context window usage
5555
*/

0 commit comments

Comments
 (0)