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

@ -35,7 +35,7 @@ class QuestionMapper extends QBMapper {
* @param IDBConnection $db
*/
public function __construct(IDBConnection $db) {
parent::__construct($db, 'forms_questions', '\OCA\Forms\Db\Question');
parent::__construct($db, 'forms_questions', Question::class);
}
/**
@ -44,7 +44,7 @@ class QuestionMapper extends QBMapper {
* @return Option[]
*/
public function findByForm($formId) {
public function findByForm(int $formId): array {
$qb = $this->db->getQueryBuilder();
$qb->select('*')
@ -59,7 +59,7 @@ class QuestionMapper extends QBMapper {
/**
* @param int $formId
*/
public function deleteByForm($formId) {
public function deleteByForm(int $formId): void {
$qb = $this->db->getQueryBuilder();
$qb->delete($this->getTableName())