Code Duplication    Length = 7-8 lines in 8 locations

Commons/TraitForResponse.inc 8 locations

@@ 389-396 (lines=8) @@
386
     * @param resource $context            
387
     * @param string $append_msg            
388
     */
389
    public function emergency($code = 1, $append_msg = false, $context = false)
390
    {
391
        $to_file = true;
392
        if ($this->getLogLevel() < 1)
393
            $to_file = false;
394
        
395
        $this->addTrace('EMERGENCY', $code, $context, $append_msg, $to_file);
396
    }
397
398
    /**
399
     * Action must be taken immediately.
@@ 409-415 (lines=7) @@
406
     * @param string $append_msg            
407
     * @return null
408
     */
409
    public function alert($code = 2, $append_msg = false, $context = false)
410
    {
411
        $to_file = true;
412
        if ($this->getLogLevel() < 2)
413
            $to_file = false;
414
        $this->addTrace('ALERT', $code, $context, $append_msg, $to_file);
415
    }
416
417
    /**
418
     * Critical conditions.
@@ 427-433 (lines=7) @@
424
     * @param string $append_msg            
425
     * @return null
426
     */
427
    public function critical($code = 3, $append_msg = false, $context = false)
428
    {
429
        $to_file = true;
430
        if ($this->getLogLevel() < 3)
431
            $to_file = false;
432
        $this->addTrace('CRITICAL', $code, $context, $append_msg, $to_file);
433
    }
434
435
    /**
436
     * Runtime errors that do not require immediate action but should typically
@@ 445-451 (lines=7) @@
442
     *
443
     * @return null
444
     */
445
    public function error($code = 4, $append_msg = false, $context = false)
446
    {
447
        $to_file = true;
448
        if ($this->getLogLevel() < 4)
449
            $to_file = false;
450
        $this->addTrace('ERROR', $code, $context, $append_msg, $to_file);
451
    }
452
453
    /**
454
     * Exceptional occurrences that are not errors.
@@ 464-470 (lines=7) @@
461
     * @param string $append_msg            
462
     * @return null
463
     */
464
    public function warning($code = 5, $append_msg = false, $context = false)
465
    {
466
        $to_file = true;
467
        if ($this->getLogLevel() < 5)
468
            $to_file = false;
469
        $this->addTrace('WARNING', $code, $context, $append_msg, $to_file);
470
    }
471
472
    /**
473
     * Normal but significant events.
@@ 481-487 (lines=7) @@
478
     *
479
     * @return null
480
     */
481
    public function notice($code = 6, $append_msg = false, $context = false)
482
    {
483
        $to_file = true;
484
        if ($this->getLogLevel() < 6)
485
            $to_file = false;
486
        $this->addTrace('NOTICE', $code, $context, $append_msg, $to_file);
487
    }
488
489
    /**
490
     * Interesting events.
@@ 500-506 (lines=7) @@
497
     *
498
     * @return null
499
     */
500
    public function info($code = 7, $append_msg = false, $context = false)
501
    {
502
        $to_file = true;
503
        if ($this->getLogLevel() < 7)
504
            $to_file = false;
505
        $this->addTrace('INFO', $code, $context, $append_msg, $to_file);
506
    }
507
508
    /**
509
     * Detailed debug information.
@@ 517-523 (lines=7) @@
514
     *
515
     * @return null
516
     */
517
    public function debug($code = 8, $append_msg = false, $context = false)
518
    {
519
        $to_file = true;
520
        if ($this->getLogLevel() < 8)
521
            $to_file = false;
522
        $this->addTrace('DEBUG', $code, $context, $append_msg, $to_file);
523
    }
524
}
525