Skip to content

Commit

Permalink
[10.x] Fixes AboutCommand::format() docblock (#49274)
Browse files Browse the repository at this point in the history
* [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]>
  • Loading branch information
crynobone and StyleCIBot authored Dec 7, 2023
1 parent 81d5ed9 commit 7be968a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Console/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ protected function sections()
* Materialize a function that formats a given value for CLI or JSON output.
*
* @param mixed $value
* @param (\Closure():(mixed))|null $console
* @param (\Closure():(mixed))|null $json
* @param (\Closure(mixed):(mixed))|null $console
* @param (\Closure(mixed):(mixed))|null $json
* @return \Closure(bool):mixed
*/
public static function format($value, Closure $console = null, Closure $json = null)
Expand Down
11 changes: 11 additions & 0 deletions types/Foundation/AboutCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

use Illuminate\Foundation\Console\AboutCommand;

use function PHPStan\Testing\assertType;

$format = AboutCommand::format(true, console: fn ($value) => $value ? '<fg=yellow;options=bold>ENABLED</>' : 'OFF');

assertType('Closure(bool): mixed', $format);
assertType('mixed', $format(false));
assertType('mixed', $format(true));

0 comments on commit 7be968a

Please sign in to comment.