Skip to content

Commit

Permalink
Added more type hints and removed PHPdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Jul 20, 2018
1 parent 36d6828 commit 4f177c3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Command/AddUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private function validateUserData($username, $plainPassword, $email, $fullName)
* it's too long, it's better to define a separate method to maintain the
* code readability.
*/
private function getCommandHelp()
private function getCommandHelp(): string
{
return <<<'HELP'
The <info>%command.name%</info> command creates new users and saves them in the database:
Expand Down
5 changes: 1 addition & 4 deletions src/Command/ListUsersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,8 @@ protected function execute(InputInterface $input, OutputInterface $output)

/**
* Sends the given $contents to the $recipient email address.
*
* @param string $contents
* @param string $recipient
*/
private function sendReport($contents, $recipient)
private function sendReport(string $contents, string $recipient): void
{
// See https://symfony.com/doc/current/cookbook/email/email.html
$message = $this->mailer->createMessage()
Expand Down
2 changes: 1 addition & 1 deletion src/Twig/AppExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AppExtension extends AbstractExtension
private $localeCodes;
private $locales;

public function __construct(Markdown $parser, $locales)
public function __construct(Markdown $parser, string $locales)
{
$this->parser = $parser;
$this->localeCodes = explode('|', $locales);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ private function getMockedTransformer(array $findByReturnValues = []): TagArrayT

/**
* This helper method creates a Tag instance for the given tag name.
*
* @param string $name
*/
private function createTag($name): Tag
private function createTag(string $name): Tag
{
$tag = new Tag();
$tag->setName($name);
Expand Down

0 comments on commit 4f177c3

Please sign in to comment.