Skip to content

Commit c22d48e

Browse files
mdeboerwouterj
authored andcommitted
Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm
1 parent f3851b7 commit c22d48e

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

Command/Command.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Component\Console\Exception\ExceptionInterface;
2020
use Symfony\Component\Console\Exception\InvalidArgumentException;
2121
use Symfony\Component\Console\Exception\LogicException;
22+
use Symfony\Component\Console\Helper\HelperInterface;
2223
use Symfony\Component\Console\Helper\HelperSet;
2324
use Symfony\Component\Console\Input\InputArgument;
2425
use Symfony\Component\Console\Input\InputDefinition;
@@ -677,6 +678,8 @@ public function getUsages(): array
677678
/**
678679
* Gets a helper instance by name.
679680
*
681+
* @return HelperInterface
682+
*
680683
* @throws LogicException if no HelperSet is defined
681684
* @throws InvalidArgumentException if the helper is not defined
682685
*/

Command/LazyCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Console\Completion\CompletionInput;
1616
use Symfony\Component\Console\Completion\CompletionSuggestions;
1717
use Symfony\Component\Console\Completion\Suggestion;
18+
use Symfony\Component\Console\Helper\HelperInterface;
1819
use Symfony\Component\Console\Helper\HelperSet;
1920
use Symfony\Component\Console\Input\InputDefinition;
2021
use Symfony\Component\Console\Input\InputInterface;
@@ -176,7 +177,7 @@ public function getUsages(): array
176177
return $this->getCommand()->getUsages();
177178
}
178179

179-
public function getHelper(string $name): mixed
180+
public function getHelper(string $name): HelperInterface
180181
{
181182
return $this->getCommand()->getHelper($name);
182183
}

Helper/HelperSet.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
*
1919
* @author Fabien Potencier <[email protected]>
2020
*
21-
* @implements \IteratorAggregate<string, Helper>
21+
* @implements \IteratorAggregate<string, HelperInterface>
2222
*/
2323
class HelperSet implements \IteratorAggregate
2424
{
25-
/** @var array<string, Helper> */
25+
/** @var array<string, HelperInterface> */
2626
private array $helpers = [];
2727

2828
/**
29-
* @param Helper[] $helpers An array of helper
29+
* @param HelperInterface[] $helpers
3030
*/
3131
public function __construct(array $helpers = [])
3232
{

Output/OutputInterface.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@ interface OutputInterface
3333
/**
3434
* Writes a message to the output.
3535
*
36-
* @param $newline Whether to add a newline
37-
* @param $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
36+
* @param bool $newline Whether to add a newline
37+
* @param self::VERBOSITY_*|self::OUTPUT_* $options A bitmask of options (one of the OUTPUT or VERBOSITY constants),
38+
* 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
3839
*/
3940
public function write(string|iterable $messages, bool $newline = false, int $options = 0);
4041

4142
/**
4243
* Writes a message to the output and adds a newline at the end.
4344
*
44-
* @param $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
45+
* @param self::VERBOSITY_*|self::OUTPUT_* $options A bitmask of options (one of the OUTPUT or VERBOSITY constants),
46+
* 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
4547
*/
4648
public function writeln(string|iterable $messages, int $options = 0);
4749

0 commit comments

Comments
 (0)