mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-30 19:50:12 +02:00
Final public method for abstract class
All public methods of abstract classes should be final. Enforce API encapsulation in an inheritance architecture. If you want to override a method, use the Template method pattern.
This commit is contained in:
@@ -10,7 +10,7 @@ abstract class Service
|
||||
{
|
||||
}
|
||||
|
||||
public function setImplementation(Formatter $printer)
|
||||
final public function setImplementation(Formatter $printer)
|
||||
{
|
||||
$this->implementation = $printer;
|
||||
}
|
||||
|
Reference in New Issue
Block a user