Code clean up.

This commit is contained in:
James Cole
2017-11-15 12:25:49 +01:00
parent 57dcdfa0c4
commit ffca858b8d
476 changed files with 2055 additions and 4181 deletions

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Report;
@@ -30,13 +29,10 @@ use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection;
/**
* Class AccountController
*
* @package FireflyIII\Http\Controllers\Report
* Class AccountController.
*/
class AccountController extends Controller
{
/**
* @param Collection $accounts
* @param Carbon $start

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Report;
@@ -30,13 +29,10 @@ use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection;
/**
* Class BalanceController
*
* @package FireflyIII\Http\Controllers\Report
* Class BalanceController.
*/
class BalanceController extends Controller
{
/**
* @param BalanceReportHelperInterface $helper
* @param Collection $accounts
@@ -47,8 +43,6 @@ class BalanceController extends Controller
*/
public function general(BalanceReportHelperInterface $helper, Collection $accounts, Carbon $start, Carbon $end)
{
// chart properties for cache:
$cache = new CacheProperties;
$cache->addProperty($start);

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Report;
@@ -32,14 +31,10 @@ use Illuminate\Support\Collection;
use Navigation;
/**
* Class BudgetController
*
* @package FireflyIII\Http\Controllers\Report
* Class BudgetController.
*/
class BudgetController extends Controller
{
/**
* @param BudgetReportHelperInterface $helper
* @param Collection $accounts
@@ -50,7 +45,6 @@ class BudgetController extends Controller
*/
public function general(BudgetReportHelperInterface $helper, Collection $accounts, Carbon $start, Carbon $end)
{
// chart properties for cache:
$cache = new CacheProperties;
$cache->addProperty($start);
@@ -103,7 +97,7 @@ class BudgetController extends Controller
}
/**
* Filters empty results from getBudgetPeriodReport
* Filters empty results from getBudgetPeriodReport.
*
* @param array $data
*
@@ -112,7 +106,7 @@ class BudgetController extends Controller
private function filterBudgetPeriodReport(array $data): array
{
/**
* @var int $budgetId
* @var int
* @var array $set
*/
foreach ($data as $budgetId => $set) {
@@ -121,7 +115,7 @@ class BudgetController extends Controller
$sum = bcadd($amount, $sum);
}
$data[$budgetId]['sum'] = $sum;
if (bccomp('0', $sum) === 0) {
if (0 === bccomp('0', $sum)) {
unset($data[$budgetId]);
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Report;
@@ -32,9 +31,7 @@ use Illuminate\Support\Collection;
use Navigation;
/**
* Class CategoryController
*
* @package FireflyIII\Http\Controllers\Report
* Class CategoryController.
*/
class CategoryController extends Controller
{
@@ -70,7 +67,6 @@ class CategoryController extends Controller
}
/**
*
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
@@ -107,6 +103,7 @@ class CategoryController extends Controller
* @param Carbon $end
*
* @return mixed|string
*
* @internal param ReportHelperInterface $helper
*/
public function operations(Collection $accounts, Carbon $start, Carbon $end)
@@ -128,7 +125,7 @@ class CategoryController extends Controller
/** @var Category $category */
foreach ($categories as $category) {
$spent = $repository->spentInPeriod(new Collection([$category]), $accounts, $start, $end);
if (bccomp($spent, '0') !== 0) {
if (0 !== bccomp($spent, '0')) {
$report[$category->id] = ['name' => $category->name, 'spent' => $spent, 'id' => $category->id];
}
}
@@ -149,7 +146,7 @@ class CategoryController extends Controller
}
/**
* Filters empty results from category period report
* Filters empty results from category period report.
*
* @param array $data
*
@@ -163,12 +160,11 @@ class CategoryController extends Controller
$sum = bcadd($amount, $sum);
}
$data[$categoryId]['sum'] = $sum;
if (bccomp('0', $sum) === 0) {
if (0 === bccomp('0', $sum)) {
unset($data[$categoryId]);
}
}
return $data;
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Report;
@@ -30,13 +29,10 @@ use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection;
/**
* Class OperationsController
*
* @package FireflyIII\Http\Controllers\Report
* Class OperationsController.
*/
class OperationsController extends Controller
{
/**
* @param AccountTaskerInterface $tasker
* @param Collection $accounts