Code Duplication    Length = 7-7 lines in 2 locations

src/Utilities/BotState.php 1 location

@@ 101-107 (lines=7) @@
98
99
        }
100
101
        if ($this->redis->exists($this->_chat_id . ':status')) {
102
103
            $this->status = $this->redis->get($this->_chat_id . ':status');
104
105
            return $this->status;
106
107
        }
108
109
        $this->redis->set($this->_chat_id . ':status', $default_status);
110
        $this->status = $default_status;

src/Utilities/Localization.php 1 location

@@ 102-108 (lines=7) @@
99
        }
100
101
        // Does it exists on redis?
102
        if ($this->redis->exists($this->_chat_id . ':language')) {
103
104
            // Get the value
105
            $this->language = $this->redis->get($this->_chat_id . ':language');
106
            return $this->language;
107
108
        }
109
110
        // Set the value from the db
111
        $this->redis->setEx($this->_chat_id . ':language', $expiring_time, $this->getLanguageDatabase($default_language));