소스 검색

Update for previous commit

 "logical" type in config model.
Visman 4 년 전
부모
커밋
ec98d0eb3b
6개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 1
      app/Models/Pages/Edit.php
  2. 1 1
      app/Models/Pages/Post.php
  3. 1 1
      app/Models/Pages/Topic.php
  4. 2 2
      app/Models/Poll/Model.php
  5. 1 1
      app/Models/Topic/Model.php
  6. 2 2
      app/Models/User/Model.php

+ 1 - 1
app/Models/Pages/Edit.php

@@ -41,7 +41,7 @@ class Edit extends Page
 
         $this->c->Lang->load('post');
 
-        if ('1' == $this->c->config->b_poll_enabled) {
+        if (1 === $this->c->config->b_poll_enabled) {
             $this->c->Lang->load('poll');
         }
 

+ 1 - 1
app/Models/Pages/Post.php

@@ -38,7 +38,7 @@ class Post extends Page
 
         $this->c->Lang->load('post');
 
-        if ('1' == $this->c->config->b_poll_enabled) {
+        if (1 === $this->c->config->b_poll_enabled) {
             $this->c->Lang->load('poll');
         }
 

+ 1 - 1
app/Models/Pages/Topic.php

@@ -176,7 +176,7 @@ class Topic extends Page
 
         if (
             $topic->poll_type > 0
-            && '1' == $this->c->config->b_poll_enabled
+            && 1 === $this->c->config->b_poll_enabled
         ) {
             $this->c->Lang->load('poll');
 

+ 2 - 2
app/Models/Poll/Model.php

@@ -143,7 +143,7 @@ class Model extends DataModel
     {
         return (
                 $this->c->user->usePoll
-                || '1' == $this->c->config->b_poll_guest
+                || 1 === $this->c->config->b_poll_guest
             )
             && (
                 0 === $this->parent->poll_term
@@ -238,7 +238,7 @@ class Model extends DataModel
             return null;
         } elseif (
             $this->c->user->isGuest
-            && '1' != $this->c->config->b_poll_guest
+            && 1 !== $this->c->config->b_poll_guest
         ) {
             return __('Poll results are hidden from the guests');
         } elseif (! $this->isOpen) {

+ 1 - 1
app/Models/Topic/Model.php

@@ -349,7 +349,7 @@ class Model extends DataModel
                 $this->stick_fp
                 || (
                     $this->poll_type > 0
-                    && '1' == $this->c->config->b_poll_enabled
+                    && 1 === $this->c->config->b_poll_enabled
                 )
             )
             && ! \in_array($this->first_post_id, $list)

+ 2 - 2
app/Models/User/Model.php

@@ -383,7 +383,7 @@ class Model extends DataModel
      */
     protected function getusePoll(): bool
     {
-        return '1' == $this->c->config->b_poll_enabled && ! $this->isGuest;
+        return 1 === $this->c->config->b_poll_enabled && ! $this->isGuest;
     }
 
     public function fLog(): string
@@ -396,7 +396,7 @@ class Model extends DataModel
      */
     protected function getusePM(): bool
     {
-        return '1' == $this->c->config->b_pm
+        return 1 === $this->c->config->b_pm
             && (
                 $this->isAdmin
                 || 1 == $this->g_pm