mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-16 21:01:16 +02:00
30 lines
536 B
PHP
30 lines
536 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Structural\Bridge;
|
|
|
|
abstract class Service
|
|
{
|
|
/**
|
|
* @var Formatter
|
|
*/
|
|
protected $implementation;
|
|
|
|
/**
|
|
* @param Formatter $printer
|
|
*/
|
|
public function __construct(Formatter $printer)
|
|
{
|
|
$this->implementation = $printer;
|
|
}
|
|
|
|
/**
|
|
* @param Formatter $printer
|
|
*/
|
|
public function setImplementation(Formatter $printer)
|
|
{
|
|
$this->implementation = $printer;
|
|
}
|
|
|
|
abstract public function get(): string;
|
|
}
|