| 1 |
<?php |
| 2 |
/** |
| 3 |
* NullMcpErrorHandler class for handling MCP errors without logging. |
| 4 |
* |
| 5 |
* @package McpAdapter |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace WP\MCP\Infrastructure\ErrorHandling; |
| 11 |
|
| 12 |
/** |
| 13 |
* Class NullMcpErrorHandler |
| 14 |
* |
| 15 |
* This class handles MCP errors by doing nothing. It is used when no error handling is desired. |
| 16 |
* |
| 17 |
* @package WP\MCP\ErrorHandlers |
| 18 |
*/ |
| 19 |
class NullMcpErrorHandler implements Contracts\McpErrorHandlerInterface { |
| 20 |
|
| 21 |
/** |
| 22 |
* Log with context. |
| 23 |
* |
| 24 |
* This method does nothing and is used when no error handling is desired. |
| 25 |
* |
| 26 |
* @param string $message The log message. |
| 27 |
* @param array $context Additional context data. |
| 28 |
* @param string $type The type of log (e.g., 'error', 'info', etc.). Default is 'error'. |
| 29 |
* |
| 30 |
* @return void |
| 31 |
*/ |
| 32 |
public function log( string $message, array $context = array(), string $type = 'error' ): void { |
| 33 |
// Do nothing. |
| 34 |
} |
| 35 |
} |
| 36 |
|