Conversation
| \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory, | ||
| \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, | ||
| \Vaimo\AdminAutoLogin\Model\Config\Source\AdminUsernameList $adminUsernameList, | ||
| \Magento\Security\Model\AdminSessionsManager $adminSessionsManager |
There was a problem hiding this comment.
Not a fan of the fancy indentation, it's a pain to upkeep
There was a problem hiding this comment.
Hmmm.. maybe we should change the whole styling of the code anyway.
| use function __; | ||
|
|
||
| class AdminUser implements \Magento\Framework\Option\ArrayInterface | ||
| class AdminUsernameList |
There was a problem hiding this comment.
The ArrayInterface is actually needed, for the dropdown in module's admin config when selecting the admin user to automatically log in as.
So please refactor like this:
- Move this model to Vaimo/AdminAutoLogin/Model namespace, it's good as this
- Recreate Model/Config/Source/AdminUser, so that its toOptionArray implementation uses AdminUsernameList
There was a problem hiding this comment.
Wow totally missed that 😁. That's a smart idea, thank you! Regarding the indentation I'm not sure I agree.. But maybe we should change the whole styling of this module anyways. It's kind of weird / out dated.
There was a problem hiding this comment.
We should style according to Magento coding standard guidelines with phpcs!
Refactored Vaimo\AdminAutoLogin\Model\Config\Source\AdminUser.php
Changes:
Why: