Pimp entities and models

* Strict
* Extend proper class
* Typehint
* Return types

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-08-30 13:58:25 +02:00
commit 45e5e1f3b5
No known key found for this signature in database
GPG key ID: F941078878347C0C
11 changed files with 48 additions and 69 deletions

View file

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019 Inigo Jiron <ijiron@terpmail.umd.edu>
*
@ -35,7 +36,7 @@ use OCP\AppFramework\Db\Entity;
* @method integer getTimestamp()
* @method void setTimestamp(integer $value)
*/
class Question extends Model {
class Question extends Entity {
protected $formId;
protected $formQuestionType;
protected $formQuestionText;
@ -49,7 +50,7 @@ class Question extends Model {
$this->addType('timestamp', 'integer');
}
public function read() {
public function read(): array {
return [
'id' => $this->getId(),
'formId' => $this->getFormId(),