Skip to content

Commit dd5bd7a

Browse files
refactor all the exceptions
1 parent 5c25b10 commit dd5bd7a

File tree

9 files changed

+44
-35
lines changed

9 files changed

+44
-35
lines changed

src/mate/README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ The Mate component provides an MCP (Model Context Protocol) server that enables
44
assistants to interact with PHP applications (including Symfony) through standardized
55
tools. This is a development tool, not intended for production use.
66

7-
**This Component is experimental**.
8-
[Experimental features](https://symfony.com/doc/current/contributing/code/experimental.html)
9-
are not covered by Symfony's
10-
[Backward Compatibility Promise](https://symfony.com/doc/current/contributing/code/bc.html).
11-
127
## Installation
138

149
```bash
@@ -20,7 +15,7 @@ https://github.com/symfony/ai to create issues or submit pull requests.
2015

2116
## Resources
2217

23-
- [Documentation](https://symfony.com/doc/current/ai/components/mate.html)
24-
- [Report issues](https://github.com/symfony/ai/issues) and
25-
[send Pull Requests](https://github.com/symfony/ai/pulls)
26-
in the [main Symfony AI repository](https://github.com/symfony/ai)
18+
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
19+
* [Report issues](https://github.com/symfony/ai/issues) and
20+
[send Pull Requests](https://github.com/symfony/ai/pulls)
21+
in the [main Symfony AI repository](https://github.com/symfony/ai)

src/mate/src/Bridge/Monolog/Exception/LogFileNotFoundException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
namespace Symfony\AI\Mate\Bridge\Monolog\Exception;
1313

14+
use Symfony\AI\Mate\Exception\InvalidArgumentException;
15+
1416
/**
1517
* @author Johannes Wachter <[email protected]>
1618
*
1719
* @internal
1820
*/
19-
class LogFileNotFoundException extends \InvalidArgumentException implements ExceptionInterface
21+
class LogFileNotFoundException extends InvalidArgumentException
2022
{
2123
public static function forPath(string $path): self
2224
{

src/mate/src/Bridge/Symfony/Exception/ExceptionInterface.php

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

src/mate/src/Bridge/Symfony/Exception/FileNotFoundException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
namespace Symfony\AI\Mate\Bridge\Symfony\Exception;
1313

14+
use Symfony\AI\Mate\Exception\InvalidArgumentException;
15+
1416
/**
1517
* @internal
1618
*
1719
* @author Tobias Nyholm <[email protected]>
1820
*/
19-
class FileNotFoundException extends \InvalidArgumentException implements ExceptionInterface
21+
class FileNotFoundException extends InvalidArgumentException
2022
{
2123
public static function forContainerXml(string $path): self
2224
{

src/mate/src/Bridge/Symfony/Exception/XmlContainerCouldNotBeLoadedException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
namespace Symfony\AI\Mate\Bridge\Symfony\Exception;
1313

14+
use Symfony\AI\Mate\Exception\InvalidArgumentException;
15+
1416
/**
1517
* @internal
1618
*
1719
* @author Tobias Nyholm <[email protected]>
1820
*/
19-
class XmlContainerCouldNotBeLoadedException extends \InvalidArgumentException implements ExceptionInterface
21+
class XmlContainerCouldNotBeLoadedException extends InvalidArgumentException
2022
{
2123
public static function forContainerDoesNotExist(string $path): self
2224
{
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\AI\Mate\Exception;
13+
14+
/**
15+
* Base exception class for invalid argument errors in the Mate component.
16+
*
17+
* @internal
18+
*
19+
* @author Johannes Wachter <[email protected]>
20+
*/
21+
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
22+
{
23+
}

src/mate/src/Exception/MissingDependencyException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @author Johannes Wachter <[email protected]>
1818
* @author Tobias Nyholm <[email protected]>
1919
*/
20-
class MissingDependencyException extends \RuntimeException implements ExceptionInterface
20+
class MissingDependencyException extends RuntimeException
2121
{
2222
public static function forDotenv(): self
2323
{

src/mate/src/Bridge/Monolog/Exception/ExceptionInterface.php renamed to src/mate/src/Exception/RuntimeException.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\AI\Mate\Bridge\Monolog\Exception;
12+
namespace Symfony\AI\Mate\Exception;
1313

1414
/**
15+
* Base exception class for runtime errors in the Mate component.
16+
*
17+
* @internal
18+
*
1519
* @author Johannes Wachter <[email protected]>
1620
*/
17-
interface ExceptionInterface extends \Throwable
21+
class RuntimeException extends \RuntimeException implements ExceptionInterface
1822
{
1923
}

src/mate/src/Exception/UnsupportedVersionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @author Johannes Wachter <[email protected]>
1818
* @author Tobias Nyholm <[email protected]>
1919
*/
20-
class UnsupportedVersionException extends \RuntimeException implements ExceptionInterface
20+
class UnsupportedVersionException extends RuntimeException
2121
{
2222
public static function forConsole(): self
2323
{

0 commit comments

Comments
 (0)