mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 03:43:07 +00:00
Auto commit for release 'develop' on 2024-02-22
This commit is contained in:
@@ -66,7 +66,7 @@ class DestroyController extends Controller
|
||||
*/
|
||||
public function destroy(Attachment $attachment): JsonResponse
|
||||
{
|
||||
if(true === auth()->user()->hasRole('demo')) {
|
||||
if (true === auth()->user()->hasRole('demo')) {
|
||||
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
|
||||
|
||||
throw new NotFoundHttpException();
|
||||
|
@@ -75,7 +75,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function download(Attachment $attachment): LaravelResponse
|
||||
{
|
||||
if(true === auth()->user()->hasRole('demo')) {
|
||||
if (true === auth()->user()->hasRole('demo')) {
|
||||
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
|
||||
|
||||
throw new NotFoundHttpException();
|
||||
@@ -123,7 +123,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
if(true === auth()->user()->hasRole('demo')) {
|
||||
if (true === auth()->user()->hasRole('demo')) {
|
||||
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
|
||||
|
||||
throw new NotFoundHttpException();
|
||||
@@ -161,7 +161,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function show(Attachment $attachment): JsonResponse
|
||||
{
|
||||
if(true === auth()->user()->hasRole('demo')) {
|
||||
if (true === auth()->user()->hasRole('demo')) {
|
||||
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
|
||||
|
||||
throw new NotFoundHttpException();
|
||||
|
@@ -74,7 +74,7 @@ class StoreController extends Controller
|
||||
*/
|
||||
public function store(StoreRequest $request): JsonResponse
|
||||
{
|
||||
if(true === auth()->user()->hasRole('demo')) {
|
||||
if (true === auth()->user()->hasRole('demo')) {
|
||||
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
|
||||
|
||||
throw new NotFoundHttpException();
|
||||
@@ -98,7 +98,7 @@ class StoreController extends Controller
|
||||
*/
|
||||
public function upload(Request $request, Attachment $attachment): JsonResponse
|
||||
{
|
||||
if(true === auth()->user()->hasRole('demo')) {
|
||||
if (true === auth()->user()->hasRole('demo')) {
|
||||
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
|
||||
|
||||
throw new NotFoundHttpException();
|
||||
|
@@ -69,7 +69,7 @@ class UpdateController extends Controller
|
||||
*/
|
||||
public function update(UpdateRequest $request, Attachment $attachment): JsonResponse
|
||||
{
|
||||
if(true === auth()->user()->hasRole('demo')) {
|
||||
if (true === auth()->user()->hasRole('demo')) {
|
||||
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
|
||||
|
||||
throw new NotFoundHttpException();
|
||||
|
@@ -70,7 +70,7 @@ class AttemptController extends Controller
|
||||
if ($message->webhook_id !== $webhook->id) {
|
||||
throw new FireflyException('200040: Webhook and webhook message are no match');
|
||||
}
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning(sprintf('User lists webhook attempts of webhook #%d and message #%d, but webhooks are DISABLED.', $webhook->id, $message->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
@@ -114,7 +114,7 @@ class AttemptController extends Controller
|
||||
throw new FireflyException('200041: Webhook message and webhook attempt are no match');
|
||||
}
|
||||
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning(sprintf('User views single webhook attempt #%d of webhook #%d and message #%d, but webhooks are DISABLED', $attempt->id, $webhook->id, $message->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -62,7 +62,7 @@ class DestroyController extends Controller
|
||||
*/
|
||||
public function destroy(Webhook $webhook): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning(sprintf('User tries to destroy webhook #%d. but webhooks are DISABLED.', $webhook->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
@@ -120,7 +120,7 @@ class DestroyController extends Controller
|
||||
throw new FireflyException('200040: Webhook and webhook message are no match');
|
||||
}
|
||||
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning(sprintf('User tries to destroy webhook #%d, message #%d, but webhooks are DISABLED.', $webhook->id, $message->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -66,7 +66,7 @@ class MessageController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning(sprintf('User tries to view messages of webhook #%d, but webhooks are DISABLED.', $webhook->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
@@ -106,7 +106,7 @@ class MessageController extends Controller
|
||||
if ($message->webhook_id !== $webhook->id) {
|
||||
throw new FireflyException('200040: Webhook and webhook message are no match');
|
||||
}
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning(sprintf('User tries to view message #%d of webhook #%d, but webhooks are DISABLED.', $message->id, $webhook->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -71,7 +71,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info('User tries to view all webhooks, but webhooks are DISABLED.');
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
@@ -106,7 +106,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function show(Webhook $webhook): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to view webhook #%d, but webhooks are DISABLED.', $webhook->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
@@ -131,7 +131,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function triggerTransaction(Webhook $webhook, TransactionGroup $group): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to trigger webhook #%d on transaction group #%d, but webhooks are DISABLED.', $webhook->id, $group->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -60,7 +60,7 @@ class StoreController extends Controller
|
||||
public function store(CreateRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info('User tries to store new webhook, but webhooks are DISABLED.', $data);
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -57,7 +57,7 @@ class SubmitController extends Controller
|
||||
*/
|
||||
public function submit(Webhook $webhook): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to submit webhook #%d, but webhooks are DISABLED.', $webhook->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -60,7 +60,7 @@ class UpdateController extends Controller
|
||||
public function update(Webhook $webhook, UpdateRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to update webhook #%d, but webhooks are DISABLED.', $webhook->id), $data);
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -73,7 +73,7 @@ class MoveTransactionsRequest extends FormRequest
|
||||
}
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -73,7 +73,7 @@ class TransactionRequest extends FormRequest
|
||||
$this->validateTransactionQuery($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ class DateRequest extends FormRequest
|
||||
{
|
||||
$start = $this->getCarbonDate('start');
|
||||
$end = $this->getCarbonDate('end');
|
||||
if($start->diffInYears($end) > 5) {
|
||||
if ($start->diffInYears($end) > 5) {
|
||||
throw new FireflyException('Date range out of range.');
|
||||
}
|
||||
|
||||
|
@@ -88,7 +88,7 @@ class Request extends FormRequest
|
||||
}
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -104,7 +104,7 @@ class StoreRequest extends FormRequest
|
||||
}
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -109,7 +109,7 @@ class UpdateRequest extends FormRequest
|
||||
}
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ class StoreRequest extends FormRequest
|
||||
$this->validateAutoBudgetAmount($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -104,7 +104,7 @@ class UpdateRequest extends FormRequest
|
||||
$this->validateAutoBudgetAmount($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -88,7 +88,7 @@ class UpdateRequest extends FormRequest
|
||||
}
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -132,7 +132,7 @@ class StoreRequest extends FormRequest
|
||||
$this->validateAccountInformation($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -142,7 +142,7 @@ class UpdateRequest extends FormRequest
|
||||
$this->valUpdateAccountInfo($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -109,7 +109,7 @@ class StoreRequest extends FormRequest
|
||||
$this->atLeastOneActiveAction($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -119,7 +119,7 @@ class UpdateRequest extends FormRequest
|
||||
$this->atLeastOneValidAction($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ class TriggerRequest extends FormRequest
|
||||
|
||||
private function getAccounts(): array
|
||||
{
|
||||
if(null === $this->get('accounts')) {
|
||||
if (null === $this->get('accounts')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@@ -192,7 +192,7 @@ class StoreRequest extends FormRequest
|
||||
$this->validateGroupDescription($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -206,7 +206,7 @@ class UpdateRequest extends FormRequest
|
||||
$this->validateAccountInformationUpdate($validator, $transactionGroup);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ class StoreRequest extends FormRequest
|
||||
$this->validateExistingLink($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ class UpdateRequest extends FormRequest
|
||||
$this->validateUpdate($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -98,7 +98,7 @@ class UserUpdateRequest extends FormRequest
|
||||
}
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -80,7 +80,7 @@ class BalanceChartRequest extends FormRequest
|
||||
}
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ class DashboardChartRequest extends FormRequest
|
||||
}
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -212,7 +212,7 @@ class StoreRequest extends FormRequest
|
||||
$this->validateGroupDescription($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -207,7 +207,7 @@ class UpdateRequest extends Request
|
||||
$this->validateAccountInformationUpdate($validator, $transactionGroup);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -73,12 +73,12 @@ class UpgradeFireflyInstructions extends Command
|
||||
}
|
||||
|
||||
// validate some settings.
|
||||
if('' === $text && 'local' === (string)config('app.env')) {
|
||||
if ('' === $text && 'local' === (string)config('app.env')) {
|
||||
$text = 'Please set APP_ENV=production for a safer environment.';
|
||||
}
|
||||
|
||||
$prefix = 'v';
|
||||
if(str_starts_with($version, 'develop')) {
|
||||
if (str_starts_with($version, 'develop')) {
|
||||
$prefix = '';
|
||||
}
|
||||
|
||||
@@ -193,12 +193,12 @@ class UpgradeFireflyInstructions extends Command
|
||||
}
|
||||
|
||||
// validate some settings.
|
||||
if('' === $text && 'local' === (string)config('app.env')) {
|
||||
if ('' === $text && 'local' === (string)config('app.env')) {
|
||||
$text = 'Please set APP_ENV=production for a safer environment.';
|
||||
}
|
||||
|
||||
$prefix = 'v';
|
||||
if(str_starts_with($version, 'develop')) {
|
||||
if (str_starts_with($version, 'develop')) {
|
||||
$prefix = '';
|
||||
}
|
||||
|
||||
|
@@ -30,8 +30,8 @@ namespace FireflyIII\Enums;
|
||||
*/
|
||||
enum StringPosition
|
||||
{
|
||||
case STARTS;
|
||||
case ENDS;
|
||||
case CONTAINS;
|
||||
case IS;
|
||||
case STARTS;
|
||||
case ENDS;
|
||||
case CONTAINS;
|
||||
case IS;
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ class RuleHandler
|
||||
|
||||
try {
|
||||
Notification::send($user, new RuleActionFailed($params));
|
||||
} catch(ClientException $e) {
|
||||
} catch (ClientException $e) {
|
||||
Log::error(sprintf('[a] Error sending notification that the rule action failed: %s', $e->getMessage()));
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ class RuleHandler
|
||||
|
||||
try {
|
||||
Notification::send($user, new RuleActionFailed($params));
|
||||
} catch(ClientException $e) {
|
||||
} catch (ClientException $e) {
|
||||
Log::error(sprintf('[b] Error sending notification that the rule action failed: %s', $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ class BudgetObserver
|
||||
$budgetLimits = $budget->budgetlimits()->get();
|
||||
|
||||
/** @var BudgetLimit $budgetLimit */
|
||||
foreach($budgetLimits as $budgetLimit) {
|
||||
foreach ($budgetLimits as $budgetLimit) {
|
||||
// this loop exists so several events are fired.
|
||||
$budgetLimit->delete();
|
||||
}
|
||||
|
@@ -492,7 +492,7 @@ class GroupCollector implements GroupCollectorInterface
|
||||
if (0 === $this->limit) {
|
||||
$this->setLimit(50);
|
||||
}
|
||||
if(null !== $this->startRow && null !== $this->endRow) {
|
||||
if (null !== $this->startRow && null !== $this->endRow) {
|
||||
$total = $this->endRow - $this->startRow;
|
||||
|
||||
return new LengthAwarePaginator($set, $this->total, $total, 1);
|
||||
|
@@ -128,11 +128,11 @@ class ForgotPasswordController extends Controller
|
||||
private function validateHost(): void
|
||||
{
|
||||
$configuredHost = parse_url((string)config('app.url'), PHP_URL_HOST);
|
||||
if(false === $configuredHost || null === $configuredHost) {
|
||||
if (false === $configuredHost || null === $configuredHost) {
|
||||
throw new FireflyException('Please set a valid and correct Firefly III URL in the APP_URL environment variable.');
|
||||
}
|
||||
$host = request()->host();
|
||||
if($configuredHost !== $host) {
|
||||
if ($configuredHost !== $host) {
|
||||
throw new FireflyException('The Host-header does not match the host in the APP_URL environment variable. Please make sure these match. See also: https://bit.ly/FF3-host-header');
|
||||
}
|
||||
}
|
||||
|
@@ -66,7 +66,7 @@ class IndexController extends Controller
|
||||
*/
|
||||
public function export(): LaravelResponse|RedirectResponse
|
||||
{
|
||||
if(auth()->user()->hasRole('demo')) {
|
||||
if (auth()->user()->hasRole('demo')) {
|
||||
session()->flash('info', (string) trans('firefly.demo_user_export'));
|
||||
|
||||
return redirect(route('export.index'));
|
||||
|
@@ -387,7 +387,7 @@ class TagController extends Controller
|
||||
/** @var array $tag */
|
||||
foreach ($currency['tags'] as $tag) {
|
||||
$tagId = $tag['id'];
|
||||
if(!array_key_exists($tagId, $report)) {
|
||||
if (!array_key_exists($tagId, $report)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($tag['transaction_journals'] as $journal) {
|
||||
@@ -425,7 +425,7 @@ class TagController extends Controller
|
||||
/** @var array $tag */
|
||||
foreach ($currency['tags'] as $tag) {
|
||||
$tagId = $tag['id'];
|
||||
if(!array_key_exists($tagId, $report)) {
|
||||
if (!array_key_exists($tagId, $report)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($tag['transaction_journals'] as $journal) {
|
||||
|
@@ -140,7 +140,7 @@ class SelectController extends Controller
|
||||
$trigger = new RuleTrigger();
|
||||
$trigger->trigger_type = $textTrigger['type'];
|
||||
$trigger->trigger_value = $textTrigger['value'];
|
||||
if(false === $needsContext) {
|
||||
if (false === $needsContext) {
|
||||
$trigger->trigger_value = 'true';
|
||||
}
|
||||
$trigger->stop_processing = $textTrigger['stop_processing'];
|
||||
|
@@ -59,7 +59,7 @@ class CreateController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning('User visits webhook create page, but webhooks are DISABLED.');
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -63,7 +63,7 @@ class DeleteController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook)
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning('User visits webhook delete page, but webhooks are DISABLED.');
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -62,7 +62,7 @@ class EditController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook)
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning('User visits webhook edit page, but webhooks are DISABLED.');
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -55,7 +55,7 @@ class IndexController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning('User visits webhook index page, but webhooks are DISABLED.');
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -62,7 +62,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook)
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->warning(sprintf('User visits webhook #%d page, but webhooks are DISABLED.', $webhook->id));
|
||||
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
|
@@ -136,7 +136,7 @@ class AccountFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -62,7 +62,7 @@ class AttachmentFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ class BillStoreRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -86,7 +86,7 @@ class BillUpdateRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -83,7 +83,7 @@ class BudgetFormStoreRequest extends FormRequest
|
||||
}
|
||||
);
|
||||
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ class BudgetFormUpdateRequest extends FormRequest
|
||||
$this->validateAutoBudgetAmount($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ class BudgetIncomeRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ class BulkEditJournalRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ class CategoryFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ class ConfigurationRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ class CurrencyFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ class DeleteAccountFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ class EmailFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ class InviteUserFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ class JournalLinkRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ class LinkTypeFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ class MassDeleteJournalRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ class MassEditJournalRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ class NewUserFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -68,7 +68,7 @@ class ObjectGroupFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -73,7 +73,7 @@ class PiggyBankStoreRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ class PiggyBankUpdateRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ class ProfileFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -80,7 +80,7 @@ class ReconciliationStoreRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -247,7 +247,7 @@ class RecurrenceFormRequest extends FormRequest
|
||||
$this->validateAccountInformation($validator);
|
||||
}
|
||||
);
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -250,7 +250,7 @@ class ReportFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -123,7 +123,7 @@ class RuleFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ class RuleGroupFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ class SelectTransactionsRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ class TagFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ class TestRuleFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ class TokenFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ class TriggerRecurrenceRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -68,7 +68,7 @@ class UserFormRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ class UserRegistrationRequest extends FormRequest
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
if($validator->fails()) {
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
|
@@ -142,7 +142,7 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
continue;
|
||||
}
|
||||
$triggerType = $trigger->trigger_type;
|
||||
if(str_starts_with($trigger->trigger_type, '-')) {
|
||||
if (str_starts_with($trigger->trigger_type, '-')) {
|
||||
$triggerType = substr($trigger->trigger_type, 1);
|
||||
}
|
||||
$needsContext = config(sprintf('search.operators.%s.needs_context', $triggerType)) ?? true;
|
||||
@@ -484,7 +484,7 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
'no_external_id',
|
||||
'any_external_id',
|
||||
];
|
||||
if(in_array($type, $needTrue, true)) {
|
||||
if (in_array($type, $needTrue, true)) {
|
||||
$value = '';
|
||||
}
|
||||
|
||||
|
@@ -80,7 +80,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
$tagId = (int)$tag['id'];
|
||||
$tagName = (string)$tag['name'];
|
||||
$journalId = (int)$journal['transaction_journal_id'];
|
||||
if(!in_array($tagId, $tagIds, true)) {
|
||||
if (!in_array($tagId, $tagIds, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
$tagName = (string)$tag['name'];
|
||||
$journalId = (int)$journal['transaction_journal_id'];
|
||||
|
||||
if(!in_array($tagId, $tagIds, true)) {
|
||||
if (!in_array($tagId, $tagIds, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ class IsValidAmount implements ValidationRule
|
||||
$value = (string)$value;
|
||||
|
||||
// must not be empty:
|
||||
if($this->emptyString($value)) {
|
||||
if ($this->emptyString($value)) {
|
||||
$fail('validation.filled')->translate();
|
||||
$message = sprintf('IsValidAmount: "%s" cannot be empty.', $value);
|
||||
Log::debug($message);
|
||||
@@ -30,7 +30,7 @@ class IsValidAmount implements ValidationRule
|
||||
}
|
||||
|
||||
// must be a number:
|
||||
if(!$this->isValidNumber($value)) {
|
||||
if (!$this->isValidNumber($value)) {
|
||||
$fail('validation.numeric')->translate();
|
||||
$message = sprintf('IsValidAmount: "%s" is not a number.', $value);
|
||||
Log::debug($message);
|
||||
@@ -40,7 +40,7 @@ class IsValidAmount implements ValidationRule
|
||||
}
|
||||
|
||||
// must not be scientific notation:
|
||||
if($this->scientificNumber($value)) {
|
||||
if ($this->scientificNumber($value)) {
|
||||
$fail('validation.scientific_notation')->translate();
|
||||
$message = sprintf('IsValidAmount: "%s" cannot be in the scientific notation.', $value);
|
||||
Log::debug($message);
|
||||
@@ -50,7 +50,7 @@ class IsValidAmount implements ValidationRule
|
||||
}
|
||||
|
||||
// must be more than minus a lots:
|
||||
if($this->lessThanLots($value)) {
|
||||
if ($this->lessThanLots($value)) {
|
||||
$amount = bcmul('-1', self::BIG_AMOUNT);
|
||||
$fail('validation.gte.numeric')->translate(['value' => $amount]);
|
||||
$message = sprintf('IsValidAmount: "%s" must be more than %s.', $value, $amount);
|
||||
@@ -61,7 +61,7 @@ class IsValidAmount implements ValidationRule
|
||||
}
|
||||
|
||||
// must be less than a large number
|
||||
if($this->moreThanLots($value)) {
|
||||
if ($this->moreThanLots($value)) {
|
||||
$fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]);
|
||||
$message = sprintf('IsValidAmount: "%s" must be more than %s.', $value, self::BIG_AMOUNT);
|
||||
Log::debug($message);
|
||||
|
@@ -19,7 +19,7 @@ class IsValidPositiveAmount implements ValidationRule
|
||||
{
|
||||
$value = (string)$value;
|
||||
// must not be empty:
|
||||
if($this->emptyString($value)) {
|
||||
if ($this->emptyString($value)) {
|
||||
$fail('validation.filled')->translate();
|
||||
$message = sprintf('IsValidPositiveAmount: "%s" cannot be empty.', $value);
|
||||
Log::debug($message);
|
||||
@@ -29,7 +29,7 @@ class IsValidPositiveAmount implements ValidationRule
|
||||
}
|
||||
|
||||
// must be a number:
|
||||
if(!$this->isValidNumber($value)) {
|
||||
if (!$this->isValidNumber($value)) {
|
||||
$fail('validation.numeric')->translate();
|
||||
$message = sprintf('IsValidPositiveAmount: "%s" is not a number.', $value);
|
||||
Log::debug($message);
|
||||
@@ -38,7 +38,7 @@ class IsValidPositiveAmount implements ValidationRule
|
||||
return;
|
||||
}
|
||||
// must not be scientific notation:
|
||||
if($this->scientificNumber($value)) {
|
||||
if ($this->scientificNumber($value)) {
|
||||
$fail('validation.scientific_notation')->translate();
|
||||
$message = sprintf('IsValidPositiveAmount: "%s" cannot be in the scientific notation.', $value);
|
||||
Log::debug($message);
|
||||
@@ -47,7 +47,7 @@ class IsValidPositiveAmount implements ValidationRule
|
||||
return;
|
||||
}
|
||||
// must be more than zero:
|
||||
if($this->lessOrEqualToZero($value)) {
|
||||
if ($this->lessOrEqualToZero($value)) {
|
||||
$fail('validation.more_than_zero')->translate();
|
||||
$message = sprintf('IsValidPositiveAmount: "%s" must be more than zero.', $value);
|
||||
Log::debug($message);
|
||||
@@ -56,7 +56,7 @@ class IsValidPositiveAmount implements ValidationRule
|
||||
return;
|
||||
}
|
||||
// must be less than a large number
|
||||
if($this->moreThanLots($value)) {
|
||||
if ($this->moreThanLots($value)) {
|
||||
$fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]);
|
||||
$message = sprintf('IsValidPositiveAmount: "%s" must be less than %s.', $value, self::BIG_AMOUNT);
|
||||
Log::debug($message);
|
||||
|
@@ -19,7 +19,7 @@ class IsValidZeroOrMoreAmount implements ValidationRule
|
||||
{
|
||||
$value = (string)$value;
|
||||
// must not be empty:
|
||||
if($this->emptyString($value)) {
|
||||
if ($this->emptyString($value)) {
|
||||
$fail('validation.filled')->translate();
|
||||
$message = sprintf('IsValidZeroOrMoreAmount: "%s" cannot be empty.', $value);
|
||||
Log::debug($message);
|
||||
@@ -29,7 +29,7 @@ class IsValidZeroOrMoreAmount implements ValidationRule
|
||||
}
|
||||
|
||||
// must be a number:
|
||||
if(!$this->isValidNumber($value)) {
|
||||
if (!$this->isValidNumber($value)) {
|
||||
$fail('validation.numeric')->translate();
|
||||
$message = sprintf('IsValidZeroOrMoreAmount: "%s" is not a number.', $value);
|
||||
Log::debug($message);
|
||||
@@ -38,7 +38,7 @@ class IsValidZeroOrMoreAmount implements ValidationRule
|
||||
return;
|
||||
}
|
||||
// must not be scientific notation:
|
||||
if($this->scientificNumber($value)) {
|
||||
if ($this->scientificNumber($value)) {
|
||||
$fail('validation.scientific_notation')->translate();
|
||||
$message = sprintf('IsValidZeroOrMoreAmount: "%s" cannot be in the scientific notation.', $value);
|
||||
Log::debug($message);
|
||||
@@ -47,7 +47,7 @@ class IsValidZeroOrMoreAmount implements ValidationRule
|
||||
return;
|
||||
}
|
||||
// must be zero or more
|
||||
if(!$this->zeroOrMore($value)) {
|
||||
if (!$this->zeroOrMore($value)) {
|
||||
$fail('validation.more_than_zero_correct')->translate();
|
||||
$message = sprintf('IsValidZeroOrMoreAmount: "%s" must be zero or more.', $value);
|
||||
Log::debug($message);
|
||||
@@ -56,7 +56,7 @@ class IsValidZeroOrMoreAmount implements ValidationRule
|
||||
return;
|
||||
}
|
||||
// must be less than a large number
|
||||
if($this->moreThanLots($value)) {
|
||||
if ($this->moreThanLots($value)) {
|
||||
$fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]);
|
||||
$message = sprintf('IsValidPositiveAmount: "%s" must be less than %s.', $value, self::BIG_AMOUNT);
|
||||
Log::debug($message);
|
||||
|
@@ -44,7 +44,7 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
];
|
||||
|
||||
// try to get array from update server:
|
||||
$updateInfo = $this->contactServer($channel);
|
||||
$updateInfo = $this->contactServer($channel);
|
||||
if ('error' === $updateInfo['level']) {
|
||||
app('log')->error('Update information contains an error.');
|
||||
app('log')->error($updateInfo['message']);
|
||||
@@ -61,14 +61,14 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
{
|
||||
app('log')->debug(sprintf('Now in contactServer(%s)', $channel));
|
||||
// always fall back to current version:
|
||||
$return = [
|
||||
$return = [
|
||||
'version' => config('firefly.version'),
|
||||
'date' => today(config('app.timezone'))->startOfDay(),
|
||||
'level' => 'error',
|
||||
'message' => (string)trans('firefly.unknown_error'),
|
||||
];
|
||||
|
||||
$url = config('firefly.update_endpoint');
|
||||
$url = config('firefly.update_endpoint');
|
||||
app('log')->debug(sprintf('Going to call %s', $url));
|
||||
|
||||
try {
|
||||
@@ -96,7 +96,7 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
|
||||
return $return;
|
||||
}
|
||||
$body = (string)$res->getBody();
|
||||
$body = (string)$res->getBody();
|
||||
|
||||
try {
|
||||
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
|
||||
@@ -115,8 +115,8 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
}
|
||||
|
||||
// parse response a bit. No message yet.
|
||||
$response = $json['firefly_iii'][$channel];
|
||||
$date = Carbon::createFromFormat('Y-m-d', $response['date']);
|
||||
$response = $json['firefly_iii'][$channel];
|
||||
$date = Carbon::createFromFormat('Y-m-d', $response['date']);
|
||||
if (false === $date) {
|
||||
$date = today(config('app.timezone'));
|
||||
}
|
||||
@@ -135,9 +135,9 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
private function parseResult(array $information): array
|
||||
{
|
||||
app('log')->debug('Now in parseResult()', $information);
|
||||
$return = [];
|
||||
$current = (string)config('firefly.version');
|
||||
$latest = $information['version'];
|
||||
$return = [];
|
||||
$current = (string)config('firefly.version');
|
||||
$latest = $information['version'];
|
||||
|
||||
// strip the 'v' from the version if it's there.
|
||||
if (str_starts_with($latest, 'v')) {
|
||||
@@ -147,7 +147,7 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
return $this->parseDevelopResult($current, $latest, $information);
|
||||
}
|
||||
|
||||
$compare = version_compare($latest, $current);
|
||||
$compare = version_compare($latest, $current);
|
||||
|
||||
app('log')->debug(sprintf('Current version is "%s", latest is "%s", result is: %d', $current, $latest, $compare));
|
||||
|
||||
@@ -170,10 +170,10 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
|
||||
// a newer version is available!
|
||||
/** @var Carbon $released */
|
||||
$released = $information['date'];
|
||||
$today = today(config('app.timezone'))->startOfDay();
|
||||
$diff = $today->diffInDays($released);
|
||||
$expectedDiff = config('firefly.update_minimum_age') ?? 6;
|
||||
$released = $information['date'];
|
||||
$today = today(config('app.timezone'))->startOfDay();
|
||||
$diff = $today->diffInDays($released);
|
||||
$expectedDiff = config('firefly.update_minimum_age') ?? 6;
|
||||
// it's still very fresh, and user wants a stable release:
|
||||
if ($diff <= $expectedDiff) {
|
||||
$return['level'] = 'info';
|
||||
@@ -204,13 +204,13 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
|
||||
// add warning in case of alpha or beta:
|
||||
// append warning if beta or alpha.
|
||||
$isBeta = $information['is_beta'] ?? false;
|
||||
$isBeta = $information['is_beta'] ?? false;
|
||||
if (true === $isBeta) {
|
||||
$return['message'] = sprintf('%s %s', $return['message'], trans('firefly.update_version_beta'));
|
||||
app('log')->debug('New release is also a beta!');
|
||||
}
|
||||
|
||||
$isAlpha = $information['is_alpha'] ?? false;
|
||||
$isAlpha = $information['is_alpha'] ?? false;
|
||||
if (true === $isAlpha) {
|
||||
$return['message'] = sprintf('%s %s', $return['message'], trans('firefly.update_version_alpha'));
|
||||
app('log')->debug('New release is also a alpha!');
|
||||
@@ -226,11 +226,11 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
private function parseDevelopResult(string $current, string $latest, array $information): array
|
||||
{
|
||||
Log::debug(sprintf('User is running develop version "%s"', $current));
|
||||
$parts = explode('/', $current);
|
||||
$return = [];
|
||||
$parts = explode('/', $current);
|
||||
$return = [];
|
||||
|
||||
/** @var Carbon $devDate */
|
||||
$devDate = Carbon::createFromFormat('Y-m-d', $parts[1]);
|
||||
$devDate = Carbon::createFromFormat('Y-m-d', $parts[1]);
|
||||
|
||||
if ($devDate->lte($information['date'])) {
|
||||
Log::debug(sprintf('This development release is older, release = %s, latest version %s = %s', $devDate->format('Y-m-d'), $latest, $information['date']->format('Y-m-d')));
|
||||
|
@@ -620,7 +620,7 @@ trait TransactionValidation
|
||||
|
||||
break;
|
||||
|
||||
case'transfer':
|
||||
case 'transfer':
|
||||
if (count($sources) > 1 || count($dests) > 1) {
|
||||
$validator->errors()->add('transactions.0.source_id', (string) trans('validation.all_accounts_equal'));
|
||||
$validator->errors()->add('transactions.0.destination_id', (string) trans('validation.all_accounts_equal'));
|
||||
|
Reference in New Issue
Block a user