From 6fb8bf56b49ab25701a912d116df0d48814284b7 Mon Sep 17 00:00:00 2001 From: Muhammad Umer Farooq Date: Fri, 15 Dec 2023 09:13:28 +0500 Subject: [PATCH] Apply fixes from StyleCI (#357) Co-authored-by: StyleCI Bot --- src/Auth/Error.php | 2 +- src/Auth/Logout.php | 1 + src/Auth/Reset.php | 2 +- src/Auth/Signin.php | 2 +- src/Auth/Signup.php | 2 +- src/Cache/Adapter/Redis.php | 4 +- src/Common/FTP.php | 6 +-- src/Common/Logger/Logger.php | 1 + src/Common/OperatingSystem.php | 2 +- src/Common/Pagination.php | 2 +- src/Console/Colorize.php | 1 + src/Console/Command.php | 3 +- src/Console/Commands.php | 1 + src/Console/Commands/Cache.php | 1 + src/Console/Commands/Controller.php | 1 + src/Console/Commands/ListCmd.php | 1 + src/Console/Commands/RouterListCommand.php | 1 + src/Console/Commands/ServeCommand.php | 1 + src/Console/Commands/Version.php | 1 + src/Console/Console.php | 2 +- src/Console/Input.php | 1 + src/Console/Input/Table.php | 1 + src/Console/Output.php | 1 + src/Container/Container.php | 5 +- src/Contracts/Auth/Update.php | 6 +-- src/Contracts/SystemMessage/SystemMessage.php | 2 +- src/Database/Drives/MYSQL/MySqlDb.php | 18 +++---- src/Database/Drives/SqLite/SqLite.php | 18 +++---- src/Database/Query/Query.php | 8 +-- src/Exception/Exception.php | 2 +- src/Hashing/Hash.php | 4 +- src/Hashing/Hashing.php | 4 +- src/Mail/Mail.php | 6 +-- src/Site/Site.php | 2 +- src/SystemMessage/SystemMessage.php | 50 +++++++++---------- src/Validation/Handler.php | 2 +- src/Validation/Validation.php | 28 +++++------ src/Validation/databaseRules.php | 4 +- src/http/Clients/AbstractClient.php | 1 + src/http/Clients/CURL.php | 2 +- src/http/Redirect.php | 2 +- src/http/Request.php | 4 +- src/http/Response.php | 12 ++--- 43 files changed, 116 insertions(+), 104 deletions(-) diff --git a/src/Auth/Error.php b/src/Auth/Error.php index dc41548..37c273e 100644 --- a/src/Auth/Error.php +++ b/src/Auth/Error.php @@ -30,7 +30,7 @@ class Error /** * Set the error msg. * - * @param (string) $error error msg + * @param (string) $error error msg * @param (string) optional $key key of error msg like username * * @since 1.0.0 diff --git a/src/Auth/Logout.php b/src/Auth/Logout.php index 112906f..3d125ce 100644 --- a/src/Auth/Logout.php +++ b/src/Auth/Logout.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Auth/Reset.php b/src/Auth/Reset.php index 2875c61..837577c 100644 --- a/src/Auth/Reset.php +++ b/src/Auth/Reset.php @@ -67,7 +67,7 @@ public function reset($email) $html = __printl('auth:body:reset'); $html = str_replace(':email', $email, $html); $html = str_replace(':link', $link, $html); - (new EmailHandler($subject, $html, $email)); + new EmailHandler($subject, $html, $email); Success::set(__printl('auth:success:reset')); } } else { diff --git a/src/Auth/Signin.php b/src/Auth/Signin.php index 96c2469..e291712 100644 --- a/src/Auth/Signin.php +++ b/src/Auth/Signin.php @@ -72,7 +72,7 @@ public function signin($username, $password) $html = __printl('auth:body:need:verify'); $html = str_replace(':email', $email, $html); $html = str_replace(':link', $link, $html); - (new EmailHandler($subject, $html, $email)); + new EmailHandler($subject, $html, $email); Error::set(__printl('auth:error:need:verification'), 'email'); } } diff --git a/src/Auth/Signup.php b/src/Auth/Signup.php index ef54aa8..c95e62d 100644 --- a/src/Auth/Signup.php +++ b/src/Auth/Signup.php @@ -120,7 +120,7 @@ public function signup($username, $email, $password, $params) $html = __printl('auth:body:need:verify'); $html = str_replace(':email', $email, $html); $html = str_replace(':link', $link, $html); - (new EmailHandler($subject, $html, $email)); + new EmailHandler($subject, $html, $email); } } } else { diff --git a/src/Cache/Adapter/Redis.php b/src/Cache/Adapter/Redis.php index b1a8993..3b670ea 100644 --- a/src/Cache/Adapter/Redis.php +++ b/src/Cache/Adapter/Redis.php @@ -87,7 +87,7 @@ public function getItemTtl($key) $data = $this->redis->get($key); if ($data !== false) { $data = json_decode($data, true); - if ((($data['ttl'] == 0) || ((time() - $data['start']) <= $data['ttl']))) { + if (($data['ttl'] == 0) || ((time() - $data['start']) <= $data['ttl'])) { $ttl = $data['ttl']; } else { $this->deleteItem($key); @@ -140,7 +140,7 @@ public function getItem($key) $data = $this->redis->get($key); if ($data !== false) { $data = json_decode($data, true); - if ((($data['ttl'] == 0) || ((time() - $data['start']) <= $data['ttl']))) { + if (($data['ttl'] == 0) || ((time() - $data['start']) <= $data['ttl'])) { $value = $data['value']; } else { $this->deleteItem($key); diff --git a/src/Common/FTP.php b/src/Common/FTP.php index c9b5e13..cf639bb 100644 --- a/src/Common/FTP.php +++ b/src/Common/FTP.php @@ -218,9 +218,9 @@ public function dirExists($dir) /** * Get the file. * - * @param (mixed) $local local - * @param (mixed)$remote remote - * @param (mixed) $mode mode + * @param (mixed) $local local + * @param (mixed) $remote remote + * @param (mixed) $mode mode * * @since 1.0.0 * diff --git a/src/Common/Logger/Logger.php b/src/Common/Logger/Logger.php index 85466c4..c9c9e44 100644 --- a/src/Common/Logger/Logger.php +++ b/src/Common/Logger/Logger.php @@ -176,6 +176,7 @@ public function get() * Log an Exception. * * @param (string) $level Error level (string or PHP syslog priority) + * * @oaram (string) $message Error message * * @param (array) $context Contextual array diff --git a/src/Common/OperatingSystem.php b/src/Common/OperatingSystem.php index 113b825..1644308 100644 --- a/src/Common/OperatingSystem.php +++ b/src/Common/OperatingSystem.php @@ -65,7 +65,7 @@ public function phpOs() default: $c_os = 'Unknown'; break; - } + } return $c_os; } diff --git a/src/Common/Pagination.php b/src/Common/Pagination.php index ea97469..c9ec310 100644 --- a/src/Common/Pagination.php +++ b/src/Common/Pagination.php @@ -210,7 +210,7 @@ public function pagination() { $pageCount = ceil($this->totalItems / $this->itemPerPage); if ($this->current >= 1 && $this->current <= $pageCount) { - $current_range = [($this->current - 2 < 1 ? 1 : $this->current - 2), ($this->current + 2 > $pageCount ? $pageCount : $this->current + 2)]; + $current_range = [$this->current - 2 < 1 ? 1 : $this->current - 2, $this->current + 2 > $pageCount ? $pageCount : $this->current + 2]; $first_page = $this->current > 5 ? '
  • '.printl('first:page:pagination').'
  • '.($this->current < 5 ? ', ' : '
  • ...
  • ') : null; $last_page = $this->current < $pageCount - 2 ? ($this->current > $pageCount - 4 ? ', ' : '
  • ...
  • ').'
  • '.printl('last:page:pagination').'
  • ' : null; $previous_page = $this->current > 1 ? '
  • '.printl('prev:page:pagination').'
  • ' : null; diff --git a/src/Console/Colorize.php b/src/Console/Colorize.php index 7506bda..4bf2ff7 100644 --- a/src/Console/Colorize.php +++ b/src/Console/Colorize.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Console/Command.php b/src/Console/Command.php index 0b542c6..73df3f2 100644 --- a/src/Console/Command.php +++ b/src/Console/Command.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE @@ -140,7 +141,7 @@ public function ask(string $str) */ public function terminate(): void { - exit(); + exit; } /** diff --git a/src/Console/Commands.php b/src/Console/Commands.php index 1991d29..2ef5a3a 100644 --- a/src/Console/Commands.php +++ b/src/Console/Commands.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Console/Commands/Cache.php b/src/Console/Commands/Cache.php index 5a8d9a9..638a0b5 100644 --- a/src/Console/Commands/Cache.php +++ b/src/Console/Commands/Cache.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Console/Commands/Controller.php b/src/Console/Commands/Controller.php index 5c992eb..a34efcb 100644 --- a/src/Console/Commands/Controller.php +++ b/src/Console/Commands/Controller.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Console/Commands/ListCmd.php b/src/Console/Commands/ListCmd.php index 292f85b..cf8ec96 100644 --- a/src/Console/Commands/ListCmd.php +++ b/src/Console/Commands/ListCmd.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Console/Commands/RouterListCommand.php b/src/Console/Commands/RouterListCommand.php index 821f440..b1972f0 100644 --- a/src/Console/Commands/RouterListCommand.php +++ b/src/Console/Commands/RouterListCommand.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Console/Commands/ServeCommand.php b/src/Console/Commands/ServeCommand.php index de3be3f..406528b 100644 --- a/src/Console/Commands/ServeCommand.php +++ b/src/Console/Commands/ServeCommand.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Console/Commands/Version.php b/src/Console/Commands/Version.php index 214c1c4..16cb7b6 100644 --- a/src/Console/Commands/Version.php +++ b/src/Console/Commands/Version.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Console/Console.php b/src/Console/Console.php index 952439c..2b01dbd 100644 --- a/src/Console/Console.php +++ b/src/Console/Console.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE @@ -104,7 +105,6 @@ public function getCommands(): array */ public function run($param): void { - // registering the commands to container. foreach ($this->commands as $command) { $this->container->register([$command[1], $command[0]], new $command[1]()); diff --git a/src/Console/Input.php b/src/Console/Input.php index 50fa205..ab6b973 100644 --- a/src/Console/Input.php +++ b/src/Console/Input.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Console/Input/Table.php b/src/Console/Input/Table.php index 9f56809..9691243 100644 --- a/src/Console/Input/Table.php +++ b/src/Console/Input/Table.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Console/Output.php b/src/Console/Output.php index 993218e..cf64755 100644 --- a/src/Console/Output.php +++ b/src/Console/Output.php @@ -8,6 +8,7 @@ * @link https://github.com/alphazframework/framework * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/Container/Container.php b/src/Container/Container.php index 1cec21c..5023619 100644 --- a/src/Container/Container.php +++ b/src/Container/Container.php @@ -266,7 +266,7 @@ protected function resolveParameter(\ReflectionParameter $parameter, \Reflection return $this->get($parameterClassName); - //Detetmine Parameter has default value? yes, use it. + //Detetmine Parameter has default value? yes, use it. } elseif ($parameter->isDefaultValueAvailable()) { return $parameter->getDefaultValue(); } @@ -337,8 +337,7 @@ public function reflectionFactory($class, array $parameters = []) //Determine the class is really class? if ($class->isInstantiable() === true) { - - //Get the class construct. + //Get the class construct. $constructor = $class->getConstructor(); if (null === $constructor) { //No construct just return an object. diff --git a/src/Contracts/Auth/Update.php b/src/Contracts/Auth/Update.php index f9fded9..6aaea93 100644 --- a/src/Contracts/Auth/Update.php +++ b/src/Contracts/Auth/Update.php @@ -31,9 +31,9 @@ public function update($params, $id); /** * Check is username is exists or not. * - * @param (mixed)$password password of user - * @param (mixed) $repeat confirm password - * @param (int) $id id of user + * @param (mixed) $password password of user + * @param (mixed) $repeat confirm password + * @param (int) $id id of user * * @since 1.0.0 * diff --git a/src/Contracts/SystemMessage/SystemMessage.php b/src/Contracts/SystemMessage/SystemMessage.php index b190d20..47c3ed9 100644 --- a/src/Contracts/SystemMessage/SystemMessage.php +++ b/src/Contracts/SystemMessage/SystemMessage.php @@ -22,7 +22,7 @@ interface SystemMessage * Add the system message. * * @param $params['msg'] => message to be store - * $params['type'] => alert type + * $params['type'] => alert type * * @since 1.0.0 * diff --git a/src/Database/Drives/MYSQL/MySqlDb.php b/src/Database/Drives/MYSQL/MySqlDb.php index a55fe20..53c4dce 100644 --- a/src/Database/Drives/MYSQL/MySqlDb.php +++ b/src/Database/Drives/MYSQL/MySqlDb.php @@ -194,9 +194,9 @@ public function select($params) * Prepare a query to delete data from database. * * @param $params array array(); - * 'table' Names of table - * 'db_name' => Database name - * 'wheres' Specify a selection criteria to get required records + * 'table' Names of table + * 'db_name' => Database name + * 'wheres' Specify a selection criteria to get required records * * @return bool */ @@ -216,10 +216,10 @@ public function delete($params) * Prepare a query to count data from database. * * @param $params array(); - * 'table' Names of table - * 'db_name' => Database name - * 'columns' Names of columnswant to select - * 'wheres' Specify a selection * + * 'table' Names of table + * 'db_name' => Database name + * 'columns' Names of columnswant to select + * 'wheres' Specify a selection * * * @return bool */ @@ -262,7 +262,7 @@ public function deleteDb($name) * Deleting table if not exists. * * @param $dbname name of database - * $table => $table name + * $table => $table name * * @return bool */ @@ -279,7 +279,7 @@ public function deleteTbl($dbname, $table) * Creating table. * * @param $dbname name of database - * $sql => for creating tables + * $sql => for creating tables * * @return bool */ diff --git a/src/Database/Drives/SqLite/SqLite.php b/src/Database/Drives/SqLite/SqLite.php index aa32f10..3fc9a9d 100644 --- a/src/Database/Drives/SqLite/SqLite.php +++ b/src/Database/Drives/SqLite/SqLite.php @@ -161,9 +161,9 @@ public function select($params) * Prepare a query to delete data from database. * * @param $params array array(); - * 'table' Names of table - * 'db_name' => Database name - * 'wheres' Specify a selection criteria to get required records + * 'table' Names of table + * 'db_name' => Database name + * 'wheres' Specify a selection criteria to get required records * * @return bool */ @@ -182,10 +182,10 @@ public function delete($params) * Prepare a query to count data from database. * * @param $params array(); - * 'table' Names of table - * 'db_name' => Database name - * 'columns' Names of columnswant to select - * 'wheres' Specify a selection * + * 'table' Names of table + * 'db_name' => Database name + * 'columns' Names of columnswant to select + * 'wheres' Specify a selection * * * @return bool */ @@ -217,7 +217,7 @@ public function deleteDb($name) * Deleting table if not exists. * * @param $dbname name of database - * $table => $table name + * $table => $table name * * @return bool */ @@ -233,7 +233,7 @@ public function deleteTbl($table) * Creating table. * * @param $dbname name of database - * $sql => for creating tables + * $sql => for creating tables * * @return bool */ diff --git a/src/Database/Query/Query.php b/src/Database/Query/Query.php index fac4a29..61aac2d 100644 --- a/src/Database/Query/Query.php +++ b/src/Database/Query/Query.php @@ -170,9 +170,9 @@ public function select($params) * Prepare a query to delete data from database. * * @param $params array array(); - * 'table' Names of table - * 'db_name' => Database name - * 'wheres' Specify a selection criteria to get required records + * 'table' Names of table + * 'db_name' => Database name + * 'wheres' Specify a selection criteria to get required records * * @return query */ @@ -269,7 +269,7 @@ public function deleteDb($name) * Deleting table query if not exists. * * @param $dbname name of database - * $table => $table name + * $table => $table name * * @return query */ diff --git a/src/Exception/Exception.php b/src/Exception/Exception.php index b2db6e5..1c4a8f7 100644 --- a/src/Exception/Exception.php +++ b/src/Exception/Exception.php @@ -27,6 +27,6 @@ class Exception */ public function __construct() { - (new Whoops()); + new Whoops(); } } diff --git a/src/Hashing/Hash.php b/src/Hashing/Hash.php index 2b0296d..c7e5539 100644 --- a/src/Hashing/Hash.php +++ b/src/Hashing/Hash.php @@ -59,7 +59,7 @@ public static function self($verify = false) /** * Generate the hash. * - * @param (string) $original + * @param (string) $original * @param (array) optional $options * * @since 1.0.0 @@ -93,7 +93,7 @@ public static function verify($original, $hash, $verify = false) /** * Check if the given hash has been hashed using the given options. * - * @param (string) $hash + * @param (string) $hash * @param (array) optional $options * * @since 1.0.0 diff --git a/src/Hashing/Hashing.php b/src/Hashing/Hashing.php index c2917f3..eebd62f 100644 --- a/src/Hashing/Hashing.php +++ b/src/Hashing/Hashing.php @@ -59,7 +59,7 @@ public function __construct($verify = false) /** * Generate the hash. * - * @param (string) $original + * @param (string) $original * @param (array) optional $options * * @since 1.0.0 @@ -89,7 +89,7 @@ public function verify($original, $hash) /** * Check if the given hash has been hashed using the given options. * - * @param (string) $hash + * @param (string) $hash * @param (array) optional $options * * @since 1.0.0 diff --git a/src/Mail/Mail.php b/src/Mail/Mail.php index 11c8224..ccaace8 100644 --- a/src/Mail/Mail.php +++ b/src/Mail/Mail.php @@ -214,7 +214,7 @@ public function prepareAttachment($attachment) * * @since 1.9.0 * - * @return boolean. + * @return bool. */ public function send() { @@ -326,8 +326,8 @@ public function isSMTP(bool $status = false) * Send mail over SMTP. * * @param $to sender email - * $from from email - * $message message to be send + * $from from email + * $message message to be send * * @since 1.9.0 * diff --git a/src/Site/Site.php b/src/Site/Site.php index 511f096..8634b8a 100644 --- a/src/Site/Site.php +++ b/src/Site/Site.php @@ -120,7 +120,7 @@ public static function redirect($url = null) $base_url = $url; } ob_start(); - (new Redirect($base_url, 200)); + new Redirect($base_url, 200); } /** diff --git a/src/SystemMessage/SystemMessage.php b/src/SystemMessage/SystemMessage.php index dce646d..b429f54 100644 --- a/src/SystemMessage/SystemMessage.php +++ b/src/SystemMessage/SystemMessage.php @@ -71,31 +71,31 @@ protected function type($type) { $type = strtolower($type); switch ($type) { - case 'success': - $type = 'success'; - break; - case 'error': - $type = 'danger'; - break; - case 'information': - $type = 'info'; - break; - case 'warning': - $type = 'warning'; - break; - case 'primary': - $type = 'primary'; - break; - case 'secondary': - $type = 'secondary'; - break; - case 'dark': - $type = 'Dark'; - break; - default: - $type = 'light'; - break; - } + case 'success': + $type = 'success'; + break; + case 'error': + $type = 'danger'; + break; + case 'information': + $type = 'info'; + break; + case 'warning': + $type = 'warning'; + break; + case 'primary': + $type = 'primary'; + break; + case 'secondary': + $type = 'secondary'; + break; + case 'dark': + $type = 'Dark'; + break; + default: + $type = 'light'; + break; + } $this->type = $type; } diff --git a/src/Validation/Handler.php b/src/Validation/Handler.php index e5d7f27..0f0e3f8 100644 --- a/src/Validation/Handler.php +++ b/src/Validation/Handler.php @@ -52,7 +52,7 @@ public static function pushMsgs() * Set the error msg. * * @param $error the error msg - * $key key of error msg + * $key key of error msg * * @return void */ diff --git a/src/Validation/Validation.php b/src/Validation/Validation.php index aa0b5dd..b920119 100644 --- a/src/Validation/Validation.php +++ b/src/Validation/Validation.php @@ -30,8 +30,8 @@ class Validation * Compile input. * * @param $input input value - * $role required etc - * $type input + * $role required etc + * $type input * * @return string */ @@ -45,9 +45,9 @@ public function __construct($input, $rule, $type = 'input') * Compile Json. * * @param $data (array) - * ['policies'] => policies - * ['value'] => Value to be checked - * ['field'] => field name + * ['policies'] => policies + * ['value'] => Value to be checked + * ['field'] => field name * * @return string */ @@ -63,9 +63,9 @@ public function jsonCompile($data, $policie) * Compile Database Unique. * * @param $data (array) - * ['policies'] => policies - * ['value'] => Value to be checked - * ['field'] => field name + * ['policies'] => policies + * ['value'] => Value to be checked + * ['field'] => field name * * @return string */ @@ -85,9 +85,9 @@ public function databaseCompile($data, $table) * Compile input. * * @param $data (array) - * ['policies'] => policies - * ['value'] => Value to be checked - * ['field'] => field name + * ['policies'] => policies + * ['value'] => Value to be checked + * ['field'] => field name * * @return string */ @@ -108,9 +108,9 @@ public function inputCompile(array $data) * Compile input. * * @param $data (array) - * ['policies'] => policies - * ['value'] => Value to be checked - * ['field'] => field name + * ['policies'] => policies + * ['value'] => Value to be checked + * ['field'] => field name * * @return string */ diff --git a/src/Validation/databaseRules.php b/src/Validation/databaseRules.php index 01da236..5baf669 100644 --- a/src/Validation/databaseRules.php +++ b/src/Validation/databaseRules.php @@ -23,8 +23,8 @@ class databaseRules extends StickyRules * Evaulate unique. * * @param $column Table column - * $value Value to be checked - * $table Database table + * $value Value to be checked + * $table Database table * * @return bool */ diff --git a/src/http/Clients/AbstractClient.php b/src/http/Clients/AbstractClient.php index a604f25..54e7655 100644 --- a/src/http/Clients/AbstractClient.php +++ b/src/http/Clients/AbstractClient.php @@ -4,6 +4,7 @@ * This file is part of the alphaz Framework. * * @author Muhammad Umer Farooq + * * @author-profile https://www.facebook.com/Muhammadumerfarooq01/ * * For the full copyright and license information, please view the LICENSE diff --git a/src/http/Clients/CURL.php b/src/http/Clients/CURL.php index 6796458..82d0462 100644 --- a/src/http/Clients/CURL.php +++ b/src/http/Clients/CURL.php @@ -320,7 +320,7 @@ protected function parseResponseHeaders() foreach ($headers as $header) { if (strpos($header, 'HTTP') !== false) { $this->version = substr($header, 0, strpos($header, ' ')); - $this->version = substr($this->version, (strpos($this->version, '/') + 1)); + $this->version = substr($this->version, strpos($this->version, '/') + 1); preg_match('/\d\d\d/', trim($header), $match); $this->code = $match[0]; $this->message = trim(str_replace('HTTP/'.$this->version.' '.$this->code.' ', '', $header)); diff --git a/src/http/Redirect.php b/src/http/Redirect.php index 619d9f2..80f536b 100644 --- a/src/http/Redirect.php +++ b/src/http/Redirect.php @@ -43,6 +43,6 @@ public function __construct($url, $code = '302', $version = '1.1') header("Location: {$url}"); //Need to stop current execution after redirect. - exit(); + exit; } } diff --git a/src/http/Request.php b/src/http/Request.php index 0a453fe..5992499 100644 --- a/src/http/Request.php +++ b/src/http/Request.php @@ -436,7 +436,7 @@ protected function parseData() // If the content-type is JSON if ($this->getQueryString() && stripos($this->getQueryString(), 'json') !== false) { $this->parsedData = json_decode($this->rawData, true); - // Else, if the content-type is XML + // Else, if the content-type is XML } elseif ($this->getContentType() && stripos($this->getContentType(), 'xml') !== false) { $matches = []; preg_match_all('//is', $this->rawData, $matches); @@ -451,7 +451,7 @@ protected function parseData() } $this->parsedData = json_decode(json_encode((array) simplexml_load_string($this->rawData)), true); - // Else, default to a regular URL-encoded string + // Else, default to a regular URL-encoded string } else { switch (strtoupper($this->getRequestMethod())) { case 'GET': diff --git a/src/http/Response.php b/src/http/Response.php index cdb5727..5872be7 100644 --- a/src/http/Response.php +++ b/src/http/Response.php @@ -95,7 +95,7 @@ public static function encodeBody($body, $encode = 'gzip') $encodedBody = gzencode($body); break; - // Deflate compression + // Deflate compression case 'deflate': if (!function_exists('gzdeflate')) { throw new \Exception('Deflate compression is not available.'); @@ -103,10 +103,9 @@ public static function encodeBody($body, $encode = 'gzip') $encodedBody = gzdeflate($body); break; - // Unknown compression + // Unknown compression default: $encodedBody = $body; - } return $encodedBody; @@ -133,7 +132,7 @@ public static function decodeBody($body, $decode = 'gzip') $decodedBody = gzinflate(substr($body, 10)); break; - // Deflate compression + // Deflate compression case 'deflate': if (!function_exists('gzinflate')) { throw new \Exception('Deflate compression is not available.'); @@ -142,10 +141,9 @@ public static function decodeBody($body, $decode = 'gzip') $decodedBody = ($zlibHeader[1] % 31 == 0) ? gzuncompress($body) : gzinflate($body); break; - // Unknown compression + // Unknown compression default: $decodedBody = $body; - } return $decodedBody; @@ -382,7 +380,7 @@ public function setSslHeaders() public function sendAndExit($code = null, array $headers = null) { $this->send($code, $headers); - exit(); + exit; } /**