Skip to content

Commit 04781f9

Browse files
committed
Remove BC compat while switching to v0.3.0
1 parent 61f3062 commit 04781f9

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/Schema/JsonRpc/Error.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,9 @@ public static function forMethodNotFound(string $message, string|int $id = ''):
9191
return new self($id, self::METHOD_NOT_FOUND, $message);
9292
}
9393

94-
public static function forInvalidParams(string $message, string|int $id = '' /* mixed $data = null */): self
94+
public static function forInvalidParams(string $message, string|int $id = '', mixed $data = null): self
9595
{
96-
// $data parameter was added in 0.2.2 and will be default in 0.3.0
97-
$data = \func_get_args()[2] ?? null;
98-
99-
return new self($id, self::INVALID_PARAMS, $message, data: $data);
96+
return new self($id, self::INVALID_PARAMS, $message, $data);
10097
}
10198

10299
public static function forInternalError(string $message, string|int $id = ''): self

src/Server/Handler/Request/CallToolHandler.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ public function __construct(
4040
private readonly RegistryInterface $registry,
4141
private readonly ReferenceHandlerInterface $referenceHandler,
4242
private readonly LoggerInterface $logger = new NullLogger(),
43-
/* ?SchemaValidator $schemaValidator = null */
43+
?SchemaValidator $schemaValidator = null,
4444
) {
45-
// $schemaValidator parameter was added in 0.2.2 and will be default in 0.3.0
46-
$this->schemaValidator = \func_get_args()[3] ?? new SchemaValidator($logger);
45+
$this->schemaValidator = $schemaValidator ?? new SchemaValidator($logger);
4746
}
4847

4948
public function supports(Request $request): bool

0 commit comments

Comments
 (0)