@@ -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 | /** |
| 4 | 4 | * @license MIT |
@@ -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, true); |
|
| 28 | + self::$headers = json_decode($configJson, true); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public static function get($url, $extraHeaders = []) |
@@ -6,27 +6,27 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CustomFileNameGenerator implements \FileUpload\FileNameGenerator\FileNameGenerator |
| 8 | 8 | { |
| 9 | - protected $generator; |
|
| 9 | + protected $generator; |
|
| 10 | 10 | |
| 11 | - /** |
|
| 12 | - * @param string|callable|Closure $nameGenerator |
|
| 13 | - */ |
|
| 14 | - public function __construct($nameGenerator) |
|
| 15 | - { |
|
| 16 | - $this->generator = $nameGenerator; |
|
| 17 | - } |
|
| 11 | + /** |
|
| 12 | + * @param string|callable|Closure $nameGenerator |
|
| 13 | + */ |
|
| 14 | + public function __construct($nameGenerator) |
|
| 15 | + { |
|
| 16 | + $this->generator = $nameGenerator; |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - public function getFileName($source_name, $type, $tmp_name, $index, $content_range, FileUpload $upload) |
|
| 20 | - { |
|
| 21 | - $sourceNameArray = explode(".", $source_name); |
|
| 22 | - $ext = $sourceNameArray[count($sourceNameArray) - 1]; |
|
| 23 | - if (is_string($this->generator) && !is_callable($this->generator)) { |
|
| 24 | - return $this->generator.".".$ext; |
|
| 25 | - } |
|
| 19 | + public function getFileName($source_name, $type, $tmp_name, $index, $content_range, FileUpload $upload) |
|
| 20 | + { |
|
| 21 | + $sourceNameArray = explode(".", $source_name); |
|
| 22 | + $ext = $sourceNameArray[count($sourceNameArray) - 1]; |
|
| 23 | + if (is_string($this->generator) && !is_callable($this->generator)) { |
|
| 24 | + return $this->generator.".".$ext; |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - return call_user_func_array( |
|
| 28 | - $this->generator, |
|
| 29 | - func_get_args() |
|
| 30 | - ); |
|
| 31 | - } |
|
| 27 | + return call_user_func_array( |
|
| 28 | + $this->generator, |
|
| 29 | + func_get_args() |
|
| 30 | + ); |
|
| 31 | + } |
|
| 32 | 32 | } |