Clean up some classes, extend API validation.

This commit is contained in:
James Cole
2025-11-02 14:00:55 +01:00
parent d5e431c3a1
commit a57cf4e9be
28 changed files with 324 additions and 109 deletions

View File

@@ -27,7 +27,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Category;
use FireflyIII\User;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Log;
/**
* Class CategoryFactory
*/
@@ -43,7 +43,7 @@ class CategoryFactory
$categoryId = (int) $categoryId;
$categoryName = (string) $categoryName;
app('log')->debug(sprintf('Going to find category with ID %d and name "%s"', $categoryId, $categoryName));
Log::debug(sprintf('Going to find category with ID %d and name "%s"', $categoryId, $categoryName));
if ('' === $categoryName && 0 === $categoryId) {
return null;
@@ -72,8 +72,8 @@ class CategoryFactory
]
);
} catch (QueryException $e) {
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
throw new FireflyException('400003: Could not store new category.', 0, $e);
}