Code Duplication    Length = 14-15 lines in 2 locations

src/cli/Manager/PersistenceManager.php 2 locations

@@ 272-285 (lines=14) @@
269
	 *
270
	 * @throws \Propel\Runtime\Exception\PropelException
271
	 */
272
	private function onUserSeen($instanceName, $userName)
273
	{
274
		if ($this->hasUser($instanceName, $userName))
275
			return;
276
277
		$user = new User();
278
		$user->setInstanceName($instanceName)->setName($userName);
279
		$user->save();
280
281
		$this->getApplication()->getLogger()->info('Stored new user (instance: {instanceName}, username: {userName})', [
282
			'instanceName' => $instanceName,
283
			'userName'     => $userName,
284
		]);
285
	}
286
287
288
	/**
@@ 294-308 (lines=15) @@
291
	 *
292
	 * @throws \Propel\Runtime\Exception\PropelException
293
	 */
294
	private function onChannelSeen($instanceName, $channelName)
295
	{
296
		if ($this->hasChannel($instanceName, $channelName))
297
			return;
298
299
		$channel = new Channel();
300
		$channel->setInstanceName($instanceName)->setName($channelName);
301
		$channel->save();
302
303
		$this->getApplication()->getLogger()
304
		     ->info('Stored new channel (instance: {instanceName}, name: {channelName})', [
305
			     'instanceName' => $instanceName,
306
			     'channelName'  => $channelName,
307
		     ]);
308
	}
309
310
311
	/**