[TASK] Replace strings with constants/variables 54/59954/2
authorBenni Mack <benni@typo3.org>
Sat, 9 Mar 2019 12:57:04 +0000 (13:57 +0100)
committerBenni Mack <benni@typo3.org>
Mon, 11 Mar 2019 10:32:44 +0000 (11:32 +0100)
There are a few places where - instead of hard-coded values,
the proper constants or variables can be used instead.

Resolves: #87870
Releases: master
Change-Id: Ia1053bddefc7627cdc9699360df68ec317898d45
Reviewed-on: https://review.typo3.org/c/59954
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Stephan GroƟberndt <stephan.grossberndt@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
typo3/sysext/frontend/Classes/Authentication/FrontendUserAuthentication.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/Page/PageRepository.php

index 89f07db..f3ba30d 100644 (file)
@@ -613,9 +613,9 @@ class FrontendUserAuthentication extends AbstractUserAuthentication
             || $this->user['is_online'] >= $GLOBALS['EXEC_TIME'] - 60) {
             return;
         }
-        $dbConnection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('fe_users');
+        $dbConnection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($this->user_table);
         $dbConnection->update(
-            'fe_users',
+            $this->user_table,
             ['is_online' => $GLOBALS['EXEC_TIME']],
             ['uid' => (int)$this->user['uid']]
         );
index 3e7d4a3..82b1636 100644 (file)
@@ -347,9 +347,9 @@ class ContentObjectRenderer implements LoggerAwareInterface
     public $checkPid_cache = [];
 
     /**
-     * @var string
+     * @var string|int
      */
-    public $checkPid_badDoktypeList = '255';
+    public $checkPid_badDoktypeList = PageRepository::DOKTYPE_RECYCLER;
 
     /**
      * This will be set by typoLink() to the url of the most recent link created.
index 439b6ee..e283dca 100644 (file)
@@ -1055,7 +1055,7 @@ class PageRepository implements LoggerAwareInterface
                     ),
                     $queryBuilder->expr()->neq(
                         'doktype',
-                        $queryBuilder->createNamedParameter(255, \PDO::PARAM_INT)
+                        $queryBuilder->createNamedParameter(self::DOKTYPE_RECYCLER, \PDO::PARAM_INT)
                     )
                 )
                 ->execute()
@@ -1087,7 +1087,7 @@ class PageRepository implements LoggerAwareInterface
                     ),
                     $queryBuilder->expr()->neq(
                         'doktype',
-                        $queryBuilder->createNamedParameter(255, \PDO::PARAM_INT)
+                        $queryBuilder->createNamedParameter(self::DOKTYPE_RECYCLER, \PDO::PARAM_INT)
                     )
                 )
                 ->execute()