Skip to content

Commit 7eaff0d

Browse files
committed
minor #839 Added more type hints and removed PHPdoc (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Added more type hints and removed PHPdoc A follow-up of #837 after this comment from @stof: https://github.com/symfony/demo/pull/837/files/f8483c27636eafa5a56302ba6daac04dcd36e8fa#r204007113 Commits ------- 4f177c3 Added more type hints and removed PHPdoc
2 parents 7de819c + 4f177c3 commit 7eaff0d

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

src/Command/AddUserCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ private function validateUserData($username, $plainPassword, $email, $fullName)
230230
* it's too long, it's better to define a separate method to maintain the
231231
* code readability.
232232
*/
233-
private function getCommandHelp()
233+
private function getCommandHelp(): string
234234
{
235235
return <<<'HELP'
236236
The <info>%command.name%</info> command creates new users and saves them in the database:

src/Command/ListUsersCommand.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
127127

128128
/**
129129
* Sends the given $contents to the $recipient email address.
130-
*
131-
* @param string $contents
132-
* @param string $recipient
133130
*/
134-
private function sendReport($contents, $recipient)
131+
private function sendReport(string $contents, string $recipient): void
135132
{
136133
// See https://symfony.com/doc/current/cookbook/email/email.html
137134
$message = $this->mailer->createMessage()

src/Twig/AppExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AppExtension extends AbstractExtension
3333
private $localeCodes;
3434
private $locales;
3535

36-
public function __construct(Markdown $parser, $locales)
36+
public function __construct(Markdown $parser, string $locales)
3737
{
3838
$this->parser = $parser;
3939
$this->localeCodes = explode('|', $locales);

tests/Form/DataTransformer/TagArrayToStringTransformerTest.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,8 @@ private function getMockedTransformer(array $findByReturnValues = []): TagArrayT
117117

118118
/**
119119
* This helper method creates a Tag instance for the given tag name.
120-
*
121-
* @param string $name
122120
*/
123-
private function createTag($name): Tag
121+
private function createTag(string $name): Tag
124122
{
125123
$tag = new Tag();
126124
$tag->setName($name);

0 commit comments

Comments
 (0)