Skip to content

Commit 0eecd64

Browse files
committed
Resolved conflict
1 parent e21a81d commit 0eecd64

File tree

12 files changed

+39
-298
lines changed

12 files changed

+39
-298
lines changed

examples/stdio-discovery-calculator/McpElements.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,18 @@ final class McpElements
3232

3333
public function __construct(
3434
private readonly LoggerInterface $logger = new NullLogger(),
35-
) {}
35+
) {
36+
}
3637

3738
/**
3839
* Performs a calculation based on the operation.
3940
*
4041
* Supports 'add', 'subtract', 'multiply', 'divide'.
4142
* Obeys the 'precision' and 'allow_negative' settings from the config resource.
4243
*
43-
* @param float $a the first operand
44-
* @param float $b the second operand
45-
* @param string $operation the operation ('add', 'subtract', 'multiply', 'divide')
44+
* @param float $a the first operand
45+
* @param float $b the second operand
46+
* @param string $operation the operation ('add', 'subtract', 'multiply', 'divide')
4647
* @param ClientLogger $logger Auto-injected MCP logger
4748
*
4849
* @return float|string the result of the calculation, or an error message string
@@ -130,8 +131,8 @@ public function getConfiguration(ClientLogger $logger): array
130131
* Updates a specific configuration setting.
131132
* Note: This requires more robust validation in a real app.
132133
*
133-
* @param string $setting the setting key ('precision' or 'allow_negative')
134-
* @param mixed $value the new value (int for precision, bool for allow_negative)
134+
* @param string $setting the setting key ('precision' or 'allow_negative')
135+
* @param mixed $value the new value (int for precision, bool for allow_negative)
135136
* @param ClientLogger $logger Auto-injected MCP logger
136137
*
137138
* @return array{
@@ -195,6 +196,6 @@ public function updateSetting(string $setting, mixed $value, ClientLogger $logge
195196
]);
196197

197198
// $registry->notifyResourceChanged('config://calculator/settings');
198-
return ['success' => true, 'message' => 'Allow negative results set to ' . ($value ? 'true' : 'false') . '.'];
199+
return ['success' => true, 'message' => 'Allow negative results set to '.($value ? 'true' : 'false').'.'];
199200
}
200201
}

examples/stdio-discovery-calculator/server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13-
require_once dirname(__DIR__) . '/bootstrap.php';
13+
require_once dirname(__DIR__).'/bootstrap.php';
1414
chdir(__DIR__);
1515

1616
use Mcp\Server;

examples/stdio-logging-showcase/LoggingShowcaseHandlers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ final class LoggingShowcaseHandlers
2525
/**
2626
* Tool that demonstrates different logging levels with auto-injected ClientLogger.
2727
*
28-
* @param string $message The message to log
29-
* @param string $level The logging level (debug, info, warning, error)
28+
* @param string $message The message to log
29+
* @param string $level The logging level (debug, info, warning, error)
3030
* @param ClientLogger $logger Auto-injected MCP logger
3131
*
3232
* @return array<string, mixed>

examples/stdio-logging-showcase/server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13-
require_once dirname(__DIR__) . '/bootstrap.php';
13+
require_once dirname(__DIR__).'/bootstrap.php';
1414
chdir(__DIR__);
1515

1616
use Mcp\Server;

src/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace Mcp;
1313

1414
use Mcp\Server\Builder;
15-
use Mcp\Server\Protocol;
1615
use Mcp\Server\NotificationSender;
16+
use Mcp\Server\Protocol;
1717
use Mcp\Server\Transport\TransportInterface;
1818
use Psr\Log\LoggerInterface;
1919
use Psr\Log\NullLogger;

src/Server/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
use Mcp\Schema\ToolAnnotations;
3939
use Mcp\Server;
4040
use Mcp\Server\Handler\Notification\NotificationHandlerInterface;
41-
use Mcp\Server\Handler\Request\RequestHandlerInterface;
4241
use Mcp\Server\Handler\NotificationHandler;
42+
use Mcp\Server\Handler\Request\RequestHandlerInterface;
4343
use Mcp\Server\Handler\Request\SetLogLevelHandler;
4444
use Mcp\Server\Session\InMemorySessionStore;
4545
use Mcp\Server\Session\SessionFactory;

src/Server/Handler/JsonRpcHandler.php

Lines changed: 0 additions & 258 deletions
This file was deleted.

src/Server/Handler/Request/SetLogLevelHandler.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
namespace Mcp\Server\Handler\Request;
1313

1414
use Mcp\Capability\Registry\ReferenceRegistryInterface;
15-
use Mcp\Schema\JsonRpc\HasMethodInterface;
15+
use Mcp\Schema\JsonRpc\Request;
1616
use Mcp\Schema\JsonRpc\Response;
1717
use Mcp\Schema\Request\SetLogLevelRequest;
1818
use Mcp\Schema\Result\EmptyResult;
19-
use Mcp\Server\Handler\MethodHandlerInterface;
2019
use Mcp\Server\Session\SessionInterface;
2120
use Psr\Log\LoggerInterface;
2221

@@ -28,20 +27,20 @@
2827
*
2928
* @author Adam Jamiu <jamiuadam120@gmail.com>
3029
*/
31-
final class SetLogLevelHandler implements MethodHandlerInterface
30+
final class SetLogLevelHandler implements RequestHandlerInterface
3231
{
3332
public function __construct(
3433
private readonly ReferenceRegistryInterface $registry,
3534
private readonly LoggerInterface $logger,
3635
) {
3736
}
3837

39-
public function supports(HasMethodInterface $message): bool
38+
public function supports(Request $message): bool
4039
{
4140
return $message instanceof SetLogLevelRequest;
4241
}
4342

44-
public function handle(SetLogLevelRequest|HasMethodInterface $message, SessionInterface $session): Response
43+
public function handle(Request $message, SessionInterface $session): Response
4544
{
4645
\assert($message instanceof SetLogLevelRequest);
4746

tests/Unit/Capability/Discovery/SchemaGeneratorFixture.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ public function parameterSchemaInferredType(
416416
/**
417417
* Method with ClientLogger that should be excluded from schema.
418418
*
419-
* @param string $message The message to process
420-
* @param \Mcp\Capability\Logger\ClientLogger $logger Auto-injected logger
419+
* @param string $message The message to process
420+
* @param \Mcp\Capability\Logger\ClientLogger $logger Auto-injected logger
421421
*/
422422
public function withClientLogger(string $message, \Mcp\Capability\Logger\ClientLogger $logger): string
423423
{

0 commit comments

Comments
 (0)