From 74701e8b701da402a41ad94c7bd98c31d2aec014 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 31 Oct 2020 16:45:10 +1100 Subject: [PATCH 1/8] Test cleanup --- tests/Unit/Migration/ImportTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/Unit/Migration/ImportTest.php b/tests/Unit/Migration/ImportTest.php index f39f06e1a0ef..9d4b5451c381 100644 --- a/tests/Unit/Migration/ImportTest.php +++ b/tests/Unit/Migration/ImportTest.php @@ -61,19 +61,19 @@ class ImportTest extends TestCase $this->assertTrue($status); } - public function testAllImport() - { + // public function testAllImport() + // { - $this->invoice->forceDelete(); - $this->quote->forceDelete(); + // $this->invoice->forceDelete(); + // $this->quote->forceDelete(); - $this->user->setCompany($this->company); - auth()->login($this->user, true); + // $this->user->setCompany($this->company); + // auth()->login($this->user, true); - Import::dispatchNow($this->migration_array, $this->company, $this->user); + // Import::dispatchNow($this->migration_array, $this->company, $this->user); - $this->assertTrue(true); - } + // $this->assertTrue(true); + // } // public function testExceptionOnUnavailableResource() // { From dfb55dbd8ba68687aa44fdf3d3b9bbb436400a4c Mon Sep 17 00:00:00 2001 From: = Date: Sun, 1 Nov 2020 14:19:03 +1100 Subject: [PATCH 2/8] remove is_migrating --- app/Jobs/Entity/EmailEntity.php | 4 ++- app/Jobs/Mail/BaseMailerJob.php | 2 +- app/Jobs/Mail/EntityPaidMailer.php | 9 +++--- app/Jobs/Mail/EntitySentMailer.php | 4 +++ app/Jobs/Mail/EntityViewedMailer.php | 5 +++- app/Jobs/Mail/MailRouter.php | 4 +++ app/Jobs/Mail/PaymentFailureMailer.php | 4 +++ app/Jobs/Payment/EmailPayment.php | 8 ++++- app/Jobs/User/UserEmailChanged.php | 3 ++ app/Jobs/Util/StartMigration.php | 3 +- app/Listeners/Payment/PaymentNotification.php | 7 +++-- app/Models/Company.php | 10 +------ app/Repositories/UserRepository.php | 8 +---- app/Services/Payment/SendEmail.php | 2 +- .../Traits/Notifications/UserNotifies.php | 6 +--- ...020_11_01_031750_drop_migrating_column.php | 30 +++++++++++++++++++ 16 files changed, 74 insertions(+), 35 deletions(-) create mode 100644 database/migrations/2020_11_01_031750_drop_migrating_column.php diff --git a/app/Jobs/Entity/EmailEntity.php b/app/Jobs/Entity/EmailEntity.php index 811a4e4cabd6..2edf49716043 100644 --- a/app/Jobs/Entity/EmailEntity.php +++ b/app/Jobs/Entity/EmailEntity.php @@ -94,7 +94,9 @@ class EmailEntity extends BaseMailerJob implements ShouldQueue */ public function handle() { - + if($this->company->is_disabled) + return true; + MultiDB::setDB($this->company->db); $this->setMailDriver(); diff --git a/app/Jobs/Mail/BaseMailerJob.php b/app/Jobs/Mail/BaseMailerJob.php index 38ef8ade78e9..bc1a1e8ab5aa 100644 --- a/app/Jobs/Mail/BaseMailerJob.php +++ b/app/Jobs/Mail/BaseMailerJob.php @@ -57,7 +57,7 @@ class BaseMailerJob implements ShouldQueue } /* - * Now that our token is refresh and valid we can boot the + * Now that our token is refreshed and valid we can boot the * mail driver at runtime and also set the token which will persist * just for this request. */ diff --git a/app/Jobs/Mail/EntityPaidMailer.php b/app/Jobs/Mail/EntityPaidMailer.php index ffb5f525d838..b0defdc0cab9 100644 --- a/app/Jobs/Mail/EntityPaidMailer.php +++ b/app/Jobs/Mail/EntityPaidMailer.php @@ -71,14 +71,13 @@ class EntityPaidMailer extends BaseMailerJob implements ShouldQueue */ public function handle() { + /*If we are migrating data we don't want to fire these notification*/ + if ($this->company->is_disabled) + return true; + //Set DB MultiDB::setDb($this->company->db); - /*If we are migrating data we don't want to fire these notification*/ - if ($this->company->company_users->first()->is_migrating) { - return true; - } - //if we need to set an email driver do it now $this->setMailDriver(); diff --git a/app/Jobs/Mail/EntitySentMailer.php b/app/Jobs/Mail/EntitySentMailer.php index 49c92779fe34..062c1d857cbc 100644 --- a/app/Jobs/Mail/EntitySentMailer.php +++ b/app/Jobs/Mail/EntitySentMailer.php @@ -75,6 +75,10 @@ class EntitySentMailer extends BaseMailerJob implements ShouldQueue */ public function handle() { + /*If we are migrating data we don't want to fire these notification*/ + if ($this->company->is_disabled) + return true; + //Set DB MultiDB::setDb($this->company->db); diff --git a/app/Jobs/Mail/EntityViewedMailer.php b/app/Jobs/Mail/EntityViewedMailer.php index 5ff8696ef5ef..4dad5c068e1f 100644 --- a/app/Jobs/Mail/EntityViewedMailer.php +++ b/app/Jobs/Mail/EntityViewedMailer.php @@ -75,7 +75,10 @@ class EntityViewedMailer extends BaseMailerJob implements ShouldQueue */ public function handle() { - + /*If we are migrating data we don't want to fire these notification*/ + if ($this->company->is_disabled) + return true; + //Set DB MultiDB::setDb($this->company->db); diff --git a/app/Jobs/Mail/MailRouter.php b/app/Jobs/Mail/MailRouter.php index bb239ba6e3e7..db6ebd423a58 100644 --- a/app/Jobs/Mail/MailRouter.php +++ b/app/Jobs/Mail/MailRouter.php @@ -67,6 +67,10 @@ class MailRouter extends BaseMailerJob implements ShouldQueue public function handle() { + /*If we are migrating data we don't want to fire these notification*/ + if ($this->company->is_disabled) + return true; + MultiDB::setDb($this->company->db); //if we need to set an email driver do it now diff --git a/app/Jobs/Mail/PaymentFailureMailer.php b/app/Jobs/Mail/PaymentFailureMailer.php index 657bde7b0b2a..d06dd7cc994d 100644 --- a/app/Jobs/Mail/PaymentFailureMailer.php +++ b/app/Jobs/Mail/PaymentFailureMailer.php @@ -76,6 +76,10 @@ class PaymentFailureMailer extends BaseMailerJob implements ShouldQueue */ public function handle() { + /*If we are migrating data we don't want to fire these notification*/ + if ($this->company->is_disabled) + return true; + //Set DB MultiDB::setDb($this->company->db); diff --git a/app/Jobs/Payment/EmailPayment.php b/app/Jobs/Payment/EmailPayment.php index 1a1aad0aa23b..8c3487a6824c 100644 --- a/app/Jobs/Payment/EmailPayment.php +++ b/app/Jobs/Payment/EmailPayment.php @@ -32,18 +32,21 @@ class EmailPayment extends BaseMailerJob implements ShouldQueue private $contact; + private $company; /** * Create a new job instance. * * @param Payment $payment * @param $email_builder * @param $contact + * @param $company */ - public function __construct(Payment $payment, $email_builder, $contact) + public function __construct(Payment $payment, $email_builder, $contact, company) { $this->payment = $payment; $this->email_builder = $email_builder; $this->contact = $contact; + $this->company = $company; } /** @@ -54,6 +57,9 @@ class EmailPayment extends BaseMailerJob implements ShouldQueue */ public function handle() { + if($this->company->is_disabled) + return true; + if ($this->contact->email) { MultiDB::setDb($this->payment->company->db); //this may fail if we don't pass the serialized object with the company record diff --git a/app/Jobs/User/UserEmailChanged.php b/app/Jobs/User/UserEmailChanged.php index 0b5863480d68..02a788a3f1c0 100644 --- a/app/Jobs/User/UserEmailChanged.php +++ b/app/Jobs/User/UserEmailChanged.php @@ -54,6 +54,9 @@ class UserEmailChanged extends BaseMailerJob implements ShouldQueue public function handle() { + if($this->company->is_disabled) + return true; + //Set DB MultiDB::setDb($this->company->db); diff --git a/app/Jobs/Util/StartMigration.php b/app/Jobs/Util/StartMigration.php index 31c256751d46..af0524c45078 100644 --- a/app/Jobs/Util/StartMigration.php +++ b/app/Jobs/Util/StartMigration.php @@ -79,7 +79,8 @@ class StartMigration implements ShouldQueue auth()->user()->setCompany($this->company); - $this->company->setMigration(true); + $this->company->is_disabled = true; + $this->company->save(); $zip = new ZipArchive(); $archive = $zip->open($this->filepath); diff --git a/app/Listeners/Payment/PaymentNotification.php b/app/Listeners/Payment/PaymentNotification.php index 8bf809f35f71..f57e070e0a1b 100644 --- a/app/Listeners/Payment/PaymentNotification.php +++ b/app/Listeners/Payment/PaymentNotification.php @@ -48,12 +48,13 @@ class PaymentNotification implements ShouldQueue MultiDB::setDb($event->company->db); $payment = $event->payment; + + if ($event->company->is_disabled) { + return true; + } /*User notifications*/ foreach ($payment->company->company_users as $company_user) { - if ($company_user->is_migrating) { - return true; - } $user = $company_user->user; diff --git a/app/Models/Company.php b/app/Models/Company.php index 7295fcc4666b..f34fd1f6ae9b 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -443,13 +443,5 @@ class Company extends BaseModel return $this->slack_webhook_url; } - public function setMigration($status) - { - $company_users = CompanyUser::where('company_id', $this->id)->get(); - - foreach ($company_users as $cu) { - $cu->is_migrating = $status; - $cu->save(); - } - } + } diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index 15d46041befb..f79f16ce2dff 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -43,11 +43,10 @@ class UserRepository extends BaseRepository * @param array $data The data * @param \App\Models\user $user The user * - * @param bool $is_migrating * @param bool $unset_company_user * @return user|\App\Models\user|null user Object */ - public function save(array $data, User $user, $is_migrating = false, $unset_company_user = false) + public function save(array $data, User $user, $unset_company_user = false) { $details = $data; @@ -85,7 +84,6 @@ class UserRepository extends BaseRepository if (! $cu) { $data['company_user']['account_id'] = $account->id; $data['company_user']['notifications'] = CompanySettings::notificationDefaults(); - $data['company_user']['is_migrating'] = $is_migrating; $user->companies()->attach($company->id, $data['company_user']); } else { $cu->fill($data['company_user']); @@ -108,8 +106,6 @@ class UserRepository extends BaseRepository public function destroy(array $data, User $user) { -info("destroy user"); - if (array_key_exists('company_user', $data)) { $this->forced_includes = 'company_users'; @@ -136,8 +132,6 @@ info("destroy user"); public function delete($user) { -info("delete user"); - $company = auth()->user()->company(); $cu = CompanyUser::whereUserId($user->id) diff --git a/app/Services/Payment/SendEmail.php b/app/Services/Payment/SendEmail.php index 89f6b502c21b..2c7e897d3a90 100644 --- a/app/Services/Payment/SendEmail.php +++ b/app/Services/Payment/SendEmail.php @@ -37,7 +37,7 @@ class SendEmail $this->payment->client->contacts->each(function ($contact) use ($email_builder) { if ($contact->send && $contact->email) { - EmailPayment::dispatchNow($this->payment, $email_builder, $contact); + EmailPayment::dispatchNow($this->payment, $email_builder, $contact, $this->payment->company); } }); } diff --git a/app/Utils/Traits/Notifications/UserNotifies.php b/app/Utils/Traits/Notifications/UserNotifies.php index 38382a03f07b..7ff3b0a1cf60 100644 --- a/app/Utils/Traits/Notifications/UserNotifies.php +++ b/app/Utils/Traits/Notifications/UserNotifies.php @@ -18,7 +18,7 @@ trait UserNotifies { public function findUserNotificationTypes($invitation, $company_user, $entity_name, $required_permissions) :array { - if ($this->migrationRunning($company_user)) { + if ($company_user->company->is_disabled) { return []; } @@ -79,8 +79,4 @@ trait UserNotifies return $notifiable_methods; } - private function migrationRunning($company_user) - { - return $company_user->is_migrating; - } } diff --git a/database/migrations/2020_11_01_031750_drop_migrating_column.php b/database/migrations/2020_11_01_031750_drop_migrating_column.php new file mode 100644 index 000000000000..a85f1bbac1ee --- /dev/null +++ b/database/migrations/2020_11_01_031750_drop_migrating_column.php @@ -0,0 +1,30 @@ +dropColumn('is_migrating'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} From e4b326c4236fc01b0815bdce7081d1bbbd2b4a57 Mon Sep 17 00:00:00 2001 From: = Date: Sun, 1 Nov 2020 14:21:39 +1100 Subject: [PATCH 3/8] Removing is_migrating --- app/Jobs/Util/WebhookHandler.php | 2 +- app/Repositories/UserRepository.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Jobs/Util/WebhookHandler.php b/app/Jobs/Util/WebhookHandler.php index 12a9e9285592..e4c947cac3e2 100644 --- a/app/Jobs/Util/WebhookHandler.php +++ b/app/Jobs/Util/WebhookHandler.php @@ -41,7 +41,7 @@ class WebhookHandler implements ShouldQueue */ public function handle() :bool { - if (! $this->entity->company || $this->entity->company->company_users->first()->is_migrating == true) { + if (! $this->entity->company || $this->entity->company->is_disabled) { return true; } diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index f79f16ce2dff..dfa0c531a117 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -89,7 +89,6 @@ class UserRepository extends BaseRepository $cu->fill($data['company_user']); $cu->restore(); $cu->tokens()->restore(); - $cu->is_migrating = true; $cu->save(); } From 39f084c03084835206e43a063cbb9e5267390048 Mon Sep 17 00:00:00 2001 From: = Date: Sun, 1 Nov 2020 14:25:55 +1100 Subject: [PATCH 4/8] Clean setupcontroller and .env.example variables --- .env.example | 5 ----- app/Http/Controllers/SetupController.php | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.env.example b/.env.example index b92cf8fae044..54e388c4fee7 100644 --- a/.env.example +++ b/.env.example @@ -55,10 +55,5 @@ NINJA_ENVIRONMENT=selfhost PHANTOMJS_KEY='a-demo-key-with-low-quota-per-ip-address' PHANTOMJS_SECRET= -SELF_UPDATER_REPO_VENDOR = invoiceninja -SELF_UPDATER_REPO_NAME = invoiceninja -SELF_UPDATER_USE_BRANCH = v2 -SELF_UPDATER_MAILTO_ADDRESS = user@example.com -SELF_UPDATER_MAILTO_NAME = "John Doe" COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}' SENTRY_LARAVEL_DSN=https://cc7e8e2c678041689e53e409b7dba236@sentry.invoicing.co/5 \ No newline at end of file diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index ed93f6d27872..66f3d58d60cd 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -87,11 +87,6 @@ class SetupController extends Controller $_ENV['MAIL_FROM_ADDRESS'] = $request->input('mail_address'); $_ENV['MAIL_PASSWORD'] = $request->input('mail_password'); $_ENV['NINJA_ENVIRONMENT'] = 'selfhost'; - $_ENV['SELF_UPDATER_REPO_VENDOR'] = 'invoiceninja'; - $_ENV['SELF_UPDATER_REPO_NAME'] = 'invoiceninja'; - $_ENV['SELF_UPDATER_USE_BRANCH'] = 'v2'; - $_ENV['SELF_UPDATER_MAILTO_ADDRESS'] = $request->input('mail_address'); - $_ENV['SELF_UPDATER_MAILTO_NAME'] = $request->input('mail_name'); $_ENV['DB_CONNECTION'] = 'db-ninja-01'; $config = ''; From 6479b2fd3e43f58b39ee24bf150076f54d08aa7a Mon Sep 17 00:00:00 2001 From: = Date: Sun, 1 Nov 2020 16:09:09 +1100 Subject: [PATCH 5/8] Fix for laravel 8 route file regression + psalm cleanup --- .env.ci | 1 + app/DataMapper/CompanySettings.php | 2 +- app/DataMapper/FreeCompanySettings.php | 2 +- app/Http/Middleware/SetEmailDb.php | 10 +- .../Requests/Client/UpdateClientRequest.php | 2 +- .../Requests/Company/UpdateCompanyRequest.php | 2 +- .../UpdateGroupSettingRequest.php | 2 +- app/Models/Client.php | 2 +- app/Models/CompanyGateway.php | 36 +- app/Models/Credit.php | 2 +- app/Models/Invoice.php | 2 +- app/Models/Quote.php | 2 +- app/PaymentDrivers/BasePaymentDriver.php | 2 +- app/Repositories/PaymentRepository.php | 4 + .../RecurringInvoiceRepository.php | 2 +- app/Repositories/TaskRepository.php | 8 +- app/Services/Payment/SendEmail.php | 2 +- app/Transformers/UserTransformer.php | 1 - app/Utils/EmailStats.php | 2 +- app/Utils/HtmlEngine.php | 4 +- app/Utils/PhantomJS/Phantom.php | 3 +- app/Utils/Traits/ClientGroupSettingsSaver.php | 5 +- .../CompanyGatewayFeesAndLimitsSaver.php | 2 +- app/Utils/Traits/CompanySettingsSaver.php | 4 +- app/Utils/Traits/GeneratesCounter.php | 2 +- app/Utils/Traits/Inviteable.php | 7 +- app/Utils/Traits/MakesDates.php | 8 +- app/Utils/Traits/MakesHash.php | 2 +- composer.lock | 622 ++++++------------ psalm.xml | 11 + routes/api.php | 3 +- tests/Feature/LoginTest.php | 20 +- 32 files changed, 295 insertions(+), 484 deletions(-) diff --git a/.env.ci b/.env.ci index 87976de27699..d4b797cd2ea3 100644 --- a/.env.ci +++ b/.env.ci @@ -19,3 +19,4 @@ DB_HOST=127.0.0.1 NINJA_ENVIRONMENT=hosted COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}' TRAVIS=true +API_SECRET=superdoopersecrethere diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index da6e14811cad..24d668064b6c 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -507,7 +507,7 @@ class CompanySettings extends BaseSettings /** * Provides class defaults on init. - * @return object + * @return stdClass */ public static function defaults(): stdClass { diff --git a/app/DataMapper/FreeCompanySettings.php b/app/DataMapper/FreeCompanySettings.php index 708e546e3112..0e38bf5d9cf3 100644 --- a/app/DataMapper/FreeCompanySettings.php +++ b/app/DataMapper/FreeCompanySettings.php @@ -149,7 +149,7 @@ class FreeCompanySettings extends BaseSettings /** * Provides class defaults on init. - * @return object + * @return stdClass */ public static function defaults(): stdClass { diff --git a/app/Http/Middleware/SetEmailDb.php b/app/Http/Middleware/SetEmailDb.php index 71a2ea01aad7..ec22cacae3d3 100644 --- a/app/Http/Middleware/SetEmailDb.php +++ b/app/Http/Middleware/SetEmailDb.php @@ -34,12 +34,14 @@ class SetEmailDb ]; if ($request->input('email') && config('ninja.db.multi_db_enabled')) { + info("trying to find db"); if (! MultiDB::userFindAndSetDb($request->input('email'))) { - return response()->json($error, 403); + return response()->json($error, 400); } - } else { - return response()->json($error, 403); - } + } + // else { + // return response()->json($error, 403); + // } return $next($request); } diff --git a/app/Http/Requests/Client/UpdateClientRequest.php b/app/Http/Requests/Client/UpdateClientRequest.php index a29416c06bcf..4b9963b6f2ef 100644 --- a/app/Http/Requests/Client/UpdateClientRequest.php +++ b/app/Http/Requests/Client/UpdateClientRequest.php @@ -112,7 +112,7 @@ class UpdateClientRequest extends Request * are saveable * * @param object $settings - * @return object $settings + * @return stdClass $settings */ private function filterSaveableSettings($settings) { diff --git a/app/Http/Requests/Company/UpdateCompanyRequest.php b/app/Http/Requests/Company/UpdateCompanyRequest.php index e1b3b32b37ef..76464d7a8b62 100644 --- a/app/Http/Requests/Company/UpdateCompanyRequest.php +++ b/app/Http/Requests/Company/UpdateCompanyRequest.php @@ -76,7 +76,7 @@ class UpdateCompanyRequest extends Request * are saveable * * @param object $settings - * @return object $settings + * @return stdClass $settings */ private function filterSaveableSettings($settings) { diff --git a/app/Http/Requests/GroupSetting/UpdateGroupSettingRequest.php b/app/Http/Requests/GroupSetting/UpdateGroupSettingRequest.php index 16442d1e323f..06b4b505f21f 100644 --- a/app/Http/Requests/GroupSetting/UpdateGroupSettingRequest.php +++ b/app/Http/Requests/GroupSetting/UpdateGroupSettingRequest.php @@ -58,7 +58,7 @@ class UpdateGroupSettingRequest extends Request * are saveable * * @param object $settings - * @return object $settings + * @return stdClass $settings */ private function filterSaveableSettings($settings) { diff --git a/app/Models/Client.php b/app/Models/Client.php index 09355b3dcb25..b563c9fa82a0 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -285,7 +285,7 @@ class Client extends BaseModel implements HasLocalePreference * of settings which have been merged from * Client > Group > Company levels. * - * @return object stdClass object of settings + * @return stdClass stdClass object of settings */ public function getMergedSettings() :object { diff --git a/app/Models/CompanyGateway.php b/app/Models/CompanyGateway.php index d8831a7b02e7..0de3bd5f226e 100644 --- a/app/Models/CompanyGateway.php +++ b/app/Models/CompanyGateway.php @@ -324,32 +324,32 @@ class CompanyGateway extends BaseModel * @param $invoice_count * @return stdClass */ - public function calcGatewayFeeObject($amount, $invoice_count) - { - $total_gateway_fee = $this->calcGatewayFee($amount); + // public function calcGatewayFeeObject($amount, $invoice_count) + // { + // $total_gateway_fee = $this->calcGatewayFee($amount); - $fee_object = new stdClass; + // $fee_object = new stdClass; - $fees_and_limits = $this->getFeesAndLimits(); + // $fees_and_limits = $this->getFeesAndLimits(); - if (! $fees_and_limits) { - return $fee_object; - } + // if (! $fees_and_limits) { + // return $fee_object; + // } - $fee_component_amount = $fees_and_limits->fee_amount ?: 0; - $fee_component_percent = $fees_and_limits->fee_percent ? ($amount * $fees_and_limits->fee_percent / 100) : 0; + // $fee_component_amount = $fees_and_limits->fee_amount ?: 0; + // $fee_component_percent = $fees_and_limits->fee_percent ? ($amount * $fees_and_limits->fee_percent / 100) : 0; - $combined_fee_component = $fee_component_amount + $fee_component_percent; + // $combined_fee_component = $fee_component_amount + $fee_component_percent; - $fee_component_tax_name1 = $fees_and_limits->fee_tax_name1 ?: ''; - $fee_component_tax_rate1 = $fees_and_limits->fee_tax_rate1 ? ($combined_fee_component * $fees_and_limits->fee_tax_rate1 / 100) : 0; + // $fee_component_tax_name1 = $fees_and_limits->fee_tax_name1 ?: ''; + // $fee_component_tax_rate1 = $fees_and_limits->fee_tax_rate1 ? ($combined_fee_component * $fees_and_limits->fee_tax_rate1 / 100) : 0; - $fee_component_tax_name2 = $fees_and_limits->fee_tax_name2 ?: ''; - $fee_component_tax_rate2 = $fees_and_limits->fee_tax_rate2 ? ($combined_fee_component * $fees_and_limits->fee_tax_rate2 / 100) : 0; + // $fee_component_tax_name2 = $fees_and_limits->fee_tax_name2 ?: ''; + // $fee_component_tax_rate2 = $fees_and_limits->fee_tax_rate2 ? ($combined_fee_component * $fees_and_limits->fee_tax_rate2 / 100) : 0; - $fee_component_tax_name3 = $fees_and_limits->fee_tax_name3 ?: ''; - $fee_component_tax_rate3 = $fees_and_limits->fee_tax_rate3 ? ($combined_fee_component * $fees_and_limits->fee_tax_rate3 / 100) : 0; - } + // $fee_component_tax_name3 = $fees_and_limits->fee_tax_name3 ?: ''; + // $fee_component_tax_rate3 = $fees_and_limits->fee_tax_rate3 ? ($combined_fee_component * $fees_and_limits->fee_tax_rate3 / 100) : 0; + // } public function resolveRouteBinding($value, $field = NULL) { diff --git a/app/Models/Credit.php b/app/Models/Credit.php index f8f6c659899e..63050b2a7b65 100644 --- a/app/Models/Credit.php +++ b/app/Models/Credit.php @@ -185,7 +185,7 @@ class Credit extends BaseModel /** * Access the invoice calculator object. * - * @return object The invoice calculator object getters + * @return stdClass The invoice calculator object getters */ public function calc() { diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index c100f38c8ef1..1fc5e4d7084d 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -356,7 +356,7 @@ class Invoice extends BaseModel /** * Access the invoice calculator object. * - * @return object The invoice calculator object getters + * @return stdClass The invoice calculator object getters */ public function calc() { diff --git a/app/Models/Quote.php b/app/Models/Quote.php index 3585bc0555d5..94ee3fece16f 100644 --- a/app/Models/Quote.php +++ b/app/Models/Quote.php @@ -159,7 +159,7 @@ class Quote extends BaseModel /** * Access the quote calculator object. * - * @return object The quote calculator object getters + * @return stdClass The quote calculator object getters */ public function calc() { diff --git a/app/PaymentDrivers/BasePaymentDriver.php b/app/PaymentDrivers/BasePaymentDriver.php index 4889d2c44510..2ae2a66e20ce 100644 --- a/app/PaymentDrivers/BasePaymentDriver.php +++ b/app/PaymentDrivers/BasePaymentDriver.php @@ -72,7 +72,7 @@ class BasePaymentDriver /** * Returns the Omnipay driver. - * @return object Omnipay initialized object + * @return stdClass Omnipay initialized object */ protected function gateway() { diff --git a/app/Repositories/PaymentRepository.php b/app/Repositories/PaymentRepository.php index fe7256d98a58..b83851a1ea39 100644 --- a/app/Repositories/PaymentRepository.php +++ b/app/Repositories/PaymentRepository.php @@ -41,6 +41,10 @@ class PaymentRepository extends BaseRepository $this->credit_repo = $credit_repo; } + /** + * @return string + */ + public function getClassName() { return Payment::class; diff --git a/app/Repositories/RecurringInvoiceRepository.php b/app/Repositories/RecurringInvoiceRepository.php index 117c8dc5a1e3..7ef4d778ab36 100644 --- a/app/Repositories/RecurringInvoiceRepository.php +++ b/app/Repositories/RecurringInvoiceRepository.php @@ -31,7 +31,7 @@ class RecurringInvoiceRepository extends BaseRepository $invoice->save(); - $invoice_calc = new InvoiceSum($invoice, $invoice->settings); + $invoice_calc = new InvoiceSum($invoice); $invoice->service() ->applyNumber() diff --git a/app/Repositories/TaskRepository.php b/app/Repositories/TaskRepository.php index e30525374ed8..e73f3109a357 100644 --- a/app/Repositories/TaskRepository.php +++ b/app/Repositories/TaskRepository.php @@ -30,9 +30,9 @@ class TaskRepository extends BaseRepository /** * Gets the class name. * - * @return string The class name. + * @return string The class name. */ - public function getClassName() + public function getClassName() { return Task::class; } @@ -40,8 +40,8 @@ class TaskRepository extends BaseRepository /** * Saves the task and its contacts. * - * @param array $data The data - * @param \App\Models\task $task The task + * @param array $data The data + * @param \App\Models\Task $task The task * * @return task|null task Object */ diff --git a/app/Services/Payment/SendEmail.php b/app/Services/Payment/SendEmail.php index 2c7e897d3a90..dc4b42b7d008 100644 --- a/app/Services/Payment/SendEmail.php +++ b/app/Services/Payment/SendEmail.php @@ -33,7 +33,7 @@ class SendEmail */ public function run() { - $email_builder = (new PaymentEmail())->build($this->payment, $contact); + $email_builder = (new PaymentEmail())->build($this->payment, $this->contact); $this->payment->client->contacts->each(function ($contact) use ($email_builder) { if ($contact->send && $contact->email) { diff --git a/app/Transformers/UserTransformer.php b/app/Transformers/UserTransformer.php index 886840a35eb4..2540693c59af 100644 --- a/app/Transformers/UserTransformer.php +++ b/app/Transformers/UserTransformer.php @@ -54,7 +54,6 @@ class UserTransformer extends EntityTransformer 'created_at' => (int) $user->created_at, 'updated_at' => (int) $user->updated_at, 'archived_at' => (int) $user->deleted_at, - 'created_at' => (int) $user->created_at, 'is_deleted' => (bool) $user->is_deleted, 'phone' => $user->phone ?: '', 'email_verified_at' => $user->getEmailVerifiedAt(), diff --git a/app/Utils/EmailStats.php b/app/Utils/EmailStats.php index 14daf255b7ee..51481387dadc 100644 --- a/app/Utils/EmailStats.php +++ b/app/Utils/EmailStats.php @@ -57,7 +57,7 @@ class EmailStats * Iterates through a list of companies * and flushes the email sent data. * - * @param string $companies The company key + * @param Collection $companies The company key * @return void */ public static function clearCompanies($companies) diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 5e28133a4ad4..8269c8127cd9 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -251,8 +251,8 @@ class HtmlEngine $data['$contact.phone'] = ['value' => $this->contact->phone, 'label' => ctrans('texts.phone')]; $data['$contact.name'] = ['value' => isset($this->contact) ? $this->contact->present()->name() : 'no contact name on record', 'label' => ctrans('texts.contact_name')]; - $data['$contact.first_name'] = ['value' => isset($contact) ? $contact->first_name : '', 'label' => ctrans('texts.first_name')]; - $data['$contact.last_name'] = ['value' => isset($contact) ? $contact->last_name : '', 'label' => ctrans('texts.last_name')]; + $data['$contact.first_name'] = ['value' => isset($this->contact) ? $this->contact->first_name : '', 'label' => ctrans('texts.first_name')]; + $data['$contact.last_name'] = ['value' => isset($this->contact) ? $this->contact->last_name : '', 'label' => ctrans('texts.last_name')]; $data['$contact.custom1'] = ['value' => isset($this->contact) ? $this->contact->custom_value1 : ' ', 'label' => $this->makeCustomField('contact1')]; $data['$contact.custom2'] = ['value' => isset($this->contact) ? $this->contact->custom_value2 : ' ', 'label' => $this->makeCustomField('contact1')]; $data['$contact.custom3'] = ['value' => isset($this->contact) ? $this->contact->custom_value3 : ' ', 'label' => $this->makeCustomField('contact1')]; diff --git a/app/Utils/PhantomJS/Phantom.php b/app/Utils/PhantomJS/Phantom.php index 6a48141a7bee..5dcd14d330c8 100644 --- a/app/Utils/PhantomJS/Phantom.php +++ b/app/Utils/PhantomJS/Phantom.php @@ -35,9 +35,8 @@ class Phantom * Phantom JS API. * * @param $invitation - * @return pdf HTML to PDF conversion */ - public function generate($invitation) + public function generate($invitation) { $entity = false; diff --git a/app/Utils/Traits/ClientGroupSettingsSaver.php b/app/Utils/Traits/ClientGroupSettingsSaver.php index 52878eae3ad7..94b8c239ae0b 100644 --- a/app/Utils/Traits/ClientGroupSettingsSaver.php +++ b/app/Utils/Traits/ClientGroupSettingsSaver.php @@ -139,7 +139,7 @@ trait ClientGroupSettingsSaver * so that it can be saved cleanly * * @param array $settings The settings request() array - * @return object stdClass object + * @return stdClass stdClass object */ private function checkSettingType($settings) : stdClass { @@ -214,8 +214,7 @@ trait ClientGroupSettingsSaver case 'array': return is_array($value); case 'json': - json_decode($string); - + json_decode($value); return json_last_error() == JSON_ERROR_NONE; default: return false; diff --git a/app/Utils/Traits/CompanyGatewayFeesAndLimitsSaver.php b/app/Utils/Traits/CompanyGatewayFeesAndLimitsSaver.php index 989812584993..10f64d37563d 100644 --- a/app/Utils/Traits/CompanyGatewayFeesAndLimitsSaver.php +++ b/app/Utils/Traits/CompanyGatewayFeesAndLimitsSaver.php @@ -71,7 +71,7 @@ trait CompanyGatewayFeesAndLimitsSaver case 'array': return is_array($value); case 'json': - json_decode($string); + json_decode($value); return json_last_error() == JSON_ERROR_NONE; default: diff --git a/app/Utils/Traits/CompanySettingsSaver.php b/app/Utils/Traits/CompanySettingsSaver.php index 85a836162309..9e71d4611f57 100644 --- a/app/Utils/Traits/CompanySettingsSaver.php +++ b/app/Utils/Traits/CompanySettingsSaver.php @@ -131,7 +131,7 @@ trait CompanySettingsSaver * so that it can be saved cleanly * * @param array $settings The settings request() array - * @return object stdClass object + * @return stdClass stdClass object */ private function checkSettingType($settings) : stdClass { @@ -224,7 +224,7 @@ trait CompanySettingsSaver case 'array': return is_array($value); case 'json': - json_decode($string); + json_decode($value); return json_last_error() == JSON_ERROR_NONE; default: diff --git a/app/Utils/Traits/GeneratesCounter.php b/app/Utils/Traits/GeneratesCounter.php index b64b1676afe7..739321840703 100644 --- a/app/Utils/Traits/GeneratesCounter.php +++ b/app/Utils/Traits/GeneratesCounter.php @@ -442,7 +442,7 @@ trait GeneratesCounter * check if we need to reset here. * * @param Client $client client entity - * @return false + * @return void */ private function resetCounters(Client $client) { diff --git a/app/Utils/Traits/Inviteable.php b/app/Utils/Traits/Inviteable.php index 3ff2afda17af..af598a3ce12b 100644 --- a/app/Utils/Traits/Inviteable.php +++ b/app/Utils/Traits/Inviteable.php @@ -44,13 +44,9 @@ trait Inviteable public function getLink() :string { - //$entity_type = strtolower(class_basename($this->entityType())); $entity_type = Str::snake(class_basename($this->entityType())); - //$this->with('company','contact',$this->entity_type); - //$this->with('company'); - $domain = isset($this->company->portal_domain) ?: $this->company->domain(); switch ($this->company->portal_mode) { @@ -65,6 +61,9 @@ trait Inviteable return $domain.'client/'.$entity_type.'/'.$this->key; break; + default: + return ''; + break; } } diff --git a/app/Utils/Traits/MakesDates.php b/app/Utils/Traits/MakesDates.php index 32201adcfeef..739e24f741ab 100644 --- a/app/Utils/Traits/MakesDates.php +++ b/app/Utils/Traits/MakesDates.php @@ -52,15 +52,17 @@ trait MakesDates /** * Formats a date. - * @param Carbon/String $date Carbon object or date string + * @param Carbon|string $date Carbon object or date string * @param string $format The date display format * @return string The formatted date */ public function formatDate($date, string $format) :string { - if (! $date || strlen($date) < 1) { + if(!isset($date)) return ''; - } + // if (!$date || strlen($date) < 1) { + // return ''; + // } if (is_string($date)) { $date = $this->convertToDateObject($date); diff --git a/app/Utils/Traits/MakesHash.php b/app/Utils/Traits/MakesHash.php index ca60da274a13..1571c73c4475 100644 --- a/app/Utils/Traits/MakesHash.php +++ b/app/Utils/Traits/MakesHash.php @@ -67,7 +67,7 @@ trait MakesHash $decoded_array = $hashids->decode($value); if (! is_array($decoded_array)) { - throw new Exception("Invalid Primary Key"); + throw new \Exception("Invalid Primary Key"); //response()->json(['error'=>'Invalid primary key'], 400); } diff --git a/composer.lock b/composer.lock index b13bd824bad7..ed49f75badaf 100644 --- a/composer.lock +++ b/composer.lock @@ -116,16 +116,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.158.14", + "version": "3.158.18", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "8eb1bfc65424c40e4d66d6ec71f5add6d91993b4" + "reference": "75aebc2f5dfd23ad7272ff1d59c521bc2a8e2802" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/8eb1bfc65424c40e4d66d6ec71f5add6d91993b4", - "reference": "8eb1bfc65424c40e4d66d6ec71f5add6d91993b4", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/75aebc2f5dfd23ad7272ff1d59c521bc2a8e2802", + "reference": "75aebc2f5dfd23ad7272ff1d59c521bc2a8e2802", "shasum": "" }, "require": { @@ -200,9 +200,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.158.14" + "source": "https://github.com/aws/aws-sdk-php/tree/3.158.18" }, - "time": "2020-10-26T18:18:44+00:00" + "time": "2020-10-30T18:12:38+00:00" }, { "name": "brick/math", @@ -521,16 +521,16 @@ }, { "name": "composer/composer", - "version": "1.10.16", + "version": "1.10.17", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "217f0272673c72087862c40cf91ac07eb438d778" + "reference": "09d42e18394d8594be24e37923031c4b7442a1cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/217f0272673c72087862c40cf91ac07eb438d778", - "reference": "217f0272673c72087862c40cf91ac07eb438d778", + "url": "https://api.github.com/repos/composer/composer/zipball/09d42e18394d8594be24e37923031c4b7442a1cb", + "reference": "09d42e18394d8594be24e37923031c4b7442a1cb", "shasum": "" }, "require": { @@ -600,7 +600,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/1.10.16" + "source": "https://github.com/composer/composer/tree/1.10.17" }, "funding": [ { @@ -616,7 +616,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T07:55:59+00:00" + "time": "2020-10-30T21:31:58+00:00" }, { "name": "composer/package-versions-deprecated", @@ -1536,16 +1536,16 @@ }, { "name": "egulias/email-validator", - "version": "2.1.22", + "version": "2.1.23", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "68e418ec08fbfc6f58f6fd2eea70ca8efc8cc7d5" + "reference": "5fa792ad1853ae2bc60528dd3e5cbf4542d3c1df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/68e418ec08fbfc6f58f6fd2eea70ca8efc8cc7d5", - "reference": "68e418ec08fbfc6f58f6fd2eea70ca8efc8cc7d5", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/5fa792ad1853ae2bc60528dd3e5cbf4542d3c1df", + "reference": "5fa792ad1853ae2bc60528dd3e5cbf4542d3c1df", "shasum": "" }, "require": { @@ -1592,9 +1592,9 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/2.1.22" + "source": "https://github.com/egulias/EmailValidator/tree/2.1.23" }, - "time": "2020-09-26T15:48:38+00:00" + "time": "2020-10-31T20:37:35+00:00" }, { "name": "fedeisas/laravel-mail-css-inliner", @@ -1824,16 +1824,16 @@ }, { "name": "google/apiclient", - "version": "v2.8.0", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client.git", - "reference": "cf9a070f9da78cd207a69b2a94832d381c8c4163" + "reference": "c8f6d09f50f859fa9457104bb0fb72c893804ede" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/cf9a070f9da78cd207a69b2a94832d381c8c4163", - "reference": "cf9a070f9da78cd207a69b2a94832d381c8c4163", + "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/c8f6d09f50f859fa9457104bb0fb72c893804ede", + "reference": "c8f6d09f50f859fa9457104bb0fb72c893804ede", "shasum": "" }, "require": { @@ -1849,7 +1849,7 @@ "require-dev": { "cache/filesystem-adapter": "^0.3.2", "composer/composer": "^1.10", - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "phpcompatibility/php-compatibility": "^9.2", "phpunit/phpunit": "^4.8.36|^5.0", "squizlabs/php_codesniffer": "~2.3", @@ -1887,9 +1887,9 @@ ], "support": { "issues": "https://github.com/googleapis/google-api-php-client/issues", - "source": "https://github.com/googleapis/google-api-php-client/tree/v2.8.0" + "source": "https://github.com/googleapis/google-api-php-client/tree/v2.8.1" }, - "time": "2020-10-23T20:29:29+00:00" + "time": "2020-10-27T23:20:13+00:00" }, { "name": "google/apiclient-services", @@ -2662,16 +2662,16 @@ }, { "name": "laravel/framework", - "version": "v8.11.2", + "version": "v8.12.3", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "8d1f25fb8d124d5a24df9714ed8d481c43f9efe6" + "reference": "6707480c5f0db7aa07537f9ad93255b64b65b85e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/8d1f25fb8d124d5a24df9714ed8d481c43f9efe6", - "reference": "8d1f25fb8d124d5a24df9714ed8d481c43f9efe6", + "url": "https://api.github.com/repos/laravel/framework/zipball/6707480c5f0db7aa07537f9ad93255b64b65b85e", + "reference": "6707480c5f0db7aa07537f9ad93255b64b65b85e", "shasum": "" }, "require": { @@ -2686,7 +2686,7 @@ "monolog/monolog": "^2.0", "nesbot/carbon": "^2.31", "opis/closure": "^3.6", - "php": "^7.3", + "php": "^7.3|^8.0", "psr/container": "^1.0", "psr/simple-cache": "^1.0", "ramsey/uuid": "^4.0", @@ -2750,7 +2750,7 @@ "guzzlehttp/guzzle": "^6.5.5|^7.0.1", "league/flysystem-cached-adapter": "^1.0", "mockery/mockery": "^1.4.2", - "orchestra/testbench-core": "^6.0", + "orchestra/testbench-core": "^6.5", "pda/pheanstalk": "^4.0", "phpunit/phpunit": "^8.5.8|^9.3.3", "predis/predis": "^1.1.1", @@ -2765,8 +2765,8 @@ "ext-pcntl": "Required to use all features of the queue worker.", "ext-posix": "Required to use all features of the queue worker.", "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).", + "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", "filp/whoops": "Required for friendly error pages in development (^2.8).", - "fzaninotto/faker": "Required to use the eloquent factory builder (^1.9.1).", "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.5.5|^7.0.1).", "laravel/tinker": "Required to use the tinker console command (^2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", @@ -2825,7 +2825,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2020-10-20T20:12:53+00:00" + "time": "2020-10-29T22:01:29+00:00" }, { "name": "laravel/slack-notification-channel", @@ -2959,29 +2959,29 @@ }, { "name": "laravel/tinker", - "version": "v2.4.2", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/laravel/tinker.git", - "reference": "58424c24e8aec31c3a3ac54eb3adb15e8a0a067b" + "reference": "45884b526e10a88a1b179fa1a1a24d5468c668c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/58424c24e8aec31c3a3ac54eb3adb15e8a0a067b", - "reference": "58424c24e8aec31c3a3ac54eb3adb15e8a0a067b", + "url": "https://api.github.com/repos/laravel/tinker/zipball/45884b526e10a88a1b179fa1a1a24d5468c668c2", + "reference": "45884b526e10a88a1b179fa1a1a24d5468c668c2", "shasum": "" }, "require": { "illuminate/console": "^6.0|^7.0|^8.0", "illuminate/contracts": "^6.0|^7.0|^8.0", "illuminate/support": "^6.0|^7.0|^8.0", - "php": "^7.2", - "psy/psysh": "^0.10.3", - "symfony/var-dumper": "^4.3|^5.0" + "php": "^7.2.5|^8.0", + "psy/psysh": "^0.10.4", + "symfony/var-dumper": "^4.3.4|^5.0" }, "require-dev": { - "mockery/mockery": "^1.3.1", - "phpunit/phpunit": "^8.4|^9.0" + "mockery/mockery": "~1.3.3|^1.4.2", + "phpunit/phpunit": "^8.5.8|^9.3.3" }, "suggest": { "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0)." @@ -3021,9 +3021,9 @@ ], "support": { "issues": "https://github.com/laravel/tinker/issues", - "source": "https://github.com/laravel/tinker/tree/2.x" + "source": "https://github.com/laravel/tinker/tree/v2.5.0" }, - "time": "2020-08-11T19:28:08+00:00" + "time": "2020-10-29T13:07:12+00:00" }, { "name": "laravel/ui", @@ -3085,16 +3085,16 @@ }, { "name": "league/commonmark", - "version": "1.5.6", + "version": "1.5.7", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "a56e91e0fa1f6d0049153a9c34f63488f6b7ce61" + "reference": "11df9b36fd4f1d2b727a73bf14931d81373b9a54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/a56e91e0fa1f6d0049153a9c34f63488f6b7ce61", - "reference": "a56e91e0fa1f6d0049153a9c34f63488f6b7ce61", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/11df9b36fd4f1d2b727a73bf14931d81373b9a54", + "reference": "11df9b36fd4f1d2b727a73bf14931d81373b9a54", "shasum": "" }, "require": { @@ -3182,7 +3182,7 @@ "type": "tidelift" } ], - "time": "2020-10-17T21:33:03+00:00" + "time": "2020-10-31T13:49:32+00:00" }, { "name": "league/flysystem", @@ -3646,7 +3646,7 @@ }, { "name": "league/omnipay", - "version": "dev-master", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/thephpleague/omnipay.git", @@ -3667,7 +3667,6 @@ "require-dev": { "omnipay/tests": "^3" }, - "default-branch": true, "type": "metapackage", "extra": { "branch-alias": { @@ -3698,7 +3697,7 @@ ], "support": { "issues": "https://github.com/thephpleague/omnipay/issues", - "source": "https://github.com/thephpleague/omnipay/tree/master" + "source": "https://github.com/thephpleague/omnipay/tree/v3.1.0" }, "time": "2020-09-22T14:02:17+00:00" }, @@ -4352,16 +4351,16 @@ }, { "name": "omnipay/common", - "version": "v3.0.4", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/thephpleague/omnipay-common.git", - "reference": "d6a1bed63cae270da32b2171fe31f820d334d452" + "reference": "0d1f4486c1c873537ac030d37c7ce2986c4de1d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/omnipay-common/zipball/d6a1bed63cae270da32b2171fe31f820d334d452", - "reference": "d6a1bed63cae270da32b2171fe31f820d334d452", + "url": "https://api.github.com/repos/thephpleague/omnipay-common/zipball/0d1f4486c1c873537ac030d37c7ce2986c4de1d2", + "reference": "0d1f4486c1c873537ac030d37c7ce2986c4de1d2", "shasum": "" }, "require": { @@ -4432,9 +4431,9 @@ ], "support": { "issues": "https://github.com/thephpleague/omnipay-common/issues", - "source": "https://github.com/thephpleague/omnipay-common/tree/master" + "source": "https://github.com/thephpleague/omnipay-common/tree/v3.0.5" }, - "time": "2020-06-02T05:57:19+00:00" + "time": "2020-08-20T18:22:12+00:00" }, { "name": "omnipay/paypal", @@ -6867,16 +6866,16 @@ }, { "name": "symfony/console", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ae789a8a2ad189ce7e8216942cdb9b77319f5eb8" + "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ae789a8a2ad189ce7e8216942cdb9b77319f5eb8", - "reference": "ae789a8a2ad189ce7e8216942cdb9b77319f5eb8", + "url": "https://api.github.com/repos/symfony/console/zipball/e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e", + "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e", "shasum": "" }, "require": { @@ -6913,11 +6912,6 @@ "symfony/process": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" @@ -6943,7 +6937,7 @@ "description": "Symfony Console Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v5.1.7" + "source": "https://github.com/symfony/console/tree/v5.1.8" }, "funding": [ { @@ -6959,31 +6953,26 @@ "type": "tidelift" } ], - "time": "2020-10-07T15:23:00+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/css-selector", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "e544e24472d4c97b2d11ade7caacd446727c6bf9" + "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/e544e24472d4c97b2d11ade7caacd446727c6bf9", - "reference": "e544e24472d4c97b2d11ade7caacd446727c6bf9", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", + "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", "shasum": "" }, "require": { "php": ">=7.2.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\CssSelector\\": "" @@ -7013,7 +7002,7 @@ "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.1.4" + "source": "https://github.com/symfony/css-selector/tree/v5.1.8" }, "funding": [ { @@ -7029,7 +7018,7 @@ "type": "tidelift" } ], - "time": "2020-05-20T17:43:50+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/deprecation-contracts", @@ -7100,16 +7089,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "5e4d8ef8d71822922d1eebd130219ae3491a5ca9" + "reference": "a154f2b12fd1ec708559ba73ed58bd1304e55718" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/5e4d8ef8d71822922d1eebd130219ae3491a5ca9", - "reference": "5e4d8ef8d71822922d1eebd130219ae3491a5ca9", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/a154f2b12fd1ec708559ba73ed58bd1304e55718", + "reference": "a154f2b12fd1ec708559ba73ed58bd1304e55718", "shasum": "" }, "require": { @@ -7124,11 +7113,6 @@ "symfony/serializer": "^4.4|^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\ErrorHandler\\": "" @@ -7154,7 +7138,7 @@ "description": "Symfony ErrorHandler Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.1.7" + "source": "https://github.com/symfony/error-handler/tree/v5.1.8" }, "funding": [ { @@ -7170,20 +7154,20 @@ "type": "tidelift" } ], - "time": "2020-10-02T08:49:02+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d5de97d6af175a9e8131c546db054ca32842dd0f" + "reference": "26f4edae48c913fc183a3da0553fe63bdfbd361a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d5de97d6af175a9e8131c546db054ca32842dd0f", - "reference": "d5de97d6af175a9e8131c546db054ca32842dd0f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/26f4edae48c913fc183a3da0553fe63bdfbd361a", + "reference": "26f4edae48c913fc183a3da0553fe63bdfbd361a", "shasum": "" }, "require": { @@ -7214,11 +7198,6 @@ "symfony/http-kernel": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" @@ -7244,7 +7223,7 @@ "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.1.7" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.1.8" }, "funding": [ { @@ -7260,7 +7239,7 @@ "type": "tidelift" } ], - "time": "2020-09-18T14:27:32+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -7343,16 +7322,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "1a8697545a8d87b9f2f6b1d32414199cc5e20aae" + "reference": "df08650ea7aee2d925380069c131a66124d79177" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/1a8697545a8d87b9f2f6b1d32414199cc5e20aae", - "reference": "1a8697545a8d87b9f2f6b1d32414199cc5e20aae", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/df08650ea7aee2d925380069c131a66124d79177", + "reference": "df08650ea7aee2d925380069c131a66124d79177", "shasum": "" }, "require": { @@ -7360,11 +7339,6 @@ "symfony/polyfill-ctype": "~1.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Filesystem\\": "" @@ -7390,7 +7364,7 @@ "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.1.7" + "source": "https://github.com/symfony/filesystem/tree/v5.1.8" }, "funding": [ { @@ -7406,31 +7380,26 @@ "type": "tidelift" } ], - "time": "2020-09-27T14:02:37+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/finder", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "2c3ba7ad6884e6c4451ce2340e2dc23f6fa3e0d8" + "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2c3ba7ad6884e6c4451ce2340e2dc23f6fa3e0d8", - "reference": "2c3ba7ad6884e6c4451ce2340e2dc23f6fa3e0d8", + "url": "https://api.github.com/repos/symfony/finder/zipball/e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", + "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", "shasum": "" }, "require": { "php": ">=7.2.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" @@ -7456,7 +7425,7 @@ "description": "Symfony Finder Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.1.7" + "source": "https://github.com/symfony/finder/tree/v5.1.8" }, "funding": [ { @@ -7472,20 +7441,20 @@ "type": "tidelift" } ], - "time": "2020-09-02T16:23:27+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/http-client", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "df757997ee95101c0ca94c7ea2b76e16a758e0ca" + "reference": "97a6a1f9f5bb3a6094833107b58a72bc9a9165cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/df757997ee95101c0ca94c7ea2b76e16a758e0ca", - "reference": "df757997ee95101c0ca94c7ea2b76e16a758e0ca", + "url": "https://api.github.com/repos/symfony/http-client/zipball/97a6a1f9f5bb3a6094833107b58a72bc9a9165cc", + "reference": "97a6a1f9f5bb3a6094833107b58a72bc9a9165cc", "shasum": "" }, "require": { @@ -7515,11 +7484,6 @@ "symfony/process": "^4.4|^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\HttpClient\\": "" @@ -7545,7 +7509,7 @@ "description": "Symfony HttpClient component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-client/tree/v5.1.7" + "source": "https://github.com/symfony/http-client/tree/v5.1.8" }, "funding": [ { @@ -7561,7 +7525,7 @@ "type": "tidelift" } ], - "time": "2020-10-02T14:24:03+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/http-client-contracts", @@ -7644,16 +7608,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "353b42e7b4fd1c898aab09a059466c9cea74039b" + "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/353b42e7b4fd1c898aab09a059466c9cea74039b", - "reference": "353b42e7b4fd1c898aab09a059466c9cea74039b", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a2860ec970404b0233ab1e59e0568d3277d32b6f", + "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f", "shasum": "" }, "require": { @@ -7672,11 +7636,6 @@ "symfony/mime": "To use the file extension guesser" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\HttpFoundation\\": "" @@ -7702,7 +7661,7 @@ "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.1.7" + "source": "https://github.com/symfony/http-foundation/tree/v5.1.8" }, "funding": [ { @@ -7718,20 +7677,20 @@ "type": "tidelift" } ], - "time": "2020-09-27T14:14:57+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "1764b87d2f10d5c9ce6e4850fe27934116d89708" + "reference": "a13b3c4d994a4fd051f4c6800c5e33c9508091dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/1764b87d2f10d5c9ce6e4850fe27934116d89708", - "reference": "1764b87d2f10d5c9ce6e4850fe27934116d89708", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a13b3c4d994a4fd051f4c6800c5e33c9508091dd", + "reference": "a13b3c4d994a4fd051f4c6800c5e33c9508091dd", "shasum": "" }, "require": { @@ -7789,11 +7748,6 @@ "symfony/dependency-injection": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\HttpKernel\\": "" @@ -7819,7 +7773,7 @@ "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.1.7" + "source": "https://github.com/symfony/http-kernel/tree/v5.1.8" }, "funding": [ { @@ -7835,20 +7789,20 @@ "type": "tidelift" } ], - "time": "2020-10-04T07:57:28+00:00" + "time": "2020-10-28T05:55:23+00:00" }, { "name": "symfony/mime", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "4404d6545125863561721514ad9388db2661eec5" + "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/4404d6545125863561721514ad9388db2661eec5", - "reference": "4404d6545125863561721514ad9388db2661eec5", + "url": "https://api.github.com/repos/symfony/mime/zipball/f5485a92c24d4bcfc2f3fc648744fb398482ff1b", + "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b", "shasum": "" }, "require": { @@ -7865,11 +7819,6 @@ "symfony/dependency-injection": "^4.4|^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Mime\\": "" @@ -7899,7 +7848,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.1.7" + "source": "https://github.com/symfony/mime/tree/v5.1.8" }, "funding": [ { @@ -7915,20 +7864,20 @@ "type": "tidelift" } ], - "time": "2020-09-02T16:23:27+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "4c7e155bf7d93ea4ba3824d5a14476694a5278dd" + "reference": "c6a02905e4ffc7a1498e8ee019db2b477cd1cc02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4c7e155bf7d93ea4ba3824d5a14476694a5278dd", - "reference": "4c7e155bf7d93ea4ba3824d5a14476694a5278dd", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c6a02905e4ffc7a1498e8ee019db2b477cd1cc02", + "reference": "c6a02905e4ffc7a1498e8ee019db2b477cd1cc02", "shasum": "" }, "require": { @@ -7937,11 +7886,6 @@ "symfony/polyfill-php80": "^1.15" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" @@ -7972,7 +7916,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.1.7" + "source": "https://github.com/symfony/options-resolver/tree/v5.1.8" }, "funding": [ { @@ -7988,7 +7932,7 @@ "type": "tidelift" } ], - "time": "2020-09-27T03:44:28+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8800,16 +8744,16 @@ }, { "name": "symfony/process", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "d3a2e64866169586502f0cd9cab69135ad12cee9" + "reference": "f00872c3f6804150d6a0f73b4151daab96248101" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d3a2e64866169586502f0cd9cab69135ad12cee9", - "reference": "d3a2e64866169586502f0cd9cab69135ad12cee9", + "url": "https://api.github.com/repos/symfony/process/zipball/f00872c3f6804150d6a0f73b4151daab96248101", + "reference": "f00872c3f6804150d6a0f73b4151daab96248101", "shasum": "" }, "require": { @@ -8817,11 +8761,6 @@ "symfony/polyfill-php80": "^1.15" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" @@ -8847,7 +8786,7 @@ "description": "Symfony Process Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/5.1" + "source": "https://github.com/symfony/process/tree/v5.1.8" }, "funding": [ { @@ -8863,20 +8802,20 @@ "type": "tidelift" } ], - "time": "2020-09-02T16:23:27+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/routing", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "720348c2ae011f8c56964c0fc3e992840cb60ccf" + "reference": "d6ceee2a37b61b41079005207bf37746d1bfe71f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/720348c2ae011f8c56964c0fc3e992840cb60ccf", - "reference": "720348c2ae011f8c56964c0fc3e992840cb60ccf", + "url": "https://api.github.com/repos/symfony/routing/zipball/d6ceee2a37b61b41079005207bf37746d1bfe71f", + "reference": "d6ceee2a37b61b41079005207bf37746d1bfe71f", "shasum": "" }, "require": { @@ -8906,11 +8845,6 @@ "symfony/yaml": "For using the YAML loader" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Routing\\": "" @@ -8942,7 +8876,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.1.7" + "source": "https://github.com/symfony/routing/tree/v5.1.8" }, "funding": [ { @@ -8958,7 +8892,7 @@ "type": "tidelift" } ], - "time": "2020-10-02T13:05:43+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/service-contracts", @@ -9041,16 +8975,16 @@ }, { "name": "symfony/string", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "4a9afe9d07bac506f75bcee8ed3ce76da5a9343e" + "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/4a9afe9d07bac506f75bcee8ed3ce76da5a9343e", - "reference": "4a9afe9d07bac506f75bcee8ed3ce76da5a9343e", + "url": "https://api.github.com/repos/symfony/string/zipball/a97573e960303db71be0dd8fda9be3bca5e0feea", + "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea", "shasum": "" }, "require": { @@ -9068,11 +9002,6 @@ "symfony/var-exporter": "^4.4|^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\String\\": "" @@ -9109,7 +9038,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.1.7" + "source": "https://github.com/symfony/string/tree/v5.1.8" }, "funding": [ { @@ -9125,20 +9054,20 @@ "type": "tidelift" } ], - "time": "2020-09-15T12:23:47+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/translation", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "e3cdd5119b1b5bf0698c351b8ee20fb5a4ea248b" + "reference": "27980838fd261e04379fa91e94e81e662fe5a1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/e3cdd5119b1b5bf0698c351b8ee20fb5a4ea248b", - "reference": "e3cdd5119b1b5bf0698c351b8ee20fb5a4ea248b", + "url": "https://api.github.com/repos/symfony/translation/zipball/27980838fd261e04379fa91e94e81e662fe5a1b6", + "reference": "27980838fd261e04379fa91e94e81e662fe5a1b6", "shasum": "" }, "require": { @@ -9174,11 +9103,6 @@ "symfony/yaml": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Translation\\": "" @@ -9204,7 +9128,7 @@ "description": "Symfony Translation Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.1.7" + "source": "https://github.com/symfony/translation/tree/v5.1.8" }, "funding": [ { @@ -9220,7 +9144,7 @@ "type": "tidelift" } ], - "time": "2020-09-27T03:44:28+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/translation-contracts", @@ -9302,16 +9226,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c976c115a0d788808f7e71834c8eb0844f678d02" + "reference": "4e13f3fcefb1fcaaa5efb5403581406f4e840b9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c976c115a0d788808f7e71834c8eb0844f678d02", - "reference": "c976c115a0d788808f7e71834c8eb0844f678d02", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/4e13f3fcefb1fcaaa5efb5403581406f4e840b9a", + "reference": "4e13f3fcefb1fcaaa5efb5403581406f4e840b9a", "shasum": "" }, "require": { @@ -9338,11 +9262,6 @@ "Resources/bin/var-dump-server" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "files": [ "Resources/functions/dump.php" @@ -9375,7 +9294,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.1.7" + "source": "https://github.com/symfony/var-dumper/tree/v5.1.8" }, "funding": [ { @@ -9391,7 +9310,7 @@ "type": "tidelift" } ], - "time": "2020-09-18T14:27:32+00:00" + "time": "2020-10-27T10:11:13+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -10534,28 +10453,27 @@ }, { "name": "facade/ignition", - "version": "2.4.1", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "9fc6c3d3de5271a1b94cff19dce2c9295abf0ffa" + "reference": "81698c5e32837c74abf9bb764ff0c1b3e001afb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/9fc6c3d3de5271a1b94cff19dce2c9295abf0ffa", - "reference": "9fc6c3d3de5271a1b94cff19dce2c9295abf0ffa", + "url": "https://api.github.com/repos/facade/ignition/zipball/81698c5e32837c74abf9bb764ff0c1b3e001afb3", + "reference": "81698c5e32837c74abf9bb764ff0c1b3e001afb3", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "facade/flare-client-php": "^1.0", - "facade/ignition-contracts": "^1.0", + "facade/flare-client-php": "^1.3.7", + "facade/ignition-contracts": "^1.0.2", "filp/whoops": "^2.4", "illuminate/support": "^7.0|^8.0", "monolog/monolog": "^2.0", - "php": "^7.2.5", - "scrivo/highlight.php": "^9.15", + "php": "^7.2.5|^8.0", "symfony/console": "^5.0", "symfony/var-dumper": "^5.0" }, @@ -10608,7 +10526,7 @@ "issues": "https://github.com/facade/ignition/issues", "source": "https://github.com/facade/ignition" }, - "time": "2020-10-14T08:59:59+00:00" + "time": "2020-10-27T13:02:22+00:00" }, { "name": "facade/ignition-contracts", @@ -11128,22 +11046,22 @@ }, { "name": "nunomaduro/collision", - "version": "v5.0.2", + "version": "v5.1.0", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "4a343299054e9368d0db4a982a780cc4ffa12707" + "reference": "7c2b95589bf81e274e61e47f7672a1b2c3e06eaa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/4a343299054e9368d0db4a982a780cc4ffa12707", - "reference": "4a343299054e9368d0db4a982a780cc4ffa12707", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/7c2b95589bf81e274e61e47f7672a1b2c3e06eaa", + "reference": "7c2b95589bf81e274e61e47f7672a1b2c3e06eaa", "shasum": "" }, "require": { "facade/ignition-contracts": "^1.0", "filp/whoops": "^2.7.2", - "php": "^7.3", + "php": "^7.3 || ^8.0", "symfony/console": "^5.0" }, "require-dev": { @@ -11212,7 +11130,7 @@ "type": "patreon" } ], - "time": "2020-08-27T18:58:22+00:00" + "time": "2020-10-29T14:50:40+00:00" }, { "name": "openlss/lib-array2xml", @@ -11605,23 +11523,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.1", + "version": "9.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ed363c3ce393560a1c300dce0298bbf0f0528b13" + "reference": "6b20e2055f7c29b56cb3870b3de7cc463d7add41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ed363c3ce393560a1c300dce0298bbf0f0528b13", - "reference": "ed363c3ce393560a1c300dce0298bbf0f0528b13", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6b20e2055f7c29b56cb3870b3de7cc463d7add41", + "reference": "6b20e2055f7c29b56cb3870b3de7cc463d7add41", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.8", + "nikic/php-parser": "^4.10.2", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -11670,7 +11588,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.1" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.3" }, "funding": [ { @@ -11678,7 +11596,7 @@ "type": "github" } ], - "time": "2020-10-26T15:46:21+00:00" + "time": "2020-10-30T10:46:41+00:00" }, { "name": "phpunit/php-file-iterator", @@ -12024,85 +11942,6 @@ ], "time": "2020-10-19T09:23:29+00:00" }, - { - "name": "scrivo/highlight.php", - "version": "v9.18.1.3", - "source": { - "type": "git", - "url": "https://github.com/scrivo/highlight.php.git", - "reference": "6a1699707b099081f20a488ac1f92d682181018c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/6a1699707b099081f20a488ac1f92d682181018c", - "reference": "6a1699707b099081f20a488ac1f92d682181018c", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "php": ">=5.4" - }, - "require-dev": { - "phpunit/phpunit": "^4.8|^5.7", - "sabberworm/php-css-parser": "^8.3", - "symfony/finder": "^2.8|^3.4", - "symfony/var-dumper": "^2.8|^3.4" - }, - "suggest": { - "ext-dom": "Needed to make use of the features in the utilities namespace" - }, - "type": "library", - "autoload": { - "psr-0": { - "Highlight\\": "", - "HighlightUtilities\\": "" - }, - "files": [ - "HighlightUtilities/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Geert Bergman", - "homepage": "http://www.scrivo.org/", - "role": "Project Author" - }, - { - "name": "Vladimir Jimenez", - "homepage": "https://allejo.io", - "role": "Maintainer" - }, - { - "name": "Martin Folkers", - "homepage": "https://twobrain.io", - "role": "Contributor" - } - ], - "description": "Server side syntax highlighter that supports 185 languages. It's a PHP port of highlight.js", - "keywords": [ - "code", - "highlight", - "highlight.js", - "highlight.php", - "syntax" - ], - "support": { - "issues": "https://github.com/scrivo/highlight.php/issues", - "source": "https://github.com/scrivo/highlight.php" - }, - "funding": [ - { - "url": "https://github.com/allejo", - "type": "github" - } - ], - "time": "2020-10-16T07:43:22+00:00" - }, { "name": "sebastian/cli-parser", "version": "1.0.1", @@ -13069,16 +12908,16 @@ }, { "name": "swagger-api/swagger-ui", - "version": "v3.36.0", + "version": "v3.36.1", "source": { "type": "git", "url": "https://github.com/swagger-api/swagger-ui.git", - "reference": "b9915b112821eca7bd99926787fbe38b91204d5d" + "reference": "7a0c1ea556a4b393bace21f80a5c65acaed7a49f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/b9915b112821eca7bd99926787fbe38b91204d5d", - "reference": "b9915b112821eca7bd99926787fbe38b91204d5d", + "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/7a0c1ea556a4b393bace21f80a5c65acaed7a49f", + "reference": "7a0c1ea556a4b393bace21f80a5c65acaed7a49f", "shasum": "" }, "type": "library", @@ -13124,22 +12963,22 @@ ], "support": { "issues": "https://github.com/swagger-api/swagger-ui/issues", - "source": "https://github.com/swagger-api/swagger-ui/tree/v3.36.0" + "source": "https://github.com/swagger-api/swagger-ui/tree/v3.36.1" }, - "time": "2020-10-22T17:41:54+00:00" + "time": "2020-10-29T17:39:16+00:00" }, { "name": "symfony/debug", - "version": "v4.4.15", + "version": "v4.4.16", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "726b85e69342e767d60e3853b98559a68ff74183" + "reference": "c87adf3fc1cd0bf4758316a3a150d50a8f957ef4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/726b85e69342e767d60e3853b98559a68ff74183", - "reference": "726b85e69342e767d60e3853b98559a68ff74183", + "url": "https://api.github.com/repos/symfony/debug/zipball/c87adf3fc1cd0bf4758316a3a150d50a8f957ef4", + "reference": "c87adf3fc1cd0bf4758316a3a150d50a8f957ef4", "shasum": "" }, "require": { @@ -13154,11 +12993,6 @@ "symfony/http-kernel": "^3.4|^4.0|^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Debug\\": "" @@ -13184,7 +13018,7 @@ "description": "Symfony Debug Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/4.4" + "source": "https://github.com/symfony/debug/tree/v4.4.16" }, "funding": [ { @@ -13200,20 +13034,20 @@ "type": "tidelift" } ], - "time": "2020-09-09T05:20:36+00:00" + "time": "2020-10-24T11:50:19+00:00" }, { "name": "symfony/yaml", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a" + "reference": "f284e032c3cefefb9943792132251b79a6127ca6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a", - "reference": "e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a", + "url": "https://api.github.com/repos/symfony/yaml/zipball/f284e032c3cefefb9943792132251b79a6127ca6", + "reference": "f284e032c3cefefb9943792132251b79a6127ca6", "shasum": "" }, "require": { @@ -13234,11 +13068,6 @@ "Resources/bin/yaml-lint" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" @@ -13264,7 +13093,7 @@ "description": "Symfony Yaml Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.1.7" + "source": "https://github.com/symfony/yaml/tree/v5.1.8" }, "funding": [ { @@ -13280,7 +13109,7 @@ "type": "tidelift" } ], - "time": "2020-09-27T03:44:28+00:00" + "time": "2020-10-24T12:03:25+00:00" }, { "name": "theseer/tokenizer", @@ -13334,16 +13163,16 @@ }, { "name": "vimeo/psalm", - "version": "4.0.1", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "b1e2e30026936ef8d5bf6a354d1c3959b6231f44" + "reference": "8929bde5354595dc61947b7e27cfe59db45e3bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/b1e2e30026936ef8d5bf6a354d1c3959b6231f44", - "reference": "b1e2e30026936ef8d5bf6a354d1c3959b6231f44", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/8929bde5354595dc61947b7e27cfe59db45e3bb0", + "reference": "8929bde5354595dc61947b7e27cfe59db45e3bb0", "shasum": "" }, "require": { @@ -13364,10 +13193,9 @@ "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0", "nikic/php-parser": "^4.10.1", "openlss/lib-array2xml": "^1.0", - "php": "^7.3|^8", + "php": "^7.1|^8", "sebastian/diff": "^3.0 || ^4.0", "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", - "webmozart/glob": "^4.1", "webmozart/path-util": "^2.3" }, "provide": { @@ -13378,6 +13206,7 @@ "bamarni/composer-bin-plugin": "^1.2", "brianium/paratest": "^4.0.0", "ext-curl": "*", + "php": "^7.3|^8", "phpdocumentor/reflection-docblock": "^5", "phpmyadmin/sql-parser": "5.1.0", "phpspec/prophecy": ">=1.9.0", @@ -13433,9 +13262,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.0.1" + "source": "https://github.com/vimeo/psalm/tree/4.1.0" }, - "time": "2020-10-20T13:40:17+00:00" + "time": "2020-10-29T23:55:10+00:00" }, { "name": "webmozart/assert", @@ -13490,57 +13319,6 @@ }, "time": "2020-07-08T17:02:28+00:00" }, - { - "name": "webmozart/glob", - "version": "4.1.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/glob.git", - "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", - "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", - "shasum": "" - }, - "require": { - "php": "^5.3.3|^7.0", - "webmozart/path-util": "^2.2" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1", - "symfony/filesystem": "^2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.1-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Glob\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A PHP implementation of Ant's glob.", - "support": { - "issues": "https://github.com/webmozart/glob/issues", - "source": "https://github.com/webmozart/glob/tree/master" - }, - "time": "2015-12-29T11:14:33+00:00" - }, { "name": "webmozart/path-util", "version": "2.3.0", diff --git a/psalm.xml b/psalm.xml index 9a8344592310..73bb3b38d930 100644 --- a/psalm.xml +++ b/psalm.xml @@ -51,7 +51,18 @@ + + + + + + + + + + + diff --git a/routes/api.php b/routes/api.php index 1834a754da2a..f30d1641e138 100644 --- a/routes/api.php +++ b/routes/api.php @@ -16,10 +16,9 @@ Route::group(['middleware' => ['api_secret_check']], function () { Route::post('api/v1/oauth_login', 'Auth\LoginController@oauthApiLogin'); }); -Route::group(['api_secret_check', 'email_db'], function () { +Route::group(['middleware' => ['api_secret_check', 'email_db']], function () { Route::post('api/v1/login', 'Auth\LoginController@apiLogin')->name('login.submit'); Route::post('api/v1/reset_password', 'Auth\ForgotPasswordController@sendResetLinkEmail'); - }); Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'api/v1', 'as' => 'api.'], function () { diff --git a/tests/Feature/LoginTest.php b/tests/Feature/LoginTest.php index 0bd80007d02b..dc45714d001d 100644 --- a/tests/Feature/LoginTest.php +++ b/tests/Feature/LoginTest.php @@ -24,6 +24,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Session; use Tests\TestCase; +use Illuminate\Validation\ValidationException; /** * @test @@ -141,6 +142,10 @@ class LoginTest extends TestCase public function testApiLogin() { + Account::all()->each(function ($account){ + $account->delete(); + }); + $account = Account::factory()->create(); $user = User::factory()->create([ 'account_id' => $account->id, @@ -177,15 +182,28 @@ class LoginTest extends TestCase $this->assertTrue($user->company_users->first() !== null); $this->assertTrue($user->company_user->account !== null); + $this->assertEquals($user->email, 'test@example.com'); + $this->assertTrue(\Hash::check('123456', $user->password)); + $data = [ 'email' => 'test@example.com', 'password' => '123456', ]; + try{ $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-SECRET' => config('ninja.api_secret'), ])->post('/api/v1/login', $data); + } catch (ValidationException $e) { + $message = json_decode($e->validator->getMessageBag(), 1); + info(print_r($message,1)); + } + + $arr = $response->json(); + + info(print_r($arr,1)); + $response->assertStatus(200); } } From 0077df1be7ee81ceaa72356bc905204b9adae647 Mon Sep 17 00:00:00 2001 From: = Date: Sun, 1 Nov 2020 16:16:37 +1100 Subject: [PATCH 6/8] Handler.php --- app/Exceptions/Handler.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index acfa95956d7f..782677e0e020 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -12,6 +12,7 @@ namespace App\Exceptions; use App\Exceptions\GenericPaymentDriverFailure; +use App\Models\Account; use Exception; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Auth\AuthenticationException; @@ -27,14 +28,14 @@ use Illuminate\Support\Arr; use Illuminate\Support\Facades\Schema; use Illuminate\Validation\ValidationException; use PDOException; +use Sentry\State\Scope; use Swift_TransportException; use Symfony\Component\Console\Exception\CommandNotFoundException; -use function Sentry\configureScope; -use Sentry\State\Scope; use Symfony\Component\Debug\Exception\FatalThrowableError; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Throwable; +use function Sentry\configureScope; class Handler extends ExceptionHandler { @@ -71,9 +72,12 @@ class Handler extends ExceptionHandler { if (! Schema::hasTable('accounts')) { info('account table not found'); - return; } + // if(Account::count() == 0){ + // info("handler - account table not found"); + // return; + // } if (app()->bound('sentry') && $this->shouldReport($exception)) { app('sentry')->configureScope(function (Scope $scope): void { From 685b7e25c23dc2ccf23edf11bbba753d4973e411 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 1 Nov 2020 16:18:40 +1100 Subject: [PATCH 7/8] Fixes for queries --- app/Jobs/Cron/RecurringInvoicesCron.php | 7 +++++++ app/Models/Company.php | 1 + app/Transformers/CompanyTransformer.php | 1 + 3 files changed, 9 insertions(+) diff --git a/app/Jobs/Cron/RecurringInvoicesCron.php b/app/Jobs/Cron/RecurringInvoicesCron.php index 29554493b959..198fe0dff3ce 100644 --- a/app/Jobs/Cron/RecurringInvoicesCron.php +++ b/app/Jobs/Cron/RecurringInvoicesCron.php @@ -14,6 +14,7 @@ namespace App\Jobs\Cron; use App\Jobs\RecurringInvoice\SendRecurring; use App\Libraries\MultiDB; use App\Models\RecurringInvoice; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Http\Request; use Illuminate\Support\Carbon; @@ -46,6 +47,9 @@ class RecurringInvoicesCron $recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now()) ->where('status_id', RecurringInvoice::STATUS_ACTIVE) + ->whereHas('company', function(Builder $query){ + $query->where('is_disabled', false); + }) ->cursor(); Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count()); @@ -66,6 +70,9 @@ class RecurringInvoicesCron $recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now()) ->where('status_id', RecurringInvoice::STATUS_ACTIVE) + ->whereHas('company', function(Builder $query){ + $query->where('is_disabled', false); + }) ->cursor(); Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count().' On Database # '.$db); diff --git a/app/Models/Company.php b/app/Models/Company.php index f34fd1f6ae9b..df64f0716182 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -107,6 +107,7 @@ class Company extends BaseModel 'enable_shop_api', 'invoice_task_timelog', 'auto_start_tasks', + 'is_disabled', ]; protected $hidden = [ diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index 20c35e05621b..add89be0f830 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -148,6 +148,7 @@ class CompanyTransformer extends EntityTransformer 'enabled_item_tax_rates' => (int) $company->enabled_item_tax_rates, 'client_can_register' => (bool) $company->client_can_register, 'is_large' => (bool) $company->is_large, + 'is_disabled' => (bool) $company->is_disabled, 'enable_shop_api' => (bool) $company->enable_shop_api, 'mark_expenses_invoiceable'=> (bool) $company->mark_expenses_invoiceable, 'mark_expenses_paid' => (bool) $company->mark_expenses_paid, From ae44b9c0320235e52d6734b2fab7140c5a79c73e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 1 Nov 2020 18:53:43 +1100 Subject: [PATCH 8/8] Version bump + linking tasks expenses with invoices --- VERSION.txt | 2 +- app/Http/Requests/Task/StoreTaskRequest.php | 4 +- app/Http/Requests/Task/UpdateTaskRequest.php | 5 +- app/Models/Invoice.php | 9 +++ app/Repositories/BaseRepository.php | 1 + app/Services/Invoice/InvoiceService.php | 29 +++++++ app/Services/Invoice/MarkInvoiceDeleted.php | 4 + .../Traits/Notifications/UserNotifies.php | 4 +- config/ninja.php | 2 +- database/factories/ExpenseFactory.php | 1 + database/factories/TaskFactory.php | 1 + tests/Feature/InvoiceLinkTasksTest.php | 77 +++++++++++++++++++ tests/MockAccountData.php | 2 + 13 files changed, 132 insertions(+), 9 deletions(-) create mode 100644 tests/Feature/InvoiceLinkTasksTest.php diff --git a/VERSION.txt b/VERSION.txt index dbf3366489b1..c9c84322d739 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.0.22 +5.0.23 diff --git a/app/Http/Requests/Task/StoreTaskRequest.php b/app/Http/Requests/Task/StoreTaskRequest.php index 78cf87402e94..6bd1bce41387 100644 --- a/app/Http/Requests/Task/StoreTaskRequest.php +++ b/app/Http/Requests/Task/StoreTaskRequest.php @@ -38,8 +38,8 @@ class StoreTaskRequest extends Request { $rules = []; - $rules['number'] = Rule::unique('tasks') - ->where('company_id', auth()->user()->company()->id); + if(isset($this->number)) + $rules['number'] = Rule::unique('tasks')->where('company_id', auth()->user()->company()->id); return $this->globalRules($rules); } diff --git a/app/Http/Requests/Task/UpdateTaskRequest.php b/app/Http/Requests/Task/UpdateTaskRequest.php index 57fcda98bb9c..16a1e3882e1f 100644 --- a/app/Http/Requests/Task/UpdateTaskRequest.php +++ b/app/Http/Requests/Task/UpdateTaskRequest.php @@ -38,9 +38,8 @@ class UpdateTaskRequest extends Request { $rules = []; - $rules['number'] = Rule::unique('tasks') - ->where('company_id', auth()->user()->company()->id) - ->ignore($this->task->id); + if(isset($this->number)) + $rules['number'] = Rule::unique('tasks')->where('company_id', auth()->user()->company()->id)->ignore($this->task->id); return $this->globalRules($rules); } diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 1fc5e4d7084d..d850444409f3 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -209,6 +209,15 @@ class Invoice extends BaseModel return $this->hasMany(Credit::class); } + public function tasks() + { + return $this->hasMany(Task::class); + } + + public function expenses() + { + return $this->hasMany(Expense::class); + } /** * Service entry points. */ diff --git a/app/Repositories/BaseRepository.php b/app/Repositories/BaseRepository.php index 510decebc161..8a586923e4b8 100644 --- a/app/Repositories/BaseRepository.php +++ b/app/Repositories/BaseRepository.php @@ -314,6 +314,7 @@ class BaseRepository if (($state['finished_amount'] != $state['starting_amount']) && ($model->status_id != Invoice::STATUS_DRAFT)) { $model->ledger()->updateInvoiceBalance(($state['finished_amount'] - $state['starting_amount'])); $model->client->service()->updateBalance(($state['finished_amount'] - $state['starting_amount']))->save(); + $model->service()->linkEntities()->save(); } if (! $model->design_id) { diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index da1393e21409..0a17c929ea44 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -14,8 +14,10 @@ namespace App\Services\Invoice; use App\Jobs\Entity\CreateEntityPdf; use App\Jobs\Util\UnlinkFile; use App\Models\CompanyGateway; +use App\Models\Expense; use App\Models\Invoice; use App\Models\Payment; +use App\Models\Task; use App\Services\Client\ClientService; use App\Services\Invoice\ApplyNumber; use App\Services\Invoice\ApplyPayment; @@ -30,10 +32,13 @@ use App\Services\Invoice\MarkInvoicePaid; use App\Services\Invoice\MarkSent; use App\Services\Invoice\TriggeredActions; use App\Services\Invoice\UpdateBalance; +use App\Utils\Traits\MakesHash; use Illuminate\Support\Carbon; class InvoiceService { + use MakesHash; + private $invoice; protected $client_service; @@ -328,6 +333,30 @@ class InvoiceService return $this; } + public function linkEntities() + { + //set all task.invoice_ids = 0 + $this->invoice->tasks()->update(['invoice_id' => null]); + + //set all tasks.invoice_ids = x with the current line_items + $tasks = collect($this->invoice->line_items)->map(function ($item){ + + if(isset($item->task_id)) + $item->task_id = $this->decodePrimaryKey($item->task_id); + + if(isset($item->expense_id)) + $item->expense_id = $this->decodePrimaryKey($item->expense_id); + + return $item; + + }); + + Task::whereIn('id',$tasks->pluck('task_id'))->update(['invoice_id' => $this->invoice->id]); + Expense::whereIn('id',$tasks->pluck('expense_id'))->update(['invoice_id' => $this->invoice->id]); + + return $this; + } + /** * Saves the invoice. * @return Invoice object diff --git a/app/Services/Invoice/MarkInvoiceDeleted.php b/app/Services/Invoice/MarkInvoiceDeleted.php index 2d98ed2ed4fb..7d245d64b487 100644 --- a/app/Services/Invoice/MarkInvoiceDeleted.php +++ b/app/Services/Invoice/MarkInvoiceDeleted.php @@ -53,6 +53,10 @@ class MarkInvoiceDeleted extends AbstractService $this->invoice->number = $number; + //wipe references to invoices from related entities. + $this->invoice->tasks()->update(['invoice_id' => null]); + $this->invoice->expenses()->update(['invoice_id' => null]); + return $this->invoice; } diff --git a/app/Utils/Traits/Notifications/UserNotifies.php b/app/Utils/Traits/Notifications/UserNotifies.php index 7ff3b0a1cf60..7a9f7c22b38c 100644 --- a/app/Utils/Traits/Notifications/UserNotifies.php +++ b/app/Utils/Traits/Notifications/UserNotifies.php @@ -41,7 +41,7 @@ trait UserNotifies public function findUserEntityNotificationType($entity, $company_user, $required_permissions) :array { - if ($this->migrationRunning($company_user)) { + if ($company_user->company->is_disabled) { return []; } @@ -65,7 +65,7 @@ trait UserNotifies public function findCompanyUserNotificationType($company_user, $required_permissions) :array { - if ($this->migrationRunning($company_user)) { + if ($company_user->company->is_disabled) { return []; } diff --git a/config/ninja.php b/config/ninja.php index 2ea9e28e7557..a304af58b545 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -12,7 +12,7 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/').'/', 'app_domain' => env('APP_DOMAIN', ''), - 'app_version' => '5.0.22', + 'app_version' => '5.0.23', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/database/factories/ExpenseFactory.php b/database/factories/ExpenseFactory.php index ea5716ca6402..685bead9803e 100644 --- a/database/factories/ExpenseFactory.php +++ b/database/factories/ExpenseFactory.php @@ -42,6 +42,7 @@ class ExpenseFactory extends Factory 'public_notes' => $this->faker->text(50), 'private_notes' => $this->faker->text(50), 'transaction_reference' => $this->faker->text(5), + 'invoice_id' => null, ]; } } diff --git a/database/factories/TaskFactory.php b/database/factories/TaskFactory.php index 759114c9d8f2..b18016f3e14a 100644 --- a/database/factories/TaskFactory.php +++ b/database/factories/TaskFactory.php @@ -33,6 +33,7 @@ class TaskFactory extends Factory { return [ 'description' => $this->faker->text(50), + 'invoice_id' => null, ]; } } \ No newline at end of file diff --git a/tests/Feature/InvoiceLinkTasksTest.php b/tests/Feature/InvoiceLinkTasksTest.php new file mode 100644 index 000000000000..3a2c7b1eed84 --- /dev/null +++ b/tests/Feature/InvoiceLinkTasksTest.php @@ -0,0 +1,77 @@ +faker = \Faker\Factory::create(); + + Model::reguard(); + + $this->makeTestData(); + } + + public function testMapCreation() + { + $temp_invoice_id = $this->invoice->id; + + $tasks = collect($this->invoice->line_items)->map(function ($item){ + + if(isset($item->task_id)) + $item->task_id = $this->decodePrimaryKey($item->task_id); + + if(isset($item->expense_id)) + $item->expense_id = $this->decodePrimaryKey($item->expense_id); + + return $item; + + }); + + $this->assertEquals($tasks->first()->task_id, $this->task->id); + $this->assertEquals($tasks->first()->expense_id, $this->expense->id); + + $this->invoice = $this->invoice->service()->linkEntities()->save(); + + $this->assertEquals($this->task->fresh()->invoice_id, $temp_invoice_id); + $this->assertEquals($this->expense->fresh()->invoice_id, $temp_invoice_id); + } +} diff --git a/tests/MockAccountData.php b/tests/MockAccountData.php index df2a56a3cf3d..6d6461e1e7d3 100644 --- a/tests/MockAccountData.php +++ b/tests/MockAccountData.php @@ -570,6 +570,8 @@ trait MockAccountData $item = InvoiceItemFactory::create(); $item->quantity = 1; $item->cost = 10; + $item->task_id = $this->encodePrimaryKey($this->task->id); + $item->expense_id = $this->encodePrimaryKey($this->expense->id); $line_items[] = $item;