diff --git a/core/Api/Request.class.php b/core/Api/Request.class.php index 6364f95..2320444 100644 --- a/core/Api/Request.class.php +++ b/core/Api/Request.class.php @@ -18,13 +18,13 @@ class Request { protected bool $apiKeyAllowed; protected bool $csrfTokenRequired; - private array $aDefaultParams; + private array $defaultParams; private array $allowedMethods; private bool $externalCall; public function __construct(User $user, bool $externalCall = false, array $params = array()) { $this->user = $user; - $this->aDefaultParams = $params; + $this->defaultParams = $params; $this->success = false; $this->result = array(); @@ -77,7 +77,6 @@ class Request { } public function execute($values = array()): bool { - $this->params = $this->aDefaultParams; $this->success = false; $this->result = array(); $this->lastError = ''; @@ -181,7 +180,8 @@ class Request { } protected function getParam($name) { - return $this->params[$name] ?? NULL; + // i don't know why phpstorm + return (isset($this->params[$name]) ? $this->params[$name]->value : NULL); } public function isPublic(): bool { diff --git a/core/Driver/SQL/Query/Delete.class.php b/core/Driver/SQL/Query/Delete.class.php index 4f993e9..b98f41a 100644 --- a/core/Driver/SQL/Query/Delete.class.php +++ b/core/Driver/SQL/Query/Delete.class.php @@ -21,7 +21,7 @@ class Delete extends Query { return $this; } - public function execute() { + public function execute(): bool { return $this->sql->executeDelete($this); } diff --git a/core/Driver/SQL/Query/Query.class.php b/core/Driver/SQL/Query/Query.class.php index f6201de..31b4f4c 100644 --- a/core/Driver/SQL/Query/Query.class.php +++ b/core/Driver/SQL/Query/Query.class.php @@ -19,6 +19,7 @@ abstract class Query { return $this; } - public abstract function execute(): bool; + // can actually return bool|array (depending on success and query type) + public abstract function execute(); } \ No newline at end of file diff --git a/core/Driver/SQL/Query/Select.class.php b/core/Driver/SQL/Query/Select.class.php index 29f141f..915eda9 100644 --- a/core/Driver/SQL/Query/Select.class.php +++ b/core/Driver/SQL/Query/Select.class.php @@ -80,7 +80,7 @@ class Select extends Query { return $this; } - public function execute(): bool { + public function execute() { return $this->sql->executeSelect($this); } diff --git a/core/Driver/SQL/Query/Update.class.php b/core/Driver/SQL/Query/Update.class.php index 5727512..35c0a0c 100644 --- a/core/Driver/SQL/Query/Update.class.php +++ b/core/Driver/SQL/Query/Update.class.php @@ -28,7 +28,7 @@ class Update extends Query { return $this; } - public function execute(): bool { + public function execute() { return $this->sql->executeUpdate($this); }