Skip to content

Commit 7be968a

Browse files
[10.x] Fixes AboutCommand::format() docblock (#49274)
* [10.x] Fixes `AboutCommand::format()` docblock Signed-off-by: Mior Muhammad Zaki <[email protected]> * Apply fixes from StyleCI --------- Signed-off-by: Mior Muhammad Zaki <[email protected]> Co-authored-by: StyleCI Bot <[email protected]>
1 parent 81d5ed9 commit 7be968a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/Illuminate/Foundation/Console/AboutCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ protected function sections()
273273
* Materialize a function that formats a given value for CLI or JSON output.
274274
*
275275
* @param mixed $value
276-
* @param (\Closure():(mixed))|null $console
277-
* @param (\Closure():(mixed))|null $json
276+
* @param (\Closure(mixed):(mixed))|null $console
277+
* @param (\Closure(mixed):(mixed))|null $json
278278
* @return \Closure(bool):mixed
279279
*/
280280
public static function format($value, Closure $console = null, Closure $json = null)

types/Foundation/AboutCommand.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
use Illuminate\Foundation\Console\AboutCommand;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
$format = AboutCommand::format(true, console: fn ($value) => $value ? '<fg=yellow;options=bold>ENABLED</>' : 'OFF');
8+
9+
assertType('Closure(bool): mixed', $format);
10+
assertType('mixed', $format(false));
11+
assertType('mixed', $format(true));

0 commit comments

Comments
 (0)