Code cleanup

This commit is contained in:
James Cole
2018-04-02 14:50:17 +02:00
parent 379b104778
commit fa7ab45a40
100 changed files with 440 additions and 517 deletions

View File

@@ -75,7 +75,7 @@ class CategoryTransformer extends TransformerAbstract
*/
public function includeTransactions(Category $category): FractalCollection
{
$pageSize = intval(app('preferences')->getForUser($category->user, 'listPageSize', 50)->data);
$pageSize = (int)app('preferences')->getForUser($category->user, 'listPageSize', 50)->data;
// journals always use collector and limited using URL parameters.
$collector = app(JournalCollectorInterface::class);
@@ -83,7 +83,7 @@ class CategoryTransformer extends TransformerAbstract
$collector->withOpposingAccount()->withCategoryInformation()->withCategoryInformation();
$collector->setAllAssetAccounts();
$collector->setCategories(new Collection([$category]));
if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) {
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
}
$collector->setLimit($pageSize)->setPage($this->parameters->get('page'));