mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-13 18:34:06 +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:
@@ -6,7 +6,7 @@ namespace DesignPatterns\Creational\Builder\Parts;
|
||||
|
||||
abstract class Vehicle
|
||||
{
|
||||
public function setPart(string $key, object $value)
|
||||
final public function setPart(string $key, object $value)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user