* @copyright 2007-2019 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ use Symfony\Component\Translation\TranslatorInterface; class CustomerLoginFormatterCore implements FormFormatterInterface { private $translator; public function __construct(TranslatorInterface $translator) { $this->translator = $translator; } public function getFormat() { return [ 'back' => (new FormField()) ->setName('back') ->setType('hidden'), 'email' => (new FormField()) ->setName('email') ->setType('email') ->setRequired(true) ->setLabel($this->translator->trans( 'Email', [], 'Shop.Forms.Labels' )) ->addConstraint('isEmail'), 'password' => (new FormField()) ->setName('password') ->setType('password') ->setRequired(true) ->setLabel($this->translator->trans( 'Password', [], 'Shop.Forms.Labels' )) ->addConstraint('isPasswd'), ]; } }