Fix cs and refactor FormFirewall raw values usage
modified: core/lib/Thelia/Form/FirewallForm.php modified: core/lib/Thelia/Model/FormFirewallQuery.php modified: core/lib/Thelia/Model/Tax.php
This commit is contained in:
committed by
Benjamin Perche
parent
5f6871154c
commit
13cb3dbbdc
@@ -22,6 +22,12 @@ use Thelia\Model\FormFirewallQuery;
|
||||
*/
|
||||
abstract class FirewallForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* Those values are for a "normal" security context
|
||||
*/
|
||||
const DEFAULT_TIME_TO_WAIT = 1;
|
||||
const DEFAULT_ATTEMPTS = 3;
|
||||
|
||||
/** @var \Thelia\Model\FormFirewall */
|
||||
protected static $cachedInstance;
|
||||
|
||||
@@ -81,7 +87,7 @@ abstract class FirewallForm extends BaseForm
|
||||
*/
|
||||
public function getConfigTime()
|
||||
{
|
||||
return ConfigQuery::read("form_firewall_time_to_wait", 1);
|
||||
return ConfigQuery::read("form_firewall_time_to_wait", static::DEFAULT_TIME_TO_WAIT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,6 +97,6 @@ abstract class FirewallForm extends BaseForm
|
||||
*/
|
||||
public function getConfigAttempts()
|
||||
{
|
||||
return ConfigQuery::read("form_firewall_attempts", 2);
|
||||
return ConfigQuery::read("form_firewall_attempts", static::DEFAULT_ATTEMPTS);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\FormFirewallQuery as BaseFormFirewallQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'form_firewall' table.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user