Code Duplication    Length = 7-7 lines in 3 locations

src/Bot.php 3 locations

@@ 787-793 (lines=7) @@
784
        }
785
786
        // Does it exists on redis?
787
        if ($this->redis->exists($this->_chat_id . ':language')) {
788
789
            // Get the value
790
            $this->language = $this->redis->get($this->_chat_id . ':language');
791
            return $this->language;
792
793
        }
794
795
        // If it doens't exist, set $language to $default_language
796
        $this->language = $default_language;
@@ 823-829 (lines=7) @@
820
        }
821
822
        // Does it exists on redis?
823
        if ($this->redis->exists($this->_chat_id . ':language')) {
824
825
            // Get the value
826
            $this->language = $this->redis->get($this->_chat_id . ':language');
827
            return $this->language;
828
829
        }
830
831
        // Set the value from the db
832
        $this->redis->setEx($this->_chat_id . ':language', $expiring_time, $this->getLanguageDatabase($default_language));
@@ 1021-1027 (lines=7) @@
1018
1019
        }
1020
1021
        if ($this->redis->exists($this->_chat_id . ':status')) {
1022
1023
            $this->status = $this->redis->get($this->_chat_id . ':status');
1024
1025
            return $this->status;
1026
1027
        }
1028
1029
        $this->redis->set($this->_chat_id . ':status', $default_status);
1030
        $this->status = $default_status;