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;
@@ -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;
}
}