Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fixes from StyleCI #357

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Auth/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Auth/Logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Signin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Signup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/Cache/Adapter/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/Common/FTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
1 change: 1 addition & 0 deletions src/Common/Logger/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Common/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function phpOs()
default:
$c_os = 'Unknown';
break;
}
}

return $c_os;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? '<li><a href="'.$this->baseUrl.$this->urlAppend.'1'.'" class="'.$this->aClass.'">'.printl('first:page:pagination').'</a></li>'.($this->current < 5 ? ', ' : ' <li class="'.$this->liClass.'"><a href="#!" class="'.$this->aClass.' disable" disabled >...</a></li> ') : null;
$last_page = $this->current < $pageCount - 2 ? ($this->current > $pageCount - 4 ? ', ' : ' <li class="'.$this->liClass.' disable"><a href="#!" class="'.$this->aClass.'" disabled >...</a></li> ').'<li><a href="'.$this->baseUrl.$this->urlAppend.$pageCount.'" class="'.$this->aClass.'">'.printl('last:page:pagination').'</a></li>' : null;
$previous_page = $this->current > 1 ? '<li class="'.$this->liClass.'"><a class="'.$this->aClass.'"href="'.$this->baseUrl.$this->urlAppend.($this->current - 1).'">'.printl('prev:page:pagination').'</a></li> ' : null;
Expand Down
1 change: 1 addition & 0 deletions src/Console/Colorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
3 changes: 2 additions & 1 deletion src/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -140,7 +141,7 @@ public function ask(string $str)
*/
public function terminate(): void
{
exit();
exit;
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Console/Commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
1 change: 1 addition & 0 deletions src/Console/Commands/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
1 change: 1 addition & 0 deletions src/Console/Commands/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
1 change: 1 addition & 0 deletions src/Console/Commands/ListCmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
1 change: 1 addition & 0 deletions src/Console/Commands/RouterListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
1 change: 1 addition & 0 deletions src/Console/Commands/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
1 change: 1 addition & 0 deletions src/Console/Commands/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -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]());
Expand Down
1 change: 1 addition & 0 deletions src/Console/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
1 change: 1 addition & 0 deletions src/Console/Input/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
1 change: 1 addition & 0 deletions src/Console/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link https://github.com/alphazframework/framework
*
* @author Muhammad Umer Farooq <[email protected]>
*
* @author-profile https://www.facebook.com/Muhammadumerfarooq01/
*
* For the full copyright and license information, please view the LICENSE
Expand Down
5 changes: 2 additions & 3 deletions src/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/Contracts/Auth/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/SystemMessage/SystemMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
18 changes: 9 additions & 9 deletions src/Database/Drives/MYSQL/MySqlDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down
18 changes: 9 additions & 9 deletions src/Database/Drives/SqLite/SqLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Database/Query/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ class Exception
*/
public function __construct()
{
(new Whoops());
new Whoops();
}
}
Loading