cs and phpstan fixes

This commit is contained in:
Dennis Eichhorn 2020-10-24 17:52:24 +02:00
parent 8d1b0a520e
commit c79c019f3e
3 changed files with 6 additions and 58 deletions

View File

@ -215,58 +215,6 @@ final class ApiController extends Controller
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'News', 'News successfully returned', $news); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'News', 'News successfully returned', $news);
} }
/**
* Get Newslists.
*
* @param int $limit News limit
* @param int $offset News offset
* @param string $orderBy Order criteria (database table name)
* @param string $ordered Order type (e.g. ASC)
* @param Account $account Accont for permission handling
*
* @return array
*
* @since 1.0.0
*/
public function getNewsListR(int $limit = 50, int $offset = 0, string $orderBy = 'news_created', string $ordered = 'ASC', Account $account = null)
{
$query = NewsArticleMapper::find('news.news_id', 'news.news_author', 'news.news_publish', 'news.news_title')
->where('news.news_type', '=', 1)
->where('news.news_status', '=', 1)
->orderBy($orderBy, $ordered)
->offset($offset)
->limit($limit);
return NewsArticleMapper::getAllByQuery($query);
}
/**
* Get Headlinelist.
*
* @param int $limit News limit
* @param int $offset News offset
* @param string $orderBy Order criteria (database table name)
* @param string $ordered Order type (e.g. ASC)
* @param Account $account Accont for permission handling
*
* @return array
*
* @api
*
* @since 1.0.0
*/
public function getHeadlineListR(int $limit = 50, int $offset = 0, string $orderBy = 'news_created', string $ordered = 'ASC', Account $account = null)
{
$query = NewsArticleMapper::find('news.news_id', 'news.news_author', 'news.news_publish', 'news.news_title')
->where('news.news_type', '=', 0)
->where('news.news_status', '=', 1)
->orderBy($orderBy, $ordered)
->offset($offset)
->limit($limit);
return NewsArticleMapper::getAllByQuery($query);
}
/** /**
* Api method to delete news article * Api method to delete news article
* *

View File

@ -130,7 +130,7 @@ class NewsArticle implements \JsonSerializable, ArrayableInterface
/** /**
* Comments * Comments
* *
* @var null|int|object|CommentList * @var null|\Modules\Comments\Models\CommentList
* @since 1.0.0 * @since 1.0.0
*/ */
private $comments = null; private $comments = null;
@ -202,7 +202,7 @@ class NewsArticle implements \JsonSerializable, ArrayableInterface
/** /**
* Set comment list * Set comment list
* *
* @param int|CommentList $comments Comment list * @param int|\Modules\Comments\Models\CommentList $comments Comment list
* *
* @return void * @return void
* *
@ -216,11 +216,11 @@ class NewsArticle implements \JsonSerializable, ArrayableInterface
/** /**
* Get comments * Get comments
* *
* @return null|object|CommentList * @return null|\Modules\Comments\Models\CommentList
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getComments() : ?object public function getComments()
{ {
return $this->comments; return $this->comments;
} }

View File

@ -58,7 +58,7 @@ final class NewsArticleMapper extends DataMapperAbstract
/** /**
* Has one relation. * Has one relation.
* *
* @var array<string, array{mapper:string, self:string, by?:string, column?:string}> * @var array<string, array{mapper:string, external:string, by?:string, column?:string, conditional?:bool}>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static array $ownsOne = [ protected static array $ownsOne = [
@ -71,7 +71,7 @@ final class NewsArticleMapper extends DataMapperAbstract
/** /**
* Belongs to. * Belongs to.
* *
* @var array<string, array{mapper:string, self:string}> * @var array<string, array{mapper:string, external:string}>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static array $belongsTo = [ protected static array $belongsTo = [