Crypto params validation

This commit is contained in:
Marcin Łojewski
2018-12-26 12:02:19 +01:00
parent 7f84113bca
commit 2da835b017
2 changed files with 75 additions and 23 deletions

View File

@@ -119,24 +119,6 @@ class Properties implements \ArrayAccess
);
}
/**
* Is given parameter a boolean parameter.
*
* @param $param string Parameter name.
*
* @return bool Is a boolean parameter.
*/
private function isBooleanParam($param)
{
return in_array(
$param, [
Opt::APPEND_SALT, Opt::CASE_INSENSITIVE_USERNAME,
Opt::NAME_CHANGE, Opt::PASSWORD_CHANGE, Opt::PREPEND_SALT,
Opt::REVERSE_ACTIVE, Opt::USE_CACHE
]
);
}
/**
* Return an array with all supported parameters.
*
@@ -162,6 +144,24 @@ class Properties implements \ArrayAccess
return $params;
}
/**
* Is given parameter a boolean parameter.
*
* @param $param string Parameter name.
*
* @return bool Is a boolean parameter.
*/
private function isBooleanParam($param)
{
return in_array(
$param, [
Opt::APPEND_SALT, Opt::CASE_INSENSITIVE_USERNAME,
Opt::NAME_CHANGE, Opt::PASSWORD_CHANGE, Opt::PREPEND_SALT,
Opt::REVERSE_ACTIVE, Opt::USE_CACHE
]
);
}
/**
* Store properties in the cache memory.
*/
@@ -229,6 +229,7 @@ class Properties implements \ArrayAccess
*/
public function offsetUnset($offset)
{
$this->config->deleteAppValue($this->appName, $offset);
unset($this->data[$offset]);
}
}