Strict type checking

This commit is contained in:
Visman 2021-12-19 15:31:27 +07:00
parent 7fa59c4023
commit d9101e83bd
9 changed files with 13 additions and 13 deletions

View file

@ -740,7 +740,7 @@ class Routing
case $r::NOT_FOUND:
// ... 404 Not Found
if (
'1' != $user->g_read_board
1 !== $user->g_read_board
&& $user->isGuest
) {
$page = $this->c->Redirect->page('Login');

View file

@ -186,7 +186,7 @@ class Config
} else {
$result[] = $value;
}
} elseif (null != $key) {
} elseif (null !== $key) {
throw new ForkException('Config array cannot be parsed');
}
@ -267,7 +267,7 @@ class Config
$value = null;
$key = null;
} elseif (null != $key) {
} elseif (null !== $key) {
throw new ForkException('Config array cannot be parsed');
}

View file

@ -59,8 +59,8 @@ class Parser extends Parserus
}
$this->setAttr('baseUrl', $this->c->BASE_URL);
$this->setAttr('showImg', '0' != $this->c->user->show_img);
$this->setAttr('showImgSign', '0' != $this->c->user->show_img_sig);
$this->setAttr('showImg', 1 === $this->c->user->show_img);
$this->setAttr('showImgSign', 1 === $this->c->user->show_img_sig);
}
/**

View file

@ -291,7 +291,7 @@ class Post extends Page
$this->user->num_posts = $this->user->num_posts + 1;
if (
0 != $this->user->g_promote_next_group
$this->user->g_promote_next_group > 0
&& $this->user->num_posts >= $this->user->g_promote_min_posts
) {
$this->user->group_id = $this->user->g_promote_next_group;

View file

@ -27,7 +27,7 @@ trait PostValidatorTrait
// заголовок темы только заглавными буквами
} elseif (
! $executive
&& 1 != $this->c->config->b_subject_all_caps
&& 1 !== $this->c->config->b_subject_all_caps
&& \preg_match('%\p{Lu}%u', $subject)
&& ! \preg_match('%\p{Ll}%u', $subject)
) {
@ -62,7 +62,7 @@ trait PostValidatorTrait
if (
true === $prepare
&& ! $executive
&& 1 != $this->c->config->b_message_all_caps
&& 1 !== $this->c->config->b_message_all_caps
) {
$text = $this->c->Parser->getText();

View file

@ -194,7 +194,7 @@ class Edit extends Profile
if (
true === $prepare
&& ! $this->user->isAdmin
&& 1 != $this->c->config->b_sig_all_caps
&& 1 !== $this->c->config->b_sig_all_caps
) {
$text = $this->c->Parser->getText();

View file

@ -217,7 +217,7 @@ class Subscription extends Model
if (self::FORUMS_DATA & $type) {
if (
1 != $this->c->config->b_forum_subscriptions
1 !== $this->c->config->b_forum_subscriptions
|| $model->isGuest
) {
$result[self::FORUMS_DATA] = null;
@ -232,7 +232,7 @@ class Subscription extends Model
if (self::TOPICS_DATA & $type) {
if (
1 != $this->c->config->b_topic_subscriptions
1 !== $this->c->config->b_topic_subscriptions
|| $model->isGuest
) {
$result[self::TOPICS_DATA] = null;

View file

@ -41,7 +41,7 @@ class ChangeGroup extends Action
}
if (
1 != $newGroup->g_moderator
1 !== $newGroup->g_moderator
&& $user->isAdmMod
) {
$moderators[$user->id] = $user;

View file

@ -29,7 +29,7 @@ class NoURL extends RulesValidator
if (
(
! empty($flag)
|| '1' != $this->c->user->g_post_links
|| 1 !== $this->c->user->g_post_links
)
&& \preg_match('%https?://|www\.%i', $value)
) {