@@ -17,35 +17,35 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class Constant |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * Events |
|
| 22 | - */ |
|
| 23 | - const EVENT_INSERT = 'EVENT: INSERT DML EVENT'; |
|
| 24 | - const EVENT_SELECT = 'EVENT: SELECT DML EVENT'; |
|
| 25 | - const EVENT_UPDATE = 'EVENT: UPDATE DML EVENT'; |
|
| 20 | + /** |
|
| 21 | + * Events |
|
| 22 | + */ |
|
| 23 | + const EVENT_INSERT = 'EVENT: INSERT DML EVENT'; |
|
| 24 | + const EVENT_SELECT = 'EVENT: SELECT DML EVENT'; |
|
| 25 | + const EVENT_UPDATE = 'EVENT: UPDATE DML EVENT'; |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * @author Lucky Bardeson |
|
| 29 | - */ |
|
| 30 | - const EVENT_DELETE = 'EVENT: DELETE DML EVENT'; |
|
| 27 | + /** |
|
| 28 | + * @author Lucky Bardeson |
|
| 29 | + */ |
|
| 30 | + const EVENT_DELETE = 'EVENT: DELETE DML EVENT'; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Error Numbers |
|
| 34 | - */ |
|
| 35 | - const ERROR_401 = 'ERROR_401: Resource Inaccessible'; |
|
| 36 | - const ERROR_402 = 'ERROR_402: Resource Requirements Not Met'; |
|
| 37 | - const ERROR_403 = 'ERROR_403: Resource Not Writable'; |
|
| 38 | - const ERROR_404 = 'ERROR_404: Resource Not Found'; |
|
| 32 | + /** |
|
| 33 | + * Error Numbers |
|
| 34 | + */ |
|
| 35 | + const ERROR_401 = 'ERROR_401: Resource Inaccessible'; |
|
| 36 | + const ERROR_402 = 'ERROR_402: Resource Requirements Not Met'; |
|
| 37 | + const ERROR_403 = 'ERROR_403: Resource Not Writable'; |
|
| 38 | + const ERROR_404 = 'ERROR_404: Resource Not Found'; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * Error Severities |
|
| 42 | - */ |
|
| 43 | - const ERROR_HIGH = 'ERROR_SEVERITY: HIGH'; |
|
| 44 | - const ERROR_LOW = 'ERROR_SEVERITY: LOW'; |
|
| 45 | - const ERROR_NORMAL = 'ERROR_SEVERITY: NORMAL'; |
|
| 40 | + /** |
|
| 41 | + * Error Severities |
|
| 42 | + */ |
|
| 43 | + const ERROR_HIGH = 'ERROR_SEVERITY: HIGH'; |
|
| 44 | + const ERROR_LOW = 'ERROR_SEVERITY: LOW'; |
|
| 45 | + const ERROR_NORMAL = 'ERROR_SEVERITY: NORMAL'; |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * |
|
| 49 | - */ |
|
| 50 | - const UNDEFINED = 0; |
|
| 47 | + /** |
|
| 48 | + * |
|
| 49 | + */ |
|
| 50 | + const UNDEFINED = 0; |
|
| 51 | 51 | } |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * @license MIT |
| 4 | 4 | * @author Samuel Adeshina <[email protected]> |
@@ -21,18 +21,18 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class UserIDValidator implements ValidatorInterface |
| 23 | 23 | { |
| 24 | - public function isValidUserId(string $userId) |
|
| 25 | - { |
|
| 26 | - $selectQuery = (new Builder('QueryBuilder', 'Select'))->getBuilder(); |
|
| 24 | + public function isValidUserId(string $userId) |
|
| 25 | + { |
|
| 26 | + $selectQuery = (new Builder('QueryBuilder', 'Select'))->getBuilder(); |
|
| 27 | 27 | |
| 28 | - $selectQuery |
|
| 29 | - ->top(1) |
|
| 30 | - ->columns('StaffID') |
|
| 31 | - ->from('[Staffs].[Staff]') |
|
| 32 | - ->where( |
|
| 33 | - 'StaffID', |
|
| 34 | - '='. |
|
| 35 | - $userId |
|
| 36 | - ); |
|
| 37 | - } |
|
| 28 | + $selectQuery |
|
| 29 | + ->top(1) |
|
| 30 | + ->columns('StaffID') |
|
| 31 | + ->from('[Staffs].[Staff]') |
|
| 32 | + ->where( |
|
| 33 | + 'StaffID', |
|
| 34 | + '='. |
|
| 35 | + $userId |
|
| 36 | + ); |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * @license MIT |
| 4 | 4 | * @author Samuel Adeshina <[email protected]> |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * @license MIT |
| 4 | 4 | * @author Samuel Adeshina <[email protected]> |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * @license MIT |
| 4 | 4 | * @author Samuel Adeshina <[email protected]> |
@@ -20,10 +20,10 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | class UnexpectedErrorException extends Exception |
| 22 | 22 | { |
| 23 | - public function __construct(string $message, int $databaseUser) |
|
| 24 | - { |
|
| 25 | - parent::__construct($message, 0, $previous); |
|
| 23 | + public function __construct(string $message, int $databaseUser) |
|
| 24 | + { |
|
| 25 | + parent::__construct($message, 0, $previous); |
|
| 26 | 26 | |
| 27 | - $this->log($databaseUser, Constant::ERROR_401, Constant::ERROR_HIGH); |
|
| 28 | - } |
|
| 27 | + $this->log($databaseUser, Constant::ERROR_401, Constant::ERROR_HIGH); |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * @license MIT |
| 4 | 4 | * @author Samuel Adeshina <[email protected]> |
@@ -20,10 +20,10 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | class SQLException extends Exception |
| 22 | 22 | { |
| 23 | - public function __construct(string $message, int $databaseUser) |
|
| 24 | - { |
|
| 25 | - parent::__construct($message, 0, null); |
|
| 23 | + public function __construct(string $message, int $databaseUser) |
|
| 24 | + { |
|
| 25 | + parent::__construct($message, 0, null); |
|
| 26 | 26 | |
| 27 | - $this->log($databaseUser, Constant::ERROR_401, Constant::ERROR_NORMAL); |
|
| 28 | - } |
|
| 27 | + $this->log($databaseUser, Constant::ERROR_401, Constant::ERROR_NORMAL); |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * @license MIT |
| 4 | 4 | * @author Samuel Adeshina <[email protected]> |
@@ -20,10 +20,10 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | class UndefinedValueException extends Exception |
| 22 | 22 | { |
| 23 | - public function __construct(string $message, int $databaseUser) |
|
| 24 | - { |
|
| 25 | - parent::__construct($message, 0, null); |
|
| 23 | + public function __construct(string $message, int $databaseUser) |
|
| 24 | + { |
|
| 25 | + parent::__construct($message, 0, null); |
|
| 26 | 26 | |
| 27 | - $this->log($databaseUser, Constant::ERROR_404, Constant::ERROR_NORMAL); |
|
| 28 | - } |
|
| 27 | + $this->log($databaseUser, Constant::ERROR_404, Constant::ERROR_NORMAL); |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * @license MIT |
| 4 | 4 | * @author Samuel Adeshina <[email protected]> |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * @license MIT |
| 4 | 4 | * @author Samuel Adeshina <[email protected]> |
@@ -24,9 +24,9 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $configJson = file_get_contents("bin/configs/elasticsearch-config.json"); |
| 26 | 26 | |
| 27 | - $config = json_decode($configJson); |
|
| 27 | + $config = json_decode($configJson); |
|
| 28 | 28 | |
| 29 | - self::$clientObject = \Elasticsearch\ClientBuilder::create()->setHosts($config)->build(); |
|
| 29 | + self::$clientObject = \Elasticsearch\ClientBuilder::create()->setHosts($config)->build(); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public static function getClient() |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * @license MIT |
| 4 | 4 | * @author Samuel Adeshina <[email protected]> |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $configJson = file_get_contents("bin/configs/http-headers-config.json"); |
| 27 | 27 | |
| 28 | - self::$headers = json_decode($configJson); |
|
| 28 | + self::$headers = json_decode($configJson); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public static function get($url, $extraHeaders = []) |