tighten psalm checks even more

pull/298/head
David Goodwin 5 years ago
parent 34e6f7829e
commit 7965a83aff

@ -352,8 +352,8 @@ function escape_string($string_or_int) {
* $param = safeget('param', 'default')
*
* @param string $param parameter name.
* @param string $default (optional) - default value if key is not set.
* @return string
* @param string|array $default (optional) - default value if key is not set.
* @return string|array
*/
function safeget($param, $default = "") {
$retval = $default;
@ -1574,7 +1574,7 @@ function db_connect() {
/**
* Returns the appropriate boolean value for the database.
*
* @param bool $bool
* @param bool|string $bool
* @return string|int as appropriate for underlying db platform
*/
function db_get_boolean($bool) {

@ -109,7 +109,7 @@ final class Config {
* Configure::read('Name.key'); will return only the value of Configure::Name[key]
*
* @param string $var Variable to obtain
* @return array|string|null string value of Configure::$var
* @return array|string|null|bool some value
* @access public
*/
public static function read($var) {

@ -180,9 +180,8 @@ class Shell {
/**
* Outputs to the stdout filehandle.
*
* @param string $string String to output.
* @param string|array $string String to output.
* @param boolean $newline If true, the outputs gets an added newline.
* @access public
*/
public function out($string, $newline = true) {
if (is_array($string)) {
@ -197,7 +196,7 @@ class Shell {
/**
* Outputs to the stderr filehandle.
*
* @param string $string Error text to output.
* @param string|array $string Error text to output.
* @access public
*/
public function err($string) {

@ -35,17 +35,6 @@
<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives -->
<DeprecatedMethod errorLevel="info" />
<DeprecatedProperty errorLevel="info" />
<DeprecatedClass errorLevel="info" />
<DeprecatedConstant errorLevel="info" />
<DeprecatedInterface errorLevel="info" />
<DeprecatedTrait errorLevel="info" />
<InternalMethod errorLevel="info" />
<InternalProperty errorLevel="info" />
<InternalClass errorLevel="info" />
<MissingClosureReturnType errorLevel="info" />
<MissingReturnType errorLevel="info" />
<MissingPropertyType errorLevel="info" />
@ -55,13 +44,10 @@
<MissingClosureParamType errorLevel="info" />
<MissingParamType errorLevel="info" />
<DocblockTypeContradiction errorLevel="info" />
<RedundantConditionGivenDocblockType errorLevel="info" />
<UnresolvableInclude errorLevel="info" />
<RawObjectIteration errorLevel="info" />
<InvalidStringClass errorLevel="info" />
</issueHandlers>
</psalm>

@ -23,6 +23,9 @@ $username = authentication_get_username(); # enforce login
$table = safeget('table');
if(!is_string($table)) {
die("table parameter must be a string");
}
$handlerclass = ucfirst($table) . 'Handler';
if (!preg_match('/^[a-z]+$/', $table) || !file_exists(dirname(__FILE__) . "/../model/$handlerclass.php")) { # validate $table

Loading…
Cancel
Save