|
13 | 13 | use Salient\Contract\Console\ConsoleMessageType as MessageType; |
14 | 14 | use Salient\Contract\Console\ConsoleTag as Tag; |
15 | 15 | use Salient\Contract\Core\MessageLevel as Level; |
16 | | -use Salient\Core\Concern\HasImmutableProperties; |
| 16 | +use Salient\Core\Concern\HasMutator; |
17 | 17 | use Salient\Utility\Regex; |
18 | 18 | use Salient\Utility\Str; |
19 | 19 | use LogicException; |
|
24 | 24 | */ |
25 | 25 | final class ConsoleFormatter implements FormatterInterface |
26 | 26 | { |
27 | | - use HasImmutableProperties; |
| 27 | + use HasMutator; |
28 | 28 |
|
29 | 29 | public const DEFAULT_LEVEL_PREFIX_MAP = [ |
30 | 30 | Level::EMERGENCY => '! ', // U+0021 |
@@ -189,23 +189,23 @@ public function withSpinnerState(?array &$state) |
189 | 189 | */ |
190 | 190 | public function withUnescape(bool $value = true) |
191 | 191 | { |
192 | | - return $this->withPropertyValue('TagFormats', $this->TagFormats->withUnescape($value)); |
| 192 | + return $this->with('TagFormats', $this->TagFormats->withUnescape($value)); |
193 | 193 | } |
194 | 194 |
|
195 | 195 | /** |
196 | 196 | * @inheritDoc |
197 | 197 | */ |
198 | 198 | public function withWrapAfterApply(bool $value = true) |
199 | 199 | { |
200 | | - return $this->withPropertyValue('TagFormats', $this->TagFormats->withWrapAfterApply($value)); |
| 200 | + return $this->with('TagFormats', $this->TagFormats->withWrapAfterApply($value)); |
201 | 201 | } |
202 | 202 |
|
203 | 203 | /** |
204 | 204 | * @inheritDoc |
205 | 205 | */ |
206 | 206 | public function getTagFormat($tag): Format |
207 | 207 | { |
208 | | - return $this->TagFormats->get($tag); |
| 208 | + return $this->TagFormats->getFormat($tag); |
209 | 209 | } |
210 | 210 |
|
211 | 211 | /** |
@@ -583,11 +583,11 @@ public function formatMessage( |
583 | 583 | public function formatDiff(string $diff): string |
584 | 584 | { |
585 | 585 | $formats = [ |
586 | | - '---' => $this->TagFormats->get(Tag::DIFF_HEADER), |
587 | | - '+++' => $this->TagFormats->get(Tag::DIFF_HEADER), |
588 | | - '@' => $this->TagFormats->get(Tag::DIFF_RANGE), |
589 | | - '+' => $this->TagFormats->get(Tag::DIFF_ADDITION), |
590 | | - '-' => $this->TagFormats->get(Tag::DIFF_REMOVAL), |
| 586 | + '---' => $this->TagFormats->getFormat(Tag::DIFF_HEADER), |
| 587 | + '+++' => $this->TagFormats->getFormat(Tag::DIFF_HEADER), |
| 588 | + '@' => $this->TagFormats->getFormat(Tag::DIFF_RANGE), |
| 589 | + '+' => $this->TagFormats->getFormat(Tag::DIFF_ADDITION), |
| 590 | + '-' => $this->TagFormats->getFormat(Tag::DIFF_REMOVAL), |
591 | 591 | ]; |
592 | 592 |
|
593 | 593 | return Regex::replaceCallback( |
|
0 commit comments