diff --git a/system/pages/bans.php b/system/pages/bans.php
index d2a69f47..349bebda 100644
--- a/system/pages/bans.php
+++ b/system/pages/bans.php
@@ -27,7 +27,7 @@ $configBans = [];
$configBans['hasType'] = false;
$configBans['hasReason'] = false;
-$limit = 'LIMIT ' . ($configBansPerPage + 1) . (isset($offset) ? ' OFFSET ' . $offset : '');
+$limit = 'LIMIT ' . ($configBansPerPage + 1) . ' OFFSET ' . $offset;
if ($db->hasTable('account_bans')) {
$bansQuery = $db->query('SELECT * FROM `account_bans` ORDER BY `banned_at` DESC ' . $limit);
}
diff --git a/system/pages/guilds/add_rank.php b/system/pages/guilds/add_rank.php
index acb65aea..0c510bb1 100644
--- a/system/pages/guilds/add_rank.php
+++ b/system/pages/guilds/add_rank.php
@@ -67,13 +67,9 @@ if(empty($errors)) {
}
else
{
- if(!empty($errors)) {
- $twig->display('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
- $twig->display('guilds.back_button.html.twig', array(
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true
));
- }
}
-
-?>
diff --git a/system/pages/houses.php b/system/pages/houses.php
index f548d23b..6e948d51 100644
--- a/system/pages/houses.php
+++ b/system/pages/houses.php
@@ -101,7 +101,7 @@ if(isset($_GET['page']) && $_GET['page'] == 'view' && isset($_REQUEST['house']))
'houseSize' => isset($house['size']) ? $house['size'] : null,
'houseRent' => isset($house['rent']) ? $house['rent'] : null,
'owner' => isset($owner) ? $owner : null,
- 'rentType' => isset($rentType) ? $rentType : null
+ 'rentType' => $rentType
));
if (count($errors) > 0) {
diff --git a/system/src/Commands/CronjobInstallCommand.php b/system/src/Commands/CronjobInstallCommand.php
index b8d48505..adcf8b20 100644
--- a/system/src/Commands/CronjobInstallCommand.php
+++ b/system/src/Commands/CronjobInstallCommand.php
@@ -47,7 +47,7 @@ class CronjobInstallCommand extends Command
{
exec('crontab -l', $crontab);
- if(isset($crontab) && is_array($crontab)) {
+ if(is_array($crontab)) {
$crontab = array_flip($crontab);
if(isset($crontab[$command])){
diff --git a/system/src/CreateCharacter.php b/system/src/CreateCharacter.php
index 62168f23..446ed160 100644
--- a/system/src/CreateCharacter.php
+++ b/system/src/CreateCharacter.php
@@ -73,7 +73,7 @@ class CreateCharacter
* @param array $errors
* @return bool
*/
- public function check($name, $sex, &$vocation, &$town, &$errors)
+ public function check($name, $sex, ?int &$vocation, ?int &$town, &$errors)
{
$this->checkName($name, $errors);
diff --git a/system/src/Models/Account.php b/system/src/Models/Account.php
index f26f9700..613b3029 100644
--- a/system/src/Models/Account.php
+++ b/system/src/Models/Account.php
@@ -4,6 +4,10 @@ namespace MyAAC\Models;
use Illuminate\Database\Eloquent\Model;
+/**
+ * @property integer $lastday
+ * @property integer $premdays
+ */
class Account extends Model {
protected $table = 'accounts';
@@ -46,8 +50,8 @@ class Account extends Model {
return 65535;
}
- $ret = ceil($this->premdays - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->lastday))) - date("z", $this->lastday)));
- return $ret > 0 ? $ret : 0;
+ $ret = ceil($this->premdays - ((int)date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->lastday))) - date("z", $this->lastday)));
+ return max($ret, 0);
}
public function getIsPremiumAttribute()
diff --git a/system/src/Models/Player.php b/system/src/Models/Player.php
index 2e49b678..0f8811d1 100644
--- a/system/src/Models/Player.php
+++ b/system/src/Models/Player.php
@@ -2,7 +2,14 @@
namespace MyAAC\Models;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\HasOne;
+/**
+ * @property int $level
+ * @property int $vocation
+ * @property int $online
+ * @property hasOne $onlineTable
+ */
class Player extends Model {
protected $table = 'players';