Code cleanup

This commit is contained in:
James Cole
2018-04-28 06:23:13 +02:00
parent 6f0e1c79ac
commit 13b78bdc20
218 changed files with 621 additions and 681 deletions

View File

@@ -56,7 +56,7 @@ class ReportFormRequest extends Request
$repository = app(AccountRepositoryInterface::class);
$set = $this->get('accounts');
$collection = new Collection;
if (is_array($set)) {
if (\is_array($set)) {
foreach ($set as $accountId) {
$account = $repository->findNull((int)$accountId);
if (null !== $account) {
@@ -77,7 +77,7 @@ class ReportFormRequest extends Request
$repository = app(BudgetRepositoryInterface::class);
$set = $this->get('budget');
$collection = new Collection;
if (is_array($set)) {
if (\is_array($set)) {
foreach ($set as $budgetId) {
$budget = $repository->findNull((int)$budgetId);
if (null !== $budget) {
@@ -98,7 +98,7 @@ class ReportFormRequest extends Request
$repository = app(CategoryRepositoryInterface::class);
$set = $this->get('category');
$collection = new Collection;
if (is_array($set)) {
if (\is_array($set)) {
foreach ($set as $categoryId) {
$category = $repository->findNull((int)$categoryId);
if (null !== $category) {
@@ -120,7 +120,7 @@ class ReportFormRequest extends Request
$date = new Carbon;
$range = $this->get('daterange');
$parts = explode(' - ', (string)$range);
if (2 === count($parts)) {
if (2 === \count($parts)) {
try {
$date = new Carbon($parts[1]);
// @codeCoverageIgnoreStart
@@ -145,7 +145,7 @@ class ReportFormRequest extends Request
$repository = app(AccountRepositoryInterface::class);
$set = $this->get('exp_rev');
$collection = new Collection;
if (is_array($set)) {
if (\is_array($set)) {
foreach ($set as $accountId) {
$account = $repository->findNull((int)$accountId);
if (null !== $account) {
@@ -167,7 +167,7 @@ class ReportFormRequest extends Request
$date = new Carbon;
$range = $this->get('daterange');
$parts = explode(' - ', (string)$range);
if (2 === count($parts)) {
if (2 === \count($parts)) {
try {
$date = new Carbon($parts[0]);
// @codeCoverageIgnoreStart
@@ -190,7 +190,7 @@ class ReportFormRequest extends Request
$repository = app(TagRepositoryInterface::class);
$set = $this->get('tag');
$collection = new Collection;
if (is_array($set)) {
if (\is_array($set)) {
foreach ($set as $tagTag) {
$tag = $repository->findByTag($tagTag);
if (null !== $tag->id) {