Code cleanup
This commit is contained in:
@@ -40,11 +40,12 @@ class AjaxFormController extends ActionController
|
||||
protected $emailService;
|
||||
|
||||
/**
|
||||
* @param EmailService $service
|
||||
* @param EmailService $emailService
|
||||
*/
|
||||
public function injectEmailService(EmailService $service)
|
||||
public function __construct(EmailService $emailService)
|
||||
{
|
||||
$this->emailService = $service;
|
||||
parent::__construct();
|
||||
$this->emailService = $emailService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,7 +74,7 @@ class AjaxFormController extends ActionController
|
||||
if ($this->arguments->getValidationResults()->hasErrors()) {
|
||||
foreach ($this->arguments->getValidationResults()->getFlattenedErrors() as $key => $errors)
|
||||
{
|
||||
list($formName, $fieldName) = explode('.', $key);
|
||||
[ $formName, $fieldName ] = explode('.', $key);
|
||||
$errorsRaw = [];
|
||||
foreach ($errors as $error)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user