Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Fixes AboutCommand::format() docblock #49274

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));