Code Duplication    Length = 92-93 lines in 2 locations

lib/Command/Index.php 1 location

@@ 430-522 (lines=93) @@
427
	/**
428
	 *
429
	 */
430
	private function generatePanels() {
431
432
		$this->cliService->createPanel(
433
			self::PANEL_RUN,
434
			[
435
				self::PANEL_RUN_LINE_OPTIONS,
436
				self::PANEL_RUN_LINE_MEMORY
437
			]
438
		);
439
		$this->cliService->createPanel(
440
			self::PANEL_INDEX, [
441
								 self::PANEL_INDEX_LINE_HEADER,
442
								 self::PANEL_INDEX_LINE_ACCOUNT,
443
								 self::PANEL_INDEX_LINE_ACTION,
444
								 self::PANEL_INDEX_LINE_DOCUMENT,
445
								 self::PANEL_INDEX_LINE_INFO,
446
								 self::PANEL_INDEX_LINE_TITLE,
447
								 self::PANEL_INDEX_LINE_CONTENT,
448
								 self::PANEL_INDEX_LINE_RESULT,
449
								 self::PANEL_INDEX_LINE_FOOTER,
450
							 ]
451
		);
452
453
		$this->cliService->createPanel(
454
			self::PANEL_STATUS, [
455
								  self::PANEL_STATUS_LINE_HEADER,
456
								  self::PANEL_STATUS_LINE_DOCUMENTS,
457
								  self::PANEL_STATUS_LINE_ERRORS,
458
								  self::PANEL_STATUS_LINE_ERROR_EXCEPTION,
459
								  self::PANEL_STATUS_LINE_ERROR_MESSAGE1,
460
								  self::PANEL_STATUS_LINE_ERROR_MESSAGE2,
461
								  self::PANEL_STATUS_LINE_ERROR_MESSAGE3,
462
								  self::PANEL_STATUS_LINE_ERROR_INDEX,
463
								  self::PANEL_STATUS_LINE_FOOTER,
464
							  ]
465
		);
466
467
		$this->cliService->createPanel(
468
			self::PANEL_COMMANDS_ROOT, [
469
										 self::PANEL_COMMANDS_ROOT_LINE
470
									 ]
471
		);
472
473
		$this->cliService->createPanel(
474
			self::PANEL_COMMANDS_PAUSED, [
475
										   self::PANEL_COMMANDS_PAUSED_LINE
476
									   ]
477
		);
478
479
		$this->cliService->createPanel(
480
			self::PANEL_COMMANDS_ERRORS, [
481
										   self::PANEL_COMMANDS_ERRORS_LINE
482
									   ]
483
		);
484
485
		$this->cliService->initDisplay();
486
		$this->cliService->displayPanel('run', self::PANEL_RUN);
487
		$this->cliService->displayPanel('topPanel', self::PANEL_INDEX);
488
		$this->cliService->displayPanel('bottomPanel', self::PANEL_STATUS);
489
490
		$this->cliService->displayPanel('errors', self::PANEL_COMMANDS_ERRORS);
491
492
		if ($this->runner->isPaused()) {
493
			$this->cliService->displayPanel('commands', self::PANEL_COMMANDS_PAUSED);
494
		} else {
495
			$this->cliService->displayPanel('commands', self::PANEL_COMMANDS_ROOT);
496
		}
497
498
		$this->runner->setInfoArray(
499
			[
500
				'userId'         => '',
501
				'providerName'   => '',
502
				'_memory'        => '',
503
				'documentId'     => '',
504
				'action'         => '',
505
				'info'           => '',
506
				'title'          => '',
507
				'_paused'        => '',
508
				'content'        => '',
509
				'resultColored'  => '',
510
				'documentLeft'   => '',
511
				'documentTotal'  => '',
512
				'progressStatus' => '',
513
				'errorCurrent'   => '0',
514
				'errorTotal'     => '0',
515
				'errorMessageA'  => '',
516
				'errorMessageB'  => '',
517
				'errorMessageC'  => '',
518
				'errorException' => '',
519
				'errorIndex'     => ''
520
			]
521
		);
522
	}
523
524
525
	/**

lib/Command/Live.php 1 location

@@ 336-427 (lines=92) @@
333
	/**
334
	 *
335
	 */
336
	private function generatePanels() {
337
338
		$this->cliService->createPanel(
339
			self::PANEL_RUN,
340
			[
341
				self::PANEL_RUN_LINE_MEMORY
342
			]
343
		);
344
		$this->cliService->createPanel(
345
			self::PANEL_INDEX, [
346
								 self::PANEL_INDEX_LINE_HEADER,
347
								 self::PANEL_INDEX_LINE_ACCOUNT,
348
								 self::PANEL_INDEX_LINE_ACTION,
349
								 self::PANEL_INDEX_LINE_DOCUMENT,
350
								 self::PANEL_INDEX_LINE_INFO,
351
								 self::PANEL_INDEX_LINE_TITLE,
352
								 self::PANEL_INDEX_LINE_CONTENT,
353
								 self::PANEL_INDEX_LINE_RESULT,
354
								 self::PANEL_INDEX_LINE_FOOTER,
355
							 ]
356
		);
357
358
		$this->cliService->createPanel(
359
			self::PANEL_STATUS, [
360
								  self::PANEL_STATUS_LINE_HEADER,
361
								  self::PANEL_STATUS_LINE_DOCUMENTS,
362
								  self::PANEL_STATUS_LINE_ERRORS,
363
								  self::PANEL_STATUS_LINE_ERROR_EXCEPTION,
364
								  self::PANEL_STATUS_LINE_ERROR_MESSAGE1,
365
								  self::PANEL_STATUS_LINE_ERROR_MESSAGE2,
366
								  self::PANEL_STATUS_LINE_ERROR_MESSAGE3,
367
								  self::PANEL_STATUS_LINE_ERROR_INDEX,
368
								  self::PANEL_STATUS_LINE_FOOTER,
369
							  ]
370
		);
371
372
		$this->cliService->createPanel(
373
			self::PANEL_COMMANDS_ROOT, [
374
										 self::PANEL_COMMANDS_ROOT_LINE
375
									 ]
376
		);
377
378
		$this->cliService->createPanel(
379
			self::PANEL_COMMANDS_PAUSED, [
380
										   self::PANEL_COMMANDS_PAUSED_LINE
381
									   ]
382
		);
383
384
		$this->cliService->createPanel(
385
			self::PANEL_COMMANDS_ERRORS, [
386
										   self::PANEL_COMMANDS_ERRORS_LINE
387
									   ]
388
		);
389
390
		$this->cliService->initDisplay();
391
		$this->cliService->displayPanel('run', self::PANEL_RUN);
392
		$this->cliService->displayPanel('topPanel', self::PANEL_INDEX);
393
		$this->cliService->displayPanel('bottomPanel', self::PANEL_STATUS);
394
395
		$this->cliService->displayPanel('errors', self::PANEL_COMMANDS_ERRORS);
396
397
		if ($this->runner->isPaused()) {
398
			$this->cliService->displayPanel('commands', self::PANEL_COMMANDS_PAUSED);
399
		} else {
400
			$this->cliService->displayPanel('commands', self::PANEL_COMMANDS_ROOT);
401
		}
402
403
		$this->runner->setInfoArray(
404
			[
405
				'userId'         => '',
406
				'providerName'   => '',
407
				'_memory'        => '',
408
				'documentId'     => '',
409
				'action'         => '',
410
				'info'           => '',
411
				'title'          => '',
412
				'_paused'        => '',
413
				'content'        => '',
414
				'resultColored'  => '',
415
				'documentLeft'   => '',
416
				'documentTotal'  => '',
417
				'progressStatus' => '',
418
				'errorCurrent'   => '0',
419
				'errorTotal'     => '0',
420
				'errorMessageA'  => '',
421
				'errorMessageB'  => '',
422
				'errorMessageC'  => '',
423
				'errorException' => '',
424
				'errorIndex'     => ''
425
			]
426
		);
427
	}
428
429
430
	/**