Move common appender methods to parent class
--------------------------------------------

                 Key: LOG4PHP-151
                 URL: https://issues.apache.org/jira/browse/LOG4PHP-151
             Project: Log4php
          Issue Type: Improvement
          Components: Code
    Affects Versions: 2.1
            Reporter: Ivan Habunek
            Assignee: Ivan Habunek
            Priority: Minor
             Fix For: 2.2


Some identical methods are repeated in many appender classes. These should be 
moved to the parent LoggerAppender abstract class. 

The default constructor and destructor are often repeated in each appender 
class, or they only call the parent contructor/destructor explicitely which is 
not required. The default implemetnations of these are:

public function __construct($name = '') {
        $this->name = $name;
}

public function __destruct() {
        $this->close();
}

Also, many of the appenders have the following implementation of 
activateOptions() and close():

public function activateOptions() {
        $this->closed = false;
}

public function __destruct() {
        $this->close();
}

These 4 functions can be moved to the parent class LoggerAppender, and removed 
from the subclasses which use the default implementation.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to