remove unused variables from ExpenseMailbox check

This commit is contained in:
paulwer 2024-04-07 16:30:04 +02:00
parent 8547af74ab
commit 7b29ee8ebf
3 changed files with 3 additions and 5 deletions

View File

@ -57,7 +57,7 @@ class StoreCompanyRequest extends Request
} }
} }
$rules['expense_mailbox'] = new ValidExpenseMailbox($this->company->key, $this->company->account->isPaid() && $this->company->account->plan == 'enterprise'); $rules['expense_mailbox'] = new ValidExpenseMailbox();
$rules['smtp_host'] = 'sometimes|string|nullable'; $rules['smtp_host'] = 'sometimes|string|nullable';
$rules['smtp_port'] = 'sometimes|integer|nullable'; $rules['smtp_port'] = 'sometimes|integer|nullable';

View File

@ -74,7 +74,7 @@ class UpdateCompanyRequest extends Request
$rules['subdomain'] = ['nullable', 'regex:/^[a-zA-Z0-9.-]+[a-zA-Z0-9]$/', new ValidSubdomain()]; $rules['subdomain'] = ['nullable', 'regex:/^[a-zA-Z0-9.-]+[a-zA-Z0-9]$/', new ValidSubdomain()];
} }
$rules['expense_mailbox'] = new ValidExpenseMailbox($this->company->key, $this->company->account->isPaid() && $this->company->account->plan == 'enterprise'); // @turbo124 check if this is right $rules['expense_mailbox'] = new ValidExpenseMailbox();
return $rules; return $rules;
} }

View File

@ -22,15 +22,13 @@ class ValidExpenseMailbox implements Rule
{ {
private $validated_schema = false; private $validated_schema = false;
private $company_key = false;
private $isEnterprise = false; private $isEnterprise = false;
private array $endings; private array $endings;
private bool $hasCompanyKey; private bool $hasCompanyKey;
private array $enterprise_endings; private array $enterprise_endings;
public function __construct(string $company_key, bool $isEnterprise = false) public function __construct()
{ {
$this->company_key = $company_key;
$this->endings = explode(",", config('ninja.inbound_mailbox.expense_mailbox_endings')); $this->endings = explode(",", config('ninja.inbound_mailbox.expense_mailbox_endings'));
} }