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: case $r::NOT_FOUND:
// ... 404 Not Found // ... 404 Not Found
if ( if (
'1' != $user->g_read_board 1 !== $user->g_read_board
&& $user->isGuest && $user->isGuest
) { ) {
$page = $this->c->Redirect->page('Login'); $page = $this->c->Redirect->page('Login');

View file

@ -186,7 +186,7 @@ class Config
} else { } else {
$result[] = $value; $result[] = $value;
} }
} elseif (null != $key) { } elseif (null !== $key) {
throw new ForkException('Config array cannot be parsed'); throw new ForkException('Config array cannot be parsed');
} }
@ -267,7 +267,7 @@ class Config
$value = null; $value = null;
$key = null; $key = null;
} elseif (null != $key) { } elseif (null !== $key) {
throw new ForkException('Config array cannot be parsed'); 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('baseUrl', $this->c->BASE_URL);
$this->setAttr('showImg', '0' != $this->c->user->show_img); $this->setAttr('showImg', 1 === $this->c->user->show_img);
$this->setAttr('showImgSign', '0' != $this->c->user->show_img_sig); $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; $this->user->num_posts = $this->user->num_posts + 1;
if ( 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->num_posts >= $this->user->g_promote_min_posts
) { ) {
$this->user->group_id = $this->user->g_promote_next_group; $this->user->group_id = $this->user->g_promote_next_group;

View file

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

View file

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

View file

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

View file

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

View file

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