Repository: LLPhant/LLPhant (PHP)

Issue:
Typos in Exceptions generate composer warnings
```
Class LLPhant\Exception\HttpExcetion located in C:/development/tool.politech-dynamics.de/vendor/theodo-group/llphant/src\Exception\HttpException.php does not comply with psr-4 autoloading standard. Skipping.
Class LLPhant\Exception\MissingParameterExcetion located in C:/development/tool.politech-dynamics.de/vendor/theodo-group/llphant/src\Exception\MissingParameterException.php does not comply with psr-4 autoloading standard. Skipping. 
```
Two Exception Classes are missspelled, this causes them to be non autoloadable 

 * HttpExcetion (Missing a p)
 * MissingParameterExcetion (Missing a p)

So they must be renamed so the autoloader can grab them and the composer does not warn. 


Discussion:

Patch:
diff --git a/src/Chat/OllamaChat.php b/src/Chat/OllamaChat.php
index 47cdaca7..e6750011 100644
--- a/src/Chat/OllamaChat.php
+++ b/src/Chat/OllamaChat.php
@@ -7,9 +7,9 @@
 use GuzzleHttp\Client;
 use GuzzleHttp\Psr7\Utils;
 use LLPhant\Chat\FunctionInfo\FunctionInfo;
-use LLPhant\Exception\HttpExcetion;
+use LLPhant\Exception\HttpException;
 use LLPhant\Exception\MissingFeatureException;
-use LLPhant\Exception\MissingParameterExcetion;
+use LLPhant\Exception\MissingParameterException;
 use LLPhant\OllamaConfig;
 use LLPhant\Utility;
 use Psr\Http\Message\ResponseInterface;
@@ -35,7 +35,7 @@ public function __construct(protected OllamaConfig $config)
     {
         $this->config = $config;
         if (! isset($config->model)) {
-            throw new MissingParameterExcetion('You need to specify a model for Ollama');
+            throw new MissingParameterException('You need to specify a model for Ollama');
         }
         $this->client = new Client([
             'base_uri' => $config->url,
@@ -189,7 +189,7 @@ protected function sendRequest(string $method, string $path, array $json): Respo
         $response = $this->client->request($method, $path, ['json' => $json]);
         $status = $response->getStatusCode();
         if ($status < 200 || $status >= 300) {
-            throw new HttpExcetion(sprintf(
+            throw new HttpException(sprintf(
                 'HTTP error from Ollama (%d): %s',
                 $status,
                 $response->getBody()->getContents()
diff --git a/src/Exception/HttpException.php b/src/Exception/HttpException.php
index ab8e5d9f..6733f101 100644
--- a/src/Exception/HttpException.php
+++ b/src/Exception/HttpException.php
@@ -6,6 +6,6 @@
 
 use Exception;
 
-class HttpExcetion extends Exception implements LLPhantException
+class HttpException extends Exception implements LLPhantException
 {
 }
diff --git a/src/Exception/MissingParameterException.php b/src/Exception/MissingParameterException.php
index e0316376..f8e88fb5 100644
--- a/src/Exception/MissingParameterException.php
+++ b/src/Exception/MissingParameterException.php
@@ -6,6 +6,6 @@
 
 use Exception;
 
-class MissingParameterExcetion extends Exception implements LLPhantException
+class MissingParameterException extends Exception implements LLPhantException
 {
 }


Test patch:
diff --git a/tests/Unit/Chat/OllamaChatTest.php b/tests/Unit/Chat/OllamaChatTest.php
index 21884988..6b1c5ae0 100644
--- a/tests/Unit/Chat/OllamaChatTest.php
+++ b/tests/Unit/Chat/OllamaChatTest.php
@@ -8,14 +8,14 @@
 use GuzzleHttp\Psr7\Response;
 use LLPhant\Chat\Message;
 use LLPhant\Chat\OllamaChat;
-use LLPhant\Exception\MissingParameterExcetion;
+use LLPhant\Exception\MissingParameterException;
 use LLPhant\OllamaConfig;
 use Psr\Http\Message\StreamInterface;
 
 it('error when construct with no model', function () {
     $config = new OllamaConfig();
     $chat = new OllamaChat($config);
-})->throws(MissingParameterExcetion::class, 'You need to specify a model for Ollama');
+})->throws(MissingParameterException::class, 'You need to specify a model for Ollama');
 
 it('no error when construct with model', function () {
     $config = new OllamaConfig();