| @@ 32-71 (lines=40) @@ | ||
| 29 | use Rossmitchell\Twofactor\Model\Urls\Fetcher; |
|
| 30 | use Rossmitchell\Twofactor\Model\Admin\Attribute\IsUsingTwoFactor; |
|
| 31 | ||
| 32 | class Index extends AbstractController |
|
| 33 | { |
|
| 34 | ||
| 35 | private $resultPageFactory; |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Constructor |
|
| 39 | * |
|
| 40 | * @param Context $context |
|
| 41 | * @param UserAdmin $userAdmin |
|
| 42 | * @param AdminUser $adminGetter |
|
| 43 | * @param Fetcher $fetcher |
|
| 44 | * @param IsUsingTwoFactor $isUsingTwoFactor |
|
| 45 | * @param PageFactory $resultPageFactory |
|
| 46 | */ |
|
| 47 | public function __construct( |
|
| 48 | Context $context, |
|
| 49 | UserAdmin $userAdmin, |
|
| 50 | AdminUser $adminGetter, |
|
| 51 | Fetcher $fetcher, |
|
| 52 | IsUsingTwoFactor $isUsingTwoFactor, |
|
| 53 | PageFactory $resultPageFactory |
|
| 54 | ) { |
|
| 55 | parent::__construct($context, $userAdmin, $adminGetter, $fetcher, $isUsingTwoFactor); |
|
| 56 | $this->resultPageFactory = $resultPageFactory; |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * Execute view action |
|
| 61 | * |
|
| 62 | * @return ResultInterface |
|
| 63 | */ |
|
| 64 | public function execute() |
|
| 65 | { |
|
| 66 | if ($this->shouldActionBeRun() === false) { |
|
| 67 | return $this->getRedirectAction(); |
|
| 68 | } |
|
| 69 | return $this->resultPageFactory->create(); |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||
| @@ 33-73 (lines=41) @@ | ||
| 30 | use Rossmitchell\Twofactor\Model\TwoFactorUrls; |
|
| 31 | use Rossmitchell\Twofactor\Model\Urls\Fetcher; |
|
| 32 | ||
| 33 | class Index extends AbstractController |
|
| 34 | { |
|
| 35 | /** @var PageFactory */ |
|
| 36 | private $resultPageFactory; |
|
| 37 | ||
| 38 | /** |
|
| 39 | * Index constructor. |
|
| 40 | * |
|
| 41 | * @param Context $context |
|
| 42 | * @param CustomerAdmin $customerAdmin |
|
| 43 | * @param Customer $customerGetter |
|
| 44 | * @param Fetcher $fetcher |
|
| 45 | * @param IsUsingTwoFactor $isUsingTwoFactor |
|
| 46 | * @param PageFactory $resultPageFactory |
|
| 47 | */ |
|
| 48 | public function __construct( |
|
| 49 | Context $context, |
|
| 50 | CustomerAdmin $customerAdmin, |
|
| 51 | Customer $customerGetter, |
|
| 52 | Fetcher $fetcher, |
|
| 53 | IsUsingTwoFactor $isUsingTwoFactor, |
|
| 54 | PageFactory $resultPageFactory |
|
| 55 | ) { |
|
| 56 | parent::__construct($context, $customerAdmin, $customerGetter, $fetcher, $isUsingTwoFactor); |
|
| 57 | $this->resultPageFactory = $resultPageFactory; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * Execute view action |
|
| 62 | * |
|
| 63 | * @return ResultInterface |
|
| 64 | */ |
|
| 65 | public function execute() |
|
| 66 | { |
|
| 67 | if ($this->shouldActionBeRun() === false) { |
|
| 68 | return $this->getRedirectAction(); |
|
| 69 | } |
|
| 70 | ||
| 71 | return $this->resultPageFactory->create(); |
|
| 72 | } |
|
| 73 | } |
|
| 74 | ||