Fix phpstan messages.

This commit is contained in:
James Cole
2022-12-30 20:25:04 +01:00
parent ee0116f112
commit 445804a7f1
47 changed files with 233 additions and 287 deletions

View File

@@ -24,7 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Binder;
use Carbon\Carbon;
use Exception;
use Carbon\Exceptions\InvalidDateException;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use Illuminate\Routing\Route;
use Log;
@@ -72,9 +72,10 @@ class Date implements BinderInterface
try {
$result = new Carbon($value);
} catch (Exception $e) {
Log::error(sprintf('Could not parse date "%s" for user #%d: %s', $value, auth()->user()->id, $e->getMessage()));
throw new NotFoundHttpException();
} catch (InvalidDateException $e) {
$message = sprintf('Could not parse date "%s" for user #%d: %s', $value, auth()->user()->id, $e->getMessage());
Log::error($message);
throw new NotFoundHttpException($message, $e);
}
return $result;