Code Duplication    Length = 3-5 lines in 4 locations

lib/Service/AppConfigService.php 4 locations

@@ 125-127 (lines=3) @@
122
     * @throws NotFoundException
123
     */
124
    private function checkLanguages($value) {
125
        if (empty($value) ||
126
                 !preg_match('/^[a-zA-Z\_\-\/]+(\;[a-zA-Z\_\-\/]+)*$/', $value)) {
127
            throw new NotFoundException($this->l10n->t('The languages are not specified in the correct format.'));
128
        }
129
    }
130
@@ 138-142 (lines=5) @@
135
     * @throws NotFoundException
136
     */
137
    private function checkRedisHost($value) {
138
        if (empty($value) || !preg_match(
139
                '/(^(([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])$)/', 
140
                $value)) {
141
            throw new NotFoundException($this->l10n->t('The Redis host is not specified in the correct format.'));
142
        }
143
    }
144
145
    /**
@@ 152-154 (lines=3) @@
149
     * @throws NotFoundException
150
     */
151
    private function checkRedisPort($value) {
152
        if (empty($value) || !($value > 0 && $value < 65535)) {
153
            throw new NotFoundException($this->l10n->t('The Redis port number is not specified in the correct format.'));
154
        }
155
    }
156
157
    /**
@@ 164-166 (lines=3) @@
161
     * @throws NotFoundException
162
     */
163
    private function checkRedisDb($value) {
164
        if ($value === '' || !preg_match('/^\d*$/', $value)) {
165
            throw new NotFoundException($this->l10n->t('The Redis DB is not specified in the correct format.'));
166
        }
167
    }
168
}