-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIPRO-37 Refactor AdminUser Class #13
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of the fancy indentation, it's a pain to upkeep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should style according to Magento coding standard guidelines with phpcs!
Refactored Vaimo\AdminAutoLogin\Model\Config\Source\AdminUser.php
Changes:
Why: