Skip to content

Commit

Permalink
Merge pull request #326 from loic425/feature/fix-missing-param-types
Browse files Browse the repository at this point in the history
Fix missing param types
  • Loading branch information
loic425 committed Apr 26, 2021
2 parents fa2c873 + 7a6390d commit ade200d
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ public function it_allows_to_change_password()
$this->assertLoginWithCredentials($customer->getEmail(), 'monofony');
}

private function assertLoginWithCredentials($username, $password): void
/**
* @param null|string $username
*/
private function assertLoginWithCredentials(?string $username, string $password): void
{
$data =
<<<EOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function it_allows_to_update_user_profile()
$this->assertLoginWithCredentials('inigo.montoya@prepare-to-die.com', 'sylius');
}

private function assertLoginWithCredentials($username, $password): void
private function assertLoginWithCredentials(string $username, string $password): void
{
$data =
<<<EOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(InputInterface $input, OutputInterface $output, Appl
*
* @throws \Exception
*/
public function runCommand($command, $parameters = [], OutputInterface $output = null)
public function runCommand(string $command, $parameters = [], OutputInterface $output = null)
{
$parameters = array_merge(
['command' => $command],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ class InstallCommand extends Command
{
private DirectoryChecker $directoryChecker;
private string $cacheDir;

/**
* @var CommandExecutor|null
*/
private $commandExecutor;
private ?CommandExecutor $commandExecutor = null;

/**
* @var string[][]
Expand Down Expand Up @@ -110,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
/**
* @return string
*/
private function getProperFinalMessage($errored)
private function getProperFinalMessage(bool $errored)
{
if ($errored) {
return '<info>AppName has been installed, but some error occurred.</info>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ public function iFollowLinkOnMyEmailToResetPassword(UserInterface $user): void

/**
* @When I specify the username as :username
*
* @param null|string $username
*/
public function iSpecifyTheUsername($username = null): void
public function iSpecifyTheUsername(?string $username = null): void
{
$this->loginPage->specifyUsername($username);
}
Expand All @@ -88,8 +90,10 @@ public function iSpecifyTheEmail($email = null): void
/**
* @When I specify the password as :password
* @When I do not specify the password
*
* @param null|string $password
*/
public function iSpecifyThePasswordAs($password = null): void
public function iSpecifyThePasswordAs(?string $password = null): void
{
$this->loginPage->specifyPassword($password);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function getRouteName(): string
return 'sylius_frontend_account_change_password';
}

public function checkValidationMessageFor($element, $message): bool
public function checkValidationMessageFor(string $element, string $message): bool
{
$errorLabel = $this->getElement($element)->getParent()->find('css', '.sylius-validation-error');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function getDefinedElements(): array
]);
}

private function hasValueInCustomerSection($value): bool
private function hasValueInCustomerSection(string $value): bool
{
$customerText = $this->getElement('customer')->getText();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ public function specifyLastName(?string $lastName): void
$this->getDocument()->fillField('Last name', $lastName);
}

public function verifyPassword($password): void
/**
* @param null|string $password
*/
public function verifyPassword(?string $password): void
{
$this->getDocument()->fillField('Verification', $password);
}
Expand Down

0 comments on commit ade200d

Please sign in to comment.