Skip to content

Commit 8e900ef

Browse files
committed
[TASK] Deprecate method forwarding OutputFormat to OutputFormatter
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 17dd3cb commit 8e900ef

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
@@ -31,6 +31,8 @@ Please also have a look at our
3131

3232
### Deprecated
3333

34+
- Deprecate magic method forwarding from `OutputFormat` to `OutputFormatter`
35+
(#894)
3436
- `OutputFormat` properties for space around list separators as an array (#880)
3537

3638
### Removed

src/OutputFormat.php

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

0 commit comments

Comments
 (0)