mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-05-02 20:58:05 +02:00
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.
16 lines
251 B
PHP
16 lines
251 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Behavioral\Mediator;
|
|
|
|
abstract class Colleague
|
|
{
|
|
protected Mediator $mediator;
|
|
|
|
final public function setMediator(Mediator $mediator)
|
|
{
|
|
$this->mediator = $mediator;
|
|
}
|
|
}
|