| Total Complexity | 3 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | abstract class Mailcode_Parser_Safeguard_FormatterLocation |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * @var Mailcode_Parser_Safeguard_Formatter |
||
| 27 | */ |
||
| 28 | protected $formatter; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var Mailcode_Parser_Safeguard_Placeholder_Locator_Location |
||
| 32 | */ |
||
| 33 | protected $location; |
||
| 34 | |||
| 35 | public function __construct(Mailcode_Parser_Safeguard_Formatter $formatter, Mailcode_Parser_Safeguard_Placeholder_Locator_Location $location) |
||
| 36 | { |
||
| 37 | $this->formatter = $formatter; |
||
| 38 | $this->location = $location; |
||
| 39 | |||
| 40 | $this->init(); |
||
| 41 | } |
||
| 42 | |||
| 43 | abstract protected function init() : void; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Whether this specific placeholder location needs to be adjusted. |
||
| 47 | * |
||
| 48 | * @return bool |
||
| 49 | */ |
||
| 50 | abstract public function requiresAdjustment() : bool; |
||
| 51 | |||
| 52 | abstract protected function getAdjustedText() : string; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Retrieves the placeholder text, adjusted as needed by the |
||
| 56 | * formatter. If no adjustments are required, this will simply |
||
| 57 | * return the vanilla placeholder string. |
||
| 58 | * |
||
| 59 | * @return string |
||
| 60 | */ |
||
| 61 | public function getPlaceholderText() : string |
||
| 71 | } |
||
| 72 | } |
||
| 73 |