From 320f0242d0b6f6d29fd598dfa34fffdbc1fb997a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 5 Jul 2023 21:28:15 +1000 Subject: [PATCH 1/3] Fixes for test --- app/Export/CSV/BaseExport.php | 2 ++ phpstan.neon | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Export/CSV/BaseExport.php b/app/Export/CSV/BaseExport.php index 9b606b07c807..9d704574d990 100644 --- a/app/Export/CSV/BaseExport.php +++ b/app/Export/CSV/BaseExport.php @@ -501,6 +501,8 @@ class BaseExport foreach (array_merge($this->input['report_keys'], $this->forced_keys) as $value) { $key = array_search($value, $this->entity_keys); + + $prefix = ''; if(!$key) { $prefix = stripos($value, 'client.') !== false ? ctrans('texts.client') : ctrans('texts.contact'); diff --git a/phpstan.neon b/phpstan.neon index 02983dff19a6..ab6b6936544c 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,9 +2,11 @@ includes: - ./vendor/nunomaduro/larastan/extension.neon parameters: - parallel: - processTimeout: 300.0 treatPhpDocTypesAsCertain: false + parallel: + jobSize: 20 + maximumNumberOfProcesses: 2 + processTimeout: 300.0 ignoreErrors: - '#Call to an undefined method .*badMethod\(\)#' - '#Call to an undefined method Illuminate\Database\Eloquent\Builder::exclude#' From e1587d79207b01d66874fd8791fc77307a3434b1 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 6 Jul 2023 10:12:42 +1000 Subject: [PATCH 2/3] Fixes for static analysis --- app/Console/Commands/CheckData.php | 2 +- app/Models/BaseModel.php | 3 ++ app/Models/Client.php | 21 +---------- app/Models/Company.php | 57 ++++++++++++++---------------- phpstan.neon | 4 +-- 5 files changed, 33 insertions(+), 54 deletions(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 9822ec1347f7..a793a593bf40 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -154,7 +154,7 @@ class CheckData extends Command ->subject('Check-Data: '.strtoupper($this->isValid ? Account::RESULT_SUCCESS : Account::RESULT_FAILURE)." [{$database}]"); }); } elseif (! $this->isValid) { - new Exception("Check data failed!!\n".$this->log); + new \Exception("Check data failed!!".$this->log); } } diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index fc3dbface7c3..f5d58460bb37 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -47,8 +47,11 @@ use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundExceptio * @method static \Illuminate\Database\Eloquent\Builder|BaseModel count() * @method static \Illuminate\Database\Eloquent\Builder|BaseModel create() * @method static \Illuminate\Database\Eloquent\Builder|BaseModel insert() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel service() * @method static \Illuminate\Database\Eloquent\Builder|BaseModel whereHas() * @method static \Illuminate\Database\Eloquent\Builder|BaseModel withTrashed() + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read int|null $invitations_count * * @method \App\Models\Company company() * @method int companyId() diff --git a/app/Models/Client.php b/app/Models/Client.php index 6feeb9e26ec0..acd034b9643c 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -175,26 +175,7 @@ use Laracasts\Presenter\PresentableTrait; * @method static \Illuminate\Database\Eloquent\Builder|Client whereTaxData($value) * @property int $is_tax_exempt * @method static \Illuminate\Database\Eloquent\Builder|Client whereIsTaxExempt($value) - * @property-read \Illuminate\Database\Eloquent\Collection $activities - * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger - * @property-read \Illuminate\Database\Eloquent\Collection $contacts - * @property-read \Illuminate\Database\Eloquent\Collection $credits - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $expenses - * @property-read \Illuminate\Database\Eloquent\Collection $group_settings - * @property-read \Illuminate\Database\Eloquent\Collection $gateway_tokens - * @property-read \Illuminate\Database\Eloquent\Collection $invoices - * @property-read \Illuminate\Database\Eloquent\Collection $ledger - * @property-read \Illuminate\Database\Eloquent\Collection $payments - * @property-read \Illuminate\Database\Eloquent\Collection $primary_contact - * @property-read \Illuminate\Database\Eloquent\Collection $projects - * @property-read \Illuminate\Database\Eloquent\Collection $quotes - * @property-read \Illuminate\Database\Eloquent\Collection $recurring_expenses - * @property-read \Illuminate\Database\Eloquent\Collection $recurring_invoices - * @property-read \Illuminate\Database\Eloquent\Collection $system_logs - * @property-read \Illuminate\Database\Eloquent\Collection $tasks - * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger - * @property-read \Illuminate\Database\Eloquent\Collection $contacts + * @property int $has_valid_vat_number * @mixin \Eloquent */ diff --git a/app/Models/Company.php b/app/Models/Company.php index 84cf6f47b3a2..ea94a0a6c1d1 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -212,29 +212,29 @@ class Company extends BaseModel use AppSetup; use \Awobaz\Compoships\Compoships; - const ENTITY_RECURRING_INVOICE = 'recurring_invoice'; + // const ENTITY_RECURRING_INVOICE = 'recurring_invoice'; - const ENTITY_CREDIT = 'credit'; + // const ENTITY_CREDIT = 'credit'; - const ENTITY_QUOTE = 'quote'; + // const ENTITY_QUOTE = 'quote'; - const ENTITY_TASK = 'task'; + // const ENTITY_TASK = 'task'; - const ENTITY_EXPENSE = 'expense'; + // const ENTITY_EXPENSE = 'expense'; - const ENTITY_PROJECT = 'project'; + // const ENTITY_PROJECT = 'project'; - const ENTITY_VENDOR = 'vendor'; + // const ENTITY_VENDOR = 'vendor'; - const ENTITY_TICKET = 'ticket'; + // const ENTITY_TICKET = 'ticket'; - const ENTITY_PROPOSAL = 'proposal'; + // const ENTITY_PROPOSAL = 'proposal'; - const ENTITY_RECURRING_EXPENSE = 'recurring_expense'; + // const ENTITY_RECURRING_EXPENSE = 'recurring_expense'; - const ENTITY_RECURRING_TASK = 'task'; + // const ENTITY_RECURRING_TASK = 'task'; - const ENTITY_RECURRING_QUOTE = 'recurring_quote'; + // const ENTITY_RECURRING_QUOTE = 'recurring_quote'; protected $presenter = CompanyPresenter::class; @@ -367,31 +367,26 @@ class Company extends BaseModel protected $with = []; - public static $modules = [ - self::ENTITY_RECURRING_INVOICE => 1, - self::ENTITY_CREDIT => 2, - self::ENTITY_QUOTE => 4, - self::ENTITY_TASK => 8, - self::ENTITY_EXPENSE => 16, - self::ENTITY_PROJECT => 32, - self::ENTITY_VENDOR => 64, - self::ENTITY_TICKET => 128, - self::ENTITY_PROPOSAL => 256, - self::ENTITY_RECURRING_EXPENSE => 512, - self::ENTITY_RECURRING_TASK => 1024, - self::ENTITY_RECURRING_QUOTE => 2048, - ]; + // public static $modules = [ + // self::ENTITY_RECURRING_INVOICE => 1, + // self::ENTITY_CREDIT => 2, + // self::ENTITY_QUOTE => 4, + // self::ENTITY_TASK => 8, + // self::ENTITY_EXPENSE => 16, + // self::ENTITY_PROJECT => 32, + // self::ENTITY_VENDOR => 64, + // self::ENTITY_TICKET => 128, + // self::ENTITY_PROPOSAL => 256, + // self::ENTITY_RECURRING_EXPENSE => 512, + // self::ENTITY_RECURRING_TASK => 1024, + // self::ENTITY_RECURRING_QUOTE => 2048, + // ]; public function shouldCalculateTax() { return $this->calculate_taxes && in_array($this->getSetting('country_id'), $this->tax_coverage_countries); } - public function refreshTaxData() - { - - } - public function documents() { return $this->morphMany(Document::class, 'documentable'); diff --git a/phpstan.neon b/phpstan.neon index ab6b6936544c..859693d32cae 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,10 +3,10 @@ includes: parameters: treatPhpDocTypesAsCertain: false - parallel: + parallel: jobSize: 20 maximumNumberOfProcesses: 2 - processTimeout: 300.0 + processTimeout: 300.0 ignoreErrors: - '#Call to an undefined method .*badMethod\(\)#' - '#Call to an undefined method Illuminate\Database\Eloquent\Builder::exclude#' From e8f11eabdd65299190a61e882437ef6830090638 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 6 Jul 2023 10:18:40 +1000 Subject: [PATCH 3/3] Fixes for react builds --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1be04124823..cacb0cf11c43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,8 @@ jobs: git checkout main npm i npm run build - cp -r dist/react/* ../public/react + cp -r dist/react/* ../public/react + cp -r node_modules/tinymce ../public/ cd .. rm -rf ui php artisan ninja:react