Various code optimalisations.

This commit is contained in:
James Cole
2018-07-08 07:59:58 +02:00
parent 10492e3b2f
commit 2f2f907ffe
59 changed files with 309 additions and 279 deletions

View File

@@ -81,6 +81,7 @@ class ReportController extends Controller
* @return \Illuminate\Http\JsonResponse
*
* @throws FireflyException
* @throws \Throwable
*/
public function general(Request $request)
{
@@ -229,13 +230,13 @@ class ReportController extends Controller
try {
$attributes['startDate'] = Carbon::createFromFormat('Ymd', $attributes['startDate']);
} catch (InvalidArgumentException $e) {
throw new FireflyException('Could not parse start date "' . e($attributes['startDate']) . '".');
throw new FireflyException(sprintf('Could not parse start date "%s": %s', $attributes['startDate'], $e->getMessage()));
}
try {
$attributes['endDate'] = Carbon::createFromFormat('Ymd', $attributes['endDate']);
} catch (InvalidArgumentException $e) {
throw new FireflyException('Could not parse start date "' . e($attributes['endDate']) . '".');
throw new FireflyException(sprintf('Could not parse end date "%s": %s', $attributes['endDate'], $e->getMessage()));
}
return $attributes;