Code Duplication    Length = 3-5 lines in 4 locations

lib/Service/AppConfigService.php 4 locations

@@ 111-113 (lines=3) @@
108
     * @throws NotFoundException
109
     */
110
    private function checkLanguages($value) {
111
        if (empty($value) || !preg_match('/^(([a-z]{3,4}|[a-z]{3,4}\-[a-z]{3,4});)*([a-z]{3,4}|[a-z]{3,4}\-[a-z]{3,4})$/', $value)) {
112
            throw new NotFoundException($this->l10n->t('The languages are not specified in the correct format.'));
113
        }
114
    }
115
116
    /**
@@ 123-127 (lines=5) @@
120
     * @throws NotFoundException
121
     */
122
    private function checkRedisHost($value) {
123
        if (empty($value) || !preg_match(
124
                '/(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$)/', 
125
                $value)) {
126
            throw new NotFoundException($this->l10n->t('The redis host is not specified in the correct format.'));
127
        }
128
    }
129
130
    /**
@@ 137-139 (lines=3) @@
134
     * @throws NotFoundException
135
     */
136
    private function checkRedisPort($value) {
137
        if (empty($value) || !($value > 0 && $value < 65535)) {
138
            throw new NotFoundException($this->l10n->t('The redis port number is not specified in the correct format.'));
139
        }
140
    }
141
142
    /**
@@ 149-151 (lines=3) @@
146
     * @throws NotFoundException
147
     */
148
    private function checkRedisDb($value) {
149
        if ($value === '' || !preg_match('/^\d*$/', $value)) {
150
            throw new NotFoundException($this->l10n->t('The redis db is not specified in the correct format.'));
151
        }
152
    }
153
}