Skip to content

Commit 4a12d1f

Browse files
authored
[TASK] Deprecate method forwarding OutputFormat to OutputFormatter (#894)
Instead, the corresponding method on the formatter should be called directly. This increases type safety and helps static code analysis. Also, it makes the code easier to understand.
1 parent 44f1b25 commit 4a12d1f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Please also have a look at our
3434

3535
### Deprecated
3636

37+
- Deprecate magic method forwarding from `OutputFormat` to `OutputFormatter`
38+
(#894)
3739
- Deprecate greedy calculation of selector specificity (#1018)
3840
- Deprecate `__toString()` (#1006)
3941
- `OutputFormat` properties for space around list separators as an array (#880)

src/OutputFormat.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ public function set($aNames, $mValue)
244244
public function __call(string $sMethodName, array $aArguments)
245245
{
246246
if (\method_exists(OutputFormatter::class, $sMethodName)) {
247+
// @deprecated since 8.8.0, will be removed in 9.0.0. Call the method on the formatter directly instead.
247248
return \call_user_func_array([$this->getFormatter(), $sMethodName], $aArguments);
248249
} else {
249250
throw new \Exception('Unknown OutputFormat method called: ' . $sMethodName);

0 commit comments

Comments
 (0)