Skip to content

Commit 6183f0b

Browse files
wiewiurdpMateuszKolankowski
andauthored
IBX-10507: Allowed nullable type declarations for method parameters across the codebase (#154)
Co-authored-by: MateuszKolankowski <wiewiurdp@tlen. pl>
1 parent 5e76d7c commit 6183f0b

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/lib/API/Context/UserContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function createUseGroup(string $userGroupName): void
4242
* @Given I create a user :userName with last name :userLastName with email :userEmail
4343
* @Given I create a user :userName with last name :userLastName in group :userGroupName with email :userEmail
4444
*/
45-
public function createUserInGroupWithEmail(string $userName, string $userLastName, string $userGroupName = null, string $userEmail = null): void
45+
public function createUserInGroupWithEmail(string $userName, string $userLastName, ?string $userGroupName = null, ?string $userEmail = null): void
4646
{
4747
$this->userFacade->createUser($userName, $userLastName, $userGroupName, $userEmail);
4848
}
@@ -81,7 +81,7 @@ public function assignUserGroupToRoleIfPossible(string $userGroupName, string $r
8181
* @Given I assign user group :groupName to role :roleName
8282
* @Given I assign user group :groupName to role :roleName with limitations:
8383
*/
84-
public function assignUserGroupToRole(string $userGroupName, string $roleName, TableNode $limitationData = null): void
84+
public function assignUserGroupToRole(string $userGroupName, string $roleName, ?TableNode $limitationData = null): void
8585
{
8686
$parsedLimitations = null === $limitationData ? null : $this->argumentParser->parseLimitations($limitationData);
8787

src/lib/Browser/Context/AuthenticationContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(LoginPage $loginPage, RedirectLoginPage $redirectLog
3131
* @Given I log in as :username
3232
* @Given I log in as :username with password :password
3333
*/
34-
public function iLogInIn(string $username, string $password = null)
34+
public function iLogInIn(string $username, ?string $password = null)
3535
{
3636
$password = $password ?? PasswordProvider::DEFAUlT_PASSWORD;
3737
$this->loginPage->loginSuccessfully($username, $password);
@@ -59,7 +59,7 @@ public function loggedAsAdmin()
5959
* @Given I am viewing the pages on siteaccess :siteaccess as :username :password
6060
* @Given I am viewing the pages on siteaccess :siteaccess as :username with password :password
6161
*/
62-
public function iAmViewingThePagesAsUserOnSiteaccess(string $siteaccess, string $username, string $password = null)
62+
public function iAmViewingThePagesAsUserOnSiteaccess(string $siteaccess, string $username, ?string $password = null)
6363
{
6464
$this->loginPage->open($siteaccess);
6565
$this->loginPage->logout($siteaccess);

src/lib/Core/Context/ConfigurationContext.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function iAddSiteaccessWithSettings($siteaccessName, $siteaccessGroup, Ta
6464
*
6565
* @param mixed $siteaccessName
6666
*/
67-
public function iAppendOrSetConfigurationToSiteaccess(string $mode, $siteaccessName, TableNode $settings, string $configFilePath = null)
67+
public function iAppendOrSetConfigurationToSiteaccess(string $mode, $siteaccessName, TableNode $settings, ?string $configFilePath = null)
6868
{
6969
$appendToExisting = $this->shouldAppendValue($mode);
7070

@@ -92,7 +92,7 @@ public function iAppendOrSetConfigurationToSiteaccess(string $mode, $siteaccessN
9292
*
9393
* @param mixed $parentNode
9494
*/
95-
public function iModifyConfigurationUnderKey(string $mode, $parentNode, PyStringNode $configFragment, string $configFilePath = null)
95+
public function iModifyConfigurationUnderKey(string $mode, $parentNode, PyStringNode $configFragment, ?string $configFilePath = null)
9696
{
9797
$appendToExisting = $this->shouldAppendValue($mode);
9898

@@ -160,7 +160,7 @@ private function shouldAppendValue(string $value): bool
160160
* @Given I copy the configuration from :keyName to :newKeyName
161161
* @Given I copy the configuration from :keyName to :newKeyName in :configFilePath
162162
*/
163-
public function iCopyTheConfigurationFromTo(string $keyName, string $newKeyName, string $configFilePath = null)
163+
public function iCopyTheConfigurationFromTo(string $keyName, string $newKeyName, ?string $configFilePath = null)
164164
{
165165
$configFilePath = $configFilePath ? sprintf('%s/%s', $this->projectDir, $configFilePath) : $this->mainProjectConfigFilePath;
166166
$config = $this->configurationEditor->getConfigFromFile($configFilePath);

tests/bundle/Form/Stub/UnstableChoiceListFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ public function __construct(int $successfulCallAfterNthTry)
3030
$this->successfulCallAfterNthTry = $successfulCallAfterNthTry;
3131
}
3232

33-
public function createListFromChoices(iterable $choices, callable $value = null)
33+
public function createListFromChoices(iterable $choices, ?callable $value = null)
3434
{
3535
++$this->createListFromChoicesCounter;
3636
$this->failIfNeeded($this->createListFromChoicesCounter);
3737

3838
return new ArrayChoiceList([]);
3939
}
4040

41-
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null)
41+
public function createListFromLoader(ChoiceLoaderInterface $loader, ?callable $value = null)
4242
{
4343
++$this->createListFromLoaderCounter;
4444
$this->failIfNeeded($this->createListFromLoaderCounter);
4545

4646
return new ArrayChoiceList([]);
4747
}
4848

49-
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null)
49+
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, ?callable $index = null, ?callable $groupBy = null, $attr = null)
5050
{
5151
++$this->createViewCounter;
5252
$this->failIfNeeded($this->createViewCounter);

0 commit comments

Comments
 (0)