Code Duplication    Length = 4-7 lines in 4 locations

apps/files_versions/lib/Expiration.php 2 locations

@@ 149-155 (lines=7) @@
146
147
		$isValid = true;
148
		// Validate
149
		if (!ctype_digit($minValue) && $minValue !== 'auto') {
150
			$isValid = false;
151
			\OC::$server->getLogger()->warning(
152
					$minValue . ' is not a valid value for minimal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.',
153
					['app'=>'files_versions']
154
			);
155
		}
156
157
		if (!ctype_digit($maxValue) && $maxValue !== 'auto') {
158
			$isValid = false;
@@ 157-163 (lines=7) @@
154
			);
155
		}
156
157
		if (!ctype_digit($maxValue) && $maxValue !== 'auto') {
158
			$isValid = false;
159
			\OC::$server->getLogger()->warning(
160
					$maxValue . ' is not a valid value for maximal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.',
161
					['app'=>'files_versions']
162
			);
163
		}
164
165
		if (!$isValid){
166
			$minValue = 'auto';

apps/files_versions/lib/Storage.php 1 location

@@ 723-726 (lines=4) @@
720
		if ($expiration->isEnabled()) {
721
			// get available disk space for user
722
			$user = \OC::$server->getUserManager()->get($uid);
723
			if (is_null($user)) {
724
				\OC::$server->getLogger()->error('Backends provided no user object for ' . $uid, ['app' => 'files_versions']);
725
				throw new \OC\User\NoUserException('Backends provided no user object for ' . $uid);
726
			}
727
728
			\OC_Util::setupFS($uid);
729

lib/private/L10N/L10N.php 1 location

@@ 236-240 (lines=5) @@
233
	 */
234
	protected function load(string $translationFile): bool {
235
		$json = json_decode(file_get_contents($translationFile), true);
236
		if (!\is_array($json)) {
237
			$jsonError = json_last_error();
238
			\OC::$server->getLogger()->warning("Failed to load $translationFile - json error code: $jsonError", ['app' => 'l10n']);
239
			return false;
240
		}
241
242
		if (!empty($json['pluralForm'])) {
243
			$this->pluralFormString = $json['pluralForm'];