diff options
Diffstat (limited to 'classes/handler.php')
-rw-r--r-- | classes/handler.php | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/classes/handler.php b/classes/handler.php index 09557c284..806c9cfbe 100644 --- a/classes/handler.php +++ b/classes/handler.php @@ -1,23 +1,37 @@ <?php class Handler implements IHandler { + // TODO: class properties can be switched to PHP typing if/when the minimum PHP_VERSION is raised to 7.4.0+ + /** @var PDO */ protected $pdo; + + /** @var array<int|string, mixed> */ protected $args; - function __construct($args) { + /** + * @param array<int|string, mixed> $args + */ + function __construct(array $args) { $this->pdo = Db::pdo(); $this->args = $args; } - function csrf_ignore($method) { + function csrf_ignore(string $method): bool { return false; } - function before($method) { + function before(string $method): bool { return true; } - function after() { + function after(): bool { return true; } + /** + * @param mixed $p + */ + protected static function _param_to_bool($p): bool { + $p = clean($p); + return $p && ($p !== "f" && $p !== "false"); + } } |