Skip to content

Commit

Permalink
Merge pull request #31 from Planetbiru/feature/2.5
Browse files Browse the repository at this point in the history
Feature/2.5
  • Loading branch information
kamshory authored Nov 6, 2024
2 parents ef00e68 + 0a3ba09 commit fa25371
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/Database/PicoTableInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public function getPackage()
*
* @return self
*/
public function setPackage(string $package)
public function setPackage($package)
{
$this->package = $package;

Expand Down
8 changes: 5 additions & 3 deletions src/Exceptions/ClassNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
/**
* Class ClassNotFoundException
*
* Custom exception class for handling scenarios where a result is expected
* but none is returned. This can be useful for database queries or API calls
* where a missing result should be treated as an exceptional case.
* Custom exception class for handling scenarios where a class could not be found.
* This exception is typically thrown when attempting to use or instantiate a class
* that does not exist or is not autoloaded properly.
* It can be used in situations such as when a class name is misspelled,
* or the class file is not found in the expected location.
*
* @author Kamshory
* @package MagicObject\Exceptions
Expand Down
11 changes: 8 additions & 3 deletions src/Exceptions/CurlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
/**
* Class CurlException
*
* Custom exception class for handling scenarios where a result is expected
* but none is returned. This can be useful for database queries or API calls
* where a missing result should be treated as an exceptional case.
* Custom exception class for handling errors related to cURL operations.
* This exception is typically thrown when there is an issue with a cURL request,
* such as network failure, timeouts, or invalid responses from the server.
*
* The `CurlException` class allows you to capture and manage errors related to
* cURL requests, providing detailed information about the error message, code,
* and the previous exception if any. It extends the built-in `Exception` class,
* and can be caught and handled just like any other exception in PHP.
*
* @author Kamshory
* @package MagicObject\Exceptions
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/EntityException.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class EntityException extends Exception
* @param int $code Exception code
* @param Throwable|null $previous Previous exception
*/
public function __construct(string $message, int $code = 0, Throwable $previous = null)
public function __construct($message, $code = 0, $previous = null)
{
parent::__construct($message, $code, $previous);
$this->previous = $previous;
Expand Down
8 changes: 5 additions & 3 deletions src/Exceptions/ErrorConnectionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
/**
* Class ErrorConnectionException
*
* Custom exception class for handling scenarios where a result is expected
* but none is returned. This can be useful for database queries or API calls
* where a missing result should be treated as an exceptional case.
* Custom exception class for handling errors related to connection issues.
* This exception is typically thrown when a connection attempt to a remote service,
* database, or external resource fails. It can be used in scenarios where the system
* expects a successful connection but encounters issues, such as timeouts, server
* unavailability, or invalid credentials.
*
* @author Kamshory
* @package MagicObject\Exceptions
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/FileNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FileNotFoundException extends Exception
* @param int $code Exception code
* @param Throwable|null $previous Previous exception
*/
public function __construct(string $message, int $code = 0, Throwable $previous = null)
public function __construct($message, $code = 0, $previous = null)
{
parent::__construct($message, $code, $previous);
$this->previous = $previous;
Expand Down
21 changes: 15 additions & 6 deletions src/Exceptions/InvalidQueryInputException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@

/**
* Class InvalidQueryInputException
*
* Custom exception class for handling errors related to invalid query inputs.
* This exception can be thrown when a database query receives inputs that
* do not conform to expected formats or constraints, such as invalid data types,
* missing required parameters, or malformed query structures. It is useful
* in scenarios involving database interactions or data retrieval processes.
*
* Thrown when there is an error with the format of annotation attributes applied to a class, property, or method.
*
* This exception is triggered when annotations provided in the code do not meet the expected format or structure.
* Common scenarios for throwing this exception include:
* - Malformed annotation values.
* - Missing required parameters in annotations.
* - Incorrect application of annotations to classes, properties, or methods that do not support them.
*
* Example scenarios where this exception may be used:
* - A class is annotated with an unsupported attribute or a malformed annotation.
* - A property is annotated with an incorrect attribute that does not conform to the expected format.
* - A method receives an unsupported or malformed annotation, resulting in a failure during runtime or reflection processing.
*
* This exception is useful for catching annotation-related errors early in the code execution, allowing developers to quickly address any misconfigurations.
*
* @author Kamshory
* @package MagicObject\Exceptions
Expand Down
5 changes: 4 additions & 1 deletion src/Exceptions/InvalidReturnTypeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
/**
* Class InvalidReturnTypeException
*
* Exception thrown when an invalid return type is encountered.
* Exception thrown when a function or method returns a value that does not match the expected return type.
* This can occur in systems with strict typing or when there is a mismatch between a declared return type
* and the actual returned value during execution. It is particularly useful in frameworks or libraries
* that rely on reflection or type hinting to ensure correct return types.
*
* @package MagicObject\Exceptions
* @link https://github.com/Planetbiru/MagicObject
Expand Down

0 comments on commit fa25371

Please sign in to comment.