@@ -10,22 +10,22 @@ |
||
| 10 | 10 | |
| 11 | 11 | abstract class AbstractMiddleware{ |
| 12 | 12 | |
| 13 | - public BaseMatch $match; |
|
| 14 | - public Request $request; |
|
| 13 | + public BaseMatch $match; |
|
| 14 | + public Request $request; |
|
| 15 | 15 | |
| 16 | - public function __construct(){ } |
|
| 16 | + public function __construct(){ } |
|
| 17 | 17 | |
| 18 | - abstract protected function handle(mixed ...$args): HttpResponse|Request; |
|
| 18 | + abstract protected function handle(mixed ...$args): HttpResponse|Request; |
|
| 19 | 19 | |
| 20 | - public function addMatcher(BaseMatch $match){ |
|
| 20 | + public function addMatcher(BaseMatch $match){ |
|
| 21 | 21 | $this->match = $match; |
| 22 | - } |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - public function setRequest(Request $request){ |
|
| 24 | + public function setRequest(Request $request){ |
|
| 25 | 25 | $this->request = $request; |
| 26 | - } |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - public function __invoke(mixed ...$args) { |
|
| 28 | + public function __invoke(mixed ...$args) { |
|
| 29 | 29 | return $this->handle(...$args); |
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | \ No newline at end of file |
@@ -8,20 +8,20 @@ |
||
| 8 | 8 | |
| 9 | 9 | // Abstract Middleware to be used in Routing |
| 10 | 10 | |
| 11 | -abstract class AbstractMiddleware{ |
|
| 11 | +abstract class AbstractMiddleware { |
|
| 12 | 12 | |
| 13 | 13 | public BaseMatch $match; |
| 14 | 14 | public Request $request; |
| 15 | 15 | |
| 16 | - public function __construct(){ } |
|
| 16 | + public function __construct() { } |
|
| 17 | 17 | |
| 18 | 18 | abstract protected function handle(mixed ...$args): HttpResponse|Request; |
| 19 | 19 | |
| 20 | - public function addMatcher(BaseMatch $match){ |
|
| 20 | + public function addMatcher(BaseMatch $match) { |
|
| 21 | 21 | $this->match = $match; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public function setRequest(Request $request){ |
|
| 24 | + public function setRequest(Request $request) { |
|
| 25 | 25 | $this->request = $request; |
| 26 | 26 | } |
| 27 | 27 | |
@@ -3,4 +3,4 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Exception; |
| 5 | 5 | |
| 6 | -class ControllerNotFoundException extends Exception{} |
|
| 7 | 6 | \ No newline at end of file |
| 7 | +class ControllerNotFoundException extends Exception {} |
|
| 8 | 8 | \ No newline at end of file |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | class TableNameNotSetException extends Exception{ |
| 7 | 7 | |
| 8 | - public function __construct(\ReflectionClass $class, $message = "", $code = 0, ?\Throwable $previous = null){ |
|
| 8 | + public function __construct(\ReflectionClass $class, $message = "", $code = 0, ?\Throwable $previous = null){ |
|
| 9 | 9 | |
| 10 | 10 | $className = $class->getName(); |
| 11 | 11 | |
@@ -15,5 +15,5 @@ discard block |
||
| 15 | 15 | $this->line = $class->getStartLine(); |
| 16 | 16 | $this->file = $class->getFileName(); |
| 17 | 17 | parent::__construct($message, $code, $previous); |
| 18 | - } |
|
| 18 | + } |
|
| 19 | 19 | } |
| 20 | 20 | \ No newline at end of file |
@@ -3,13 +3,13 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Exception; |
| 5 | 5 | |
| 6 | -class TableNameNotSetException extends Exception{ |
|
| 6 | +class TableNameNotSetException extends Exception { |
|
| 7 | 7 | |
| 8 | - public function __construct(\ReflectionClass $class, $message = "", $code = 0, ?\Throwable $previous = null){ |
|
| 8 | + public function __construct(\ReflectionClass $class, $message = "", $code = 0, ?\Throwable $previous = null) { |
|
| 9 | 9 | |
| 10 | 10 | $className = $class->getName(); |
| 11 | 11 | |
| 12 | - $message = "No Table Name: ". |
|
| 12 | + $message = "No Table Name: ". |
|
| 13 | 13 | "Model '$className' has no table name set."; |
| 14 | 14 | |
| 15 | 15 | $this->line = $class->getStartLine(); |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class MultipleFieldAttributeException extends FieldException{ |
| 9 | 9 | |
| 10 | - public function __construct(\ReflectionProperty $prop, $message = "Lo", $code = 0, ?\Throwable $previous = null){ |
|
| 10 | + public function __construct(\ReflectionProperty $prop, $message = "Lo", $code = 0, ?\Throwable $previous = null){ |
|
| 11 | 11 | |
| 12 | 12 | $propName = $prop->getName(); |
| 13 | 13 | $className = $prop->getDeclaringClass()->getName(); |
@@ -16,5 +16,5 @@ discard block |
||
| 16 | 16 | "Field '$propName' of '$className' has more than one Field Attribute."; |
| 17 | 17 | |
| 18 | 18 | parent::__construct($prop, $message, $code, $previous); |
| 19 | - } |
|
| 19 | + } |
|
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -5,14 +5,14 @@ |
||
| 5 | 5 | use Throwable; |
| 6 | 6 | use Lepton\Helpers\Functions; |
| 7 | 7 | |
| 8 | -class MultipleFieldAttributeException extends FieldException{ |
|
| 8 | +class MultipleFieldAttributeException extends FieldException { |
|
| 9 | 9 | |
| 10 | - public function __construct(\ReflectionProperty $prop, $message = "Lo", $code = 0, ?\Throwable $previous = null){ |
|
| 10 | + public function __construct(\ReflectionProperty $prop, $message = "Lo", $code = 0, ?\Throwable $previous = null) { |
|
| 11 | 11 | |
| 12 | 12 | $propName = $prop->getName(); |
| 13 | 13 | $className = $prop->getDeclaringClass()->getName(); |
| 14 | 14 | |
| 15 | - $message = "Multiple Field attributes: ". |
|
| 15 | + $message = "Multiple Field attributes: ". |
|
| 16 | 16 | "Field '$propName' of '$className' has more than one Field Attribute."; |
| 17 | 17 | |
| 18 | 18 | parent::__construct($prop, $message, $code, $previous); |
@@ -3,4 +3,4 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Exception; |
| 5 | 5 | |
| 6 | -class InvalidFieldException extends Exception{} |
|
| 7 | 6 | \ No newline at end of file |
| 7 | +class InvalidFieldException extends Exception {} |
|
| 8 | 8 | \ No newline at end of file |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class MultiplePrimaryKeyException extends FieldException{ |
| 9 | 9 | |
| 10 | - public function __construct(\ReflectionProperty $prop, $message = "Lo", $code = 0, ?\Throwable $previous = null){ |
|
| 10 | + public function __construct(\ReflectionProperty $prop, $message = "Lo", $code = 0, ?\Throwable $previous = null){ |
|
| 11 | 11 | |
| 12 | 12 | $propName = $prop->getName(); |
| 13 | 13 | $className = $prop->getDeclaringClass()->getName(); |
@@ -16,5 +16,5 @@ discard block |
||
| 16 | 16 | "Field '$propName' of '$className' has more than one Primary Key."; |
| 17 | 17 | |
| 18 | 18 | parent::__construct($prop, $message, $code, $previous); |
| 19 | - } |
|
| 19 | + } |
|
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -5,14 +5,14 @@ |
||
| 5 | 5 | use Throwable; |
| 6 | 6 | use Lepton\Helpers\Functions; |
| 7 | 7 | |
| 8 | -class MultiplePrimaryKeyException extends FieldException{ |
|
| 8 | +class MultiplePrimaryKeyException extends FieldException { |
|
| 9 | 9 | |
| 10 | - public function __construct(\ReflectionProperty $prop, $message = "Lo", $code = 0, ?\Throwable $previous = null){ |
|
| 10 | + public function __construct(\ReflectionProperty $prop, $message = "Lo", $code = 0, ?\Throwable $previous = null) { |
|
| 11 | 11 | |
| 12 | 12 | $propName = $prop->getName(); |
| 13 | 13 | $className = $prop->getDeclaringClass()->getName(); |
| 14 | 14 | |
| 15 | - $message = "Multiple PrimaryKey: ". |
|
| 15 | + $message = "Multiple PrimaryKey: ". |
|
| 16 | 16 | "Field '$propName' of '$className' has more than one Primary Key."; |
| 17 | 17 | |
| 18 | 18 | parent::__construct($prop, $message, $code, $previous); |
@@ -3,4 +3,4 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Exception; |
| 5 | 5 | |
| 6 | -class FieldNotFoundException extends Exception{} |
|
| 7 | 6 | \ No newline at end of file |
| 7 | +class FieldNotFoundException extends Exception {} |
|
| 8 | 8 | \ No newline at end of file |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class NoPrimaryKeyException extends \Exception{ |
| 9 | 9 | |
| 10 | - public function __construct(\ReflectionClass $class, $message = "", $code = 0, ?\Throwable $previous = null){ |
|
| 10 | + public function __construct(\ReflectionClass $class, $message = "", $code = 0, ?\Throwable $previous = null){ |
|
| 11 | 11 | |
| 12 | 12 | $className = $class->getName(); |
| 13 | 13 | $this->line = $class->getStartLine(); |
@@ -17,5 +17,5 @@ discard block |
||
| 17 | 17 | "Model '$className' has no Primary Key."; |
| 18 | 18 | |
| 19 | 19 | parent::__construct($message, $code, $previous); |
| 20 | - } |
|
| 20 | + } |
|
| 21 | 21 | } |
| 22 | 22 | \ No newline at end of file |
@@ -5,15 +5,15 @@ |
||
| 5 | 5 | use Throwable; |
| 6 | 6 | use Lepton\Helpers\Functions; |
| 7 | 7 | |
| 8 | -class NoPrimaryKeyException extends \Exception{ |
|
| 8 | +class NoPrimaryKeyException extends \Exception { |
|
| 9 | 9 | |
| 10 | - public function __construct(\ReflectionClass $class, $message = "", $code = 0, ?\Throwable $previous = null){ |
|
| 10 | + public function __construct(\ReflectionClass $class, $message = "", $code = 0, ?\Throwable $previous = null) { |
|
| 11 | 11 | |
| 12 | 12 | $className = $class->getName(); |
| 13 | 13 | $this->line = $class->getStartLine(); |
| 14 | 14 | $this->file = $class->getFileName(); |
| 15 | 15 | |
| 16 | - $message = "No PrimaryKey: ". |
|
| 16 | + $message = "No PrimaryKey: ". |
|
| 17 | 17 | "Model '$className' has no Primary Key."; |
| 18 | 18 | |
| 19 | 19 | parent::__construct($message, $code, $previous); |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class InvalidFieldVisibilityKeyword extends FieldException{ |
| 9 | 9 | |
| 10 | - public function __construct(\ReflectionProperty $prop, $message = "", $code = 0, ?\Throwable $previous = null){ |
|
| 10 | + public function __construct(\ReflectionProperty $prop, $message = "", $code = 0, ?\Throwable $previous = null){ |
|
| 11 | 11 | |
| 12 | 12 | $propName = $prop->getName(); |
| 13 | 13 | $className = $prop->getDeclaringClass()->getName(); |
@@ -16,5 +16,5 @@ discard block |
||
| 16 | 16 | $message = "Invalid visibility keyword: ". |
| 17 | 17 | "Field '$propName' of '$className' set to '$modifiers', `protected` expected."; |
| 18 | 18 | parent::__construct($prop, $message, $code, $previous); |
| 19 | - } |
|
| 19 | + } |
|
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -5,15 +5,15 @@ |
||
| 5 | 5 | use Throwable; |
| 6 | 6 | use Lepton\Helpers\Functions; |
| 7 | 7 | |
| 8 | -class InvalidFieldVisibilityKeyword extends FieldException{ |
|
| 8 | +class InvalidFieldVisibilityKeyword extends FieldException { |
|
| 9 | 9 | |
| 10 | - public function __construct(\ReflectionProperty $prop, $message = "", $code = 0, ?\Throwable $previous = null){ |
|
| 10 | + public function __construct(\ReflectionProperty $prop, $message = "", $code = 0, ?\Throwable $previous = null) { |
|
| 11 | 11 | |
| 12 | 12 | $propName = $prop->getName(); |
| 13 | 13 | $className = $prop->getDeclaringClass()->getName(); |
| 14 | 14 | $modifiers = implode(' ', \Reflection::getModifierNames($prop->getModifiers())); |
| 15 | 15 | |
| 16 | - $message = "Invalid visibility keyword: ". |
|
| 16 | + $message = "Invalid visibility keyword: ". |
|
| 17 | 17 | "Field '$propName' of '$className' set to '$modifiers', `protected` expected."; |
| 18 | 18 | parent::__construct($prop, $message, $code, $previous); |
| 19 | 19 | } |