Code Duplication    Length = 10-13 lines in 2 locations

lib/private/Authentication/TwoFactorAuth/Manager.php 1 location

@@ 130-139 (lines=10) @@
127
			$info = $this->appManager->getAppInfo($appId);
128
			if (isset($info['two-factor-providers'])) {
129
				$providerClasses = $info['two-factor-providers'];
130
				foreach ($providerClasses as $class) {
131
					try {
132
						$this->loadTwoFactorApp($appId);
133
						$provider = OC::$server->query($class);
134
						$providers[$provider->getId()] = $provider;
135
					} catch (QueryException $exc) {
136
						// Provider class can not be resolved
137
						throw new Exception("Could not load two-factor auth provider $class");
138
					}
139
				}
140
			}
141
		}
142

lib/private/Console/Application.php 1 location

@@ 159-171 (lines=13) @@
156
	}
157
158
	private function loadCommandsFromInfoXml($commands) {
159
		foreach ($commands as $command) {
160
			try {
161
				$c = \OC::$server->query($command);
162
			} catch (QueryException $e) {
163
				if (class_exists($command)) {
164
					$c = new $command();
165
				} else {
166
					throw new \Exception("Console command '$command' is unknown and could not be loaded");
167
				}
168
			}
169
170
			$this->application->add($c);
171
		}
172
	}
173
}
174