Skip to content

Commit adf1c60

Browse files
committed
MC-30537: Test automation with the new 2FA enabled by default
- Static fixes
1 parent 1b99d9b commit adf1c60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+210
-51
lines changed

TwoFactorAuth/Api/CountryRepositoryInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,46 @@
1414

1515
/**
1616
* Countries repository
17+
*
1718
* @SuppressWarnings(PHPMD.ShortVariable)
1819
*/
1920
interface CountryRepositoryInterface
2021
{
2122
/**
2223
* Save object
24+
*
2325
* @param CountryInterface $object
2426
* @return CountryInterface
2527
*/
2628
public function save(CountryInterface $object): CountryInterface;
2729

2830
/**
2931
* Get object by id
32+
*
3033
* @param int $id
3134
* @return CountryInterface
3235
*/
3336
public function getById(int $id): CountryInterface;
3437

3538
/**
3639
* Get by Code value
40+
*
3741
* @param string $value
3842
* @return CountryInterface
3943
*/
4044
public function getByCode(string $value): CountryInterface;
4145

4246
/**
4347
* Delete object
48+
*
4449
* @param CountryInterface $object
4550
* @return void
4651
*/
4752
public function delete(CountryInterface $object): void;
4853

4954
/**
5055
* Get a list of object
56+
*
5157
* @param SearchCriteriaInterface $searchCriteria
5258
* @return CountrySearchResultsInterface
5359
*/

TwoFactorAuth/Api/Data/CountrySearchResultsInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,20 @@
1010
use Magento\Framework\Api\SearchResultsInterface;
1111

1212
/**
13-
* Country search results interface
13+
* Represent country search results
1414
*/
1515
interface CountrySearchResultsInterface extends SearchResultsInterface
1616
{
1717
/**
1818
* Get an array of objects
19+
*
1920
* @return CountryInterface[]
2021
*/
2122
public function getItems(): array;
2223

2324
/**
2425
* Set objects list
26+
*
2527
* @param CountryInterface[] $items
2628
* @return CountrySearchResultsInterface
2729
*/

TwoFactorAuth/Api/Data/UserConfigSearchResultsInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ interface UserConfigSearchResultsInterface extends SearchResultsInterface
1616
{
1717
/**
1818
* Get an array of objects
19+
*
1920
* @return UserConfigInterface[]
2021
*/
2122
public function getItems(): array;
2223

2324
/**
2425
* Set objects list
26+
*
2527
* @param UserConfigInterface[] $items
2628
* @return UserConfigSearchResultsInterface
2729
*/

TwoFactorAuth/Api/EngineInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function isEnabled(): bool;
2424

2525
/**
2626
* Return true on token validation
27+
*
2728
* @param UserInterface $user
2829
* @param DataObject $request
2930
* @return bool

TwoFactorAuth/Api/ProviderPoolInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ interface ProviderPoolInterface
1616
{
1717
/**
1818
* Get a list of providers
19+
*
1920
* @return \Magento\TwoFactorAuth\Api\ProviderInterface[]
2021
*/
2122
public function getProviders(): array;
2223

2324
/**
2425
* Get provider by code
26+
*
2527
* @param string $code
2628
* @return \Magento\TwoFactorAuth\Api\ProviderInterface
2729
* @throws NoSuchEntityException

TwoFactorAuth/Api/TfaSessionInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function grantAccess(): void;
2424

2525
/**
2626
* Return true if 2FA session has been passed
27+
*
2728
* @return bool
2829
*/
2930
public function isGranted(): bool;

TwoFactorAuth/Api/UserConfigManagerInterface.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface UserConfigManagerInterface
2121

2222
/**
2323
* Get a provider configuration for a given user
24+
*
2425
* @param int $userId
2526
* @param string $providerCode
2627
* @return array|null
@@ -30,26 +31,29 @@ public function getProviderConfig(int $userId, string $providerCode): ?array;
3031

3132
/**
3233
* Set provider configuration
34+
*
3335
* @param int $userId
3436
* @param string $providerCode
3537
* @param array|null $config
3638
* @return bool
3739
* @throws NoSuchEntityException
3840
*/
39-
public function setProviderConfig(int $userId, string $providerCode, ?array $config=null): bool;
41+
public function setProviderConfig(int $userId, string $providerCode, ?array $config = null): bool;
4042

4143
/**
4244
* Set provider configuration
45+
*
4346
* @param int $userId
4447
* @param string $providerCode
4548
* @param array|null $config
4649
* @return bool
4750
* @throws NoSuchEntityException
4851
*/
49-
public function addProviderConfig(int $userId, string $providerCode, ?array $config=null): bool;
52+
public function addProviderConfig(int $userId, string $providerCode, ?array $config = null): bool;
5053

5154
/**
5255
* Reset provider configuration
56+
*
5357
* @param int $userId
5458
* @param string $providerCode
5559
* @return bool
@@ -59,6 +63,7 @@ public function resetProviderConfig(int $userId, string $providerCode): bool;
5963

6064
/**
6165
* Set providers list for a given user
66+
*
6267
* @param int $userId
6368
* @param string|array $providersCodes
6469
* @return bool
@@ -68,13 +73,15 @@ public function setProvidersCodes(int $userId, $providersCodes): bool;
6873

6974
/**
7075
* Set providers list for a given user
76+
*
7177
* @param int $userId
7278
* @return string[]
7379
*/
7480
public function getProvidersCodes(int $userId): array;
7581

7682
/**
7783
* Activate a provider configuration
84+
*
7885
* @param int $userId
7986
* @param string $providerCode
8087
* @return bool
@@ -84,6 +91,7 @@ public function activateProviderConfiguration(int $userId, string $providerCode)
8491

8592
/**
8693
* Return true if a provider configuration has been activated
94+
*
8795
* @param int $userId
8896
* @param string $providerCode
8997
* @return bool
@@ -93,6 +101,7 @@ public function isProviderConfigurationActive(int $userId, string $providerCode)
93101

94102
/**
95103
* Set default provider
104+
*
96105
* @param int $userId
97106
* @param string $providerCode
98107
* @return bool
@@ -101,7 +110,8 @@ public function isProviderConfigurationActive(int $userId, string $providerCode)
101110
public function setDefaultProvider(int $userId, string $providerCode): bool;
102111

103112
/**
104-
* get default provider
113+
* Get default provider
114+
*
105115
* @param int $userId
106116
* @return string
107117
*/

TwoFactorAuth/Api/UserConfigRepositoryInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,46 @@
1414

1515
/**
1616
* User configuration repository
17+
*
1718
* @SuppressWarnings(PHPMD.ShortVariable)
1819
*/
1920
interface UserConfigRepositoryInterface
2021
{
2122
/**
2223
* Save object
24+
*
2325
* @param UserConfigInterface $object
2426
* @return UserConfigInterface
2527
*/
2628
public function save(UserConfigInterface $object): UserConfigInterface;
2729

2830
/**
2931
* Get object by id
32+
*
3033
* @param int $id
3134
* @return UserConfigInterface
3235
*/
3336
public function getById(int $id): UserConfigInterface;
3437

3538
/**
3639
* Get by UserId value
40+
*
3741
* @param int $value
3842
* @return UserConfigInterface
3943
*/
4044
public function getByUserId(int $value): UserConfigInterface;
4145

4246
/**
4347
* Delete object
48+
*
4449
* @param UserConfigInterface $object
4550
* @return bool
4651
*/
4752
public function delete(UserConfigInterface $object): bool;
4853

4954
/**
5055
* Get a list of object
56+
*
5157
* @param SearchCriteriaInterface $searchCriteria
5258
* @return UserConfigSearchResultsInterface
5359
*/

TwoFactorAuth/Block/ChangeProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use Magento\TwoFactorAuth\Api\ProviderInterface;
1515

1616
/**
17+
* Represent the change providers block for authentication workflow
18+
*
1719
* @api
1820
*/
1921
class ChangeProvider extends Template
@@ -34,7 +36,6 @@ class ChangeProvider extends Template
3436
private $session;
3537

3638
/**
37-
* ChangeProvider constructor.
3839
* @param Template\Context $context
3940
* @param Session $session
4041
* @param UserContextInterface $userContext
@@ -97,6 +98,7 @@ public function getJsLayout()
9798

9899
/**
99100
* Get a list of available providers
101+
*
100102
* @return ProviderInterface[]
101103
*/
102104
private function getProvidersList(): array

TwoFactorAuth/Block/Configure.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class Configure extends Template
2727

2828
/**
2929
* @param Template\Context $context
30-
* @param array $data
3130
* @param TfaInterface $tfa
31+
* @param array $data
3232
*/
3333
public function __construct(Template\Context $context, TfaInterface $tfa, array $data = [])
3434
{

0 commit comments

Comments
 (0)