From 6c70a53309e90938dfd92acdb0d44c8f9cc5310b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 11 Feb 2015 09:51:28 +0100 Subject: [PATCH] Avoid to instantiate custom form element validators directly refs #8415 --- application/forms/Config/General/LoggingConfigForm.php | 3 +-- application/forms/Config/Resource/FileResourceForm.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/application/forms/Config/General/LoggingConfigForm.php b/application/forms/Config/General/LoggingConfigForm.php index de757eb6e..7039d7b7f 100644 --- a/application/forms/Config/General/LoggingConfigForm.php +++ b/application/forms/Config/General/LoggingConfigForm.php @@ -5,7 +5,6 @@ namespace Icinga\Forms\Config\General; use Icinga\Application\Logger; use Icinga\Web\Form; -use Icinga\Web\Form\Validator\WritablePathValidator; class LoggingConfigForm extends Form { @@ -107,7 +106,7 @@ class LoggingConfigForm extends Form 'label' => $this->translate('File path'), 'description' => $this->translate('The full path to the log file to write messages to.'), 'value' => '/var/log/icingaweb2/icingaweb2.log', - 'validators' => array(new WritablePathValidator()) + 'validators' => array('WritablePathValidator') ) ); } diff --git a/application/forms/Config/Resource/FileResourceForm.php b/application/forms/Config/Resource/FileResourceForm.php index c1ccd137c..b1bb0c6ae 100644 --- a/application/forms/Config/Resource/FileResourceForm.php +++ b/application/forms/Config/Resource/FileResourceForm.php @@ -4,7 +4,6 @@ namespace Icinga\Forms\Config\Resource; use Icinga\Web\Form; -use Icinga\Web\Form\Validator\ReadablePathValidator; /** * Form class for adding/modifying file resources @@ -40,7 +39,7 @@ class FileResourceForm extends Form 'required' => true, 'label' => $this->translate('Filepath'), 'description' => $this->translate('The filename to fetch information from'), - 'validators' => array(new ReadablePathValidator()) + 'validators' => array('ReadablePathValidator') ) ); $this->addElement(