From 0617480f7385fdaf56143b1c2e7c761e89529e9d Mon Sep 17 00:00:00 2001 From: Nathan Butler Date: Thu, 30 Jun 2022 09:23:52 +1000 Subject: [PATCH 0001/1270] Asset checkinbytag now consistent with existingAPI This is a non-breaking change to the checkinbytag endpoint to bring it inline with the usage/formatting of the other bytag endpoints that currently exist - using the URL path to define the asset_tag instead of passing it through as a url query. Both methods will work, but the URL Path method will take precidence if it is used (the query will be ignored if included) --- app/Http/Controllers/Api/AssetsController.php | 11 ++++++---- routes/api.php | 21 ++++++++++++------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index ebb19159dd..fbc56d21ec 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -907,18 +907,21 @@ class AssetsController extends Controller * @since [v6.0] * @return JsonResponse */ - public function checkinByTag(Request $request) + public function checkinByTag(Request $request, $tag = null) { $this->authorize('checkin', Asset::class); - $asset = Asset::where('asset_tag', $request->input('asset_tag'))->first(); + if(null == $tag && null !== ($request->input('asset_tag'))) { + $tag = $request->input('asset_tag'); + } + $asset = Asset::where('asset_tag', $tag)->first(); if($asset) { return $this->checkin($request, $asset->id); } return response()->json(Helper::formatStandardApiResponse('error', [ - 'asset'=> e($request->input('asset_tag')) - ], 'Asset with tag '.e($request->input('asset_tag')).' not found')); + 'asset'=> e($tag) + ], 'Asset with tag '.e($tag).' not found')); } diff --git a/routes/api.php b/routes/api.php index da2e92ee10..af5b797eb0 100644 --- a/routes/api.php +++ b/routes/api.php @@ -469,6 +469,20 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi ] )->name('api.assets.checkout.bytag'); + Route::post('bytag/{any}/checkin', + [ + Api\AssetsController::class, + 'checkinbytag' + ] + )->name('api.asset.checkinbytagPath'); + + Route::post('checkinbytag', + [ + Api\AssetsController::class, + 'checkinbytag' + ] + )->name('api.asset.checkinbytag'); + Route::get('byserial/{any}', [ Api\AssetsController::class, @@ -498,13 +512,6 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi ] )->name('api.asset.checkin'); - Route::post('checkinbytag', - [ - Api\AssetsController::class, - 'checkinbytag' - ] - )->name('api.asset.checkinbytag'); - Route::post('{id}/checkout', [ Api\AssetsController::class, From e457b2e98d9b34d335c6d79d0c606c8a8f50d9b5 Mon Sep 17 00:00:00 2001 From: Phan Nguyen Date: Mon, 17 Oct 2022 13:10:09 +0700 Subject: [PATCH 0002/1270] Correct assignedusers relation setting --- app/Models/License.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/License.php b/app/Models/License.php index d0e6f5c969..d74d69546a 100755 --- a/app/Models/License.php +++ b/app/Models/License.php @@ -357,7 +357,7 @@ class License extends Depreciable */ public function assignedusers() { - return $this->belongsToMany(\App\Models\User::class, 'license_seats', 'assigned_to', 'license_id'); + return $this->belongsToMany(\App\Models\User::class, 'license_seats', 'license_id', 'assigned_to'); } /** From 45636b81148c5bf1d3d62991ea6747d4ab6145e7 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 15 Nov 2022 15:42:57 -0800 Subject: [PATCH 0003/1270] adds should_autoassign boolean to users table --- .../Commands/CheckoutLicenseToAllUsers.php | 2 +- .../Controllers/Users/UsersController.php | 2 ++ ..._should_autoassign_bool_to_users_table.php | 32 +++++++++++++++++++ resources/lang/en/admin/users/general.php | 2 ++ resources/views/users/edit.blade.php | 13 ++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php diff --git a/app/Console/Commands/CheckoutLicenseToAllUsers.php b/app/Console/Commands/CheckoutLicenseToAllUsers.php index fab2b318c6..e29b8991b6 100644 --- a/app/Console/Commands/CheckoutLicenseToAllUsers.php +++ b/app/Console/Commands/CheckoutLicenseToAllUsers.php @@ -56,7 +56,7 @@ class CheckoutLicenseToAllUsers extends Command return false; } - $users = User::whereNull('deleted_at')->with('licenses')->get(); + $users = User::whereNull('deleted_at')->where('should_autoassign', '==', 1)->with('licenses')->get(); if ($users->count() > $license->getAvailSeatsCountAttribute()) { $this->info('You do not have enough free seats to complete this task, so we will check out as many as we can. '); diff --git a/app/Http/Controllers/Users/UsersController.php b/app/Http/Controllers/Users/UsersController.php index 52d423036f..b863fb966b 100755 --- a/app/Http/Controllers/Users/UsersController.php +++ b/app/Http/Controllers/Users/UsersController.php @@ -121,6 +121,7 @@ class UsersController extends Controller $user->created_by = Auth::user()->id; $user->start_date = $request->input('start_date', null); $user->end_date = $request->input('end_date', null); + $user->should_autoassign= $request->input('should_autoassign', 0); // Strip out the superuser permission if the user isn't a superadmin $permissions_array = $request->input('permission'); @@ -274,6 +275,7 @@ class UsersController extends Controller $user->website = $request->input('website', null); $user->start_date = $request->input('start_date', null); $user->end_date = $request->input('end_date', null); + $user->should_autoassign = $request->input('should_autoassign', 0); // Update the location of any assets checked out to this user Asset::where('assigned_type', User::class) diff --git a/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php b/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php new file mode 100644 index 0000000000..6f6f308e44 --- /dev/null +++ b/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php @@ -0,0 +1,32 @@ +boolean('should_autoassign')->nullable(false)->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('should_autoassign'); + }); + } +} diff --git a/resources/lang/en/admin/users/general.php b/resources/lang/en/admin/users/general.php index daa568e8bf..2ae8709251 100644 --- a/resources/lang/en/admin/users/general.php +++ b/resources/lang/en/admin/users/general.php @@ -19,6 +19,8 @@ return [ 'print_assigned' => 'Print All Assigned', 'email_assigned' => 'Email List of All Assigned', 'user_notified' => 'User has been emailed a list of their currently assigned items.', + 'auto_assign_label' => 'User should skipped during auto assignment commands', + 'auto_assign_help' => 'Skip this user in auto assignment of licenses', 'software_user' => 'Software Checked out to :name', 'send_email_help' => 'You must provide an email address for this user to send them credentials. Emailing credentials can only be done on user creation. Passwords are stored in a one-way hash and cannot be retrieved once saved.', 'view_user' => 'View User :name', diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index 7947d65a68..a689ab8983 100755 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -376,6 +376,19 @@ + +
+
+ +

{{ trans('admin/users/general.auto_assign_help') }} +

+
+
+ @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id']) From 90828e3a873f548d7bbb16f065c484204303178c Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 15 Nov 2022 15:51:52 -0800 Subject: [PATCH 0004/1270] fixes variable name --- app/Console/Commands/CheckoutLicenseToAllUsers.php | 4 ++-- resources/lang/en/admin/users/general.php | 2 +- resources/views/users/edit.blade.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/CheckoutLicenseToAllUsers.php b/app/Console/Commands/CheckoutLicenseToAllUsers.php index e29b8991b6..003c32c738 100644 --- a/app/Console/Commands/CheckoutLicenseToAllUsers.php +++ b/app/Console/Commands/CheckoutLicenseToAllUsers.php @@ -56,8 +56,8 @@ class CheckoutLicenseToAllUsers extends Command return false; } - $users = User::whereNull('deleted_at')->where('should_autoassign', '==', 1)->with('licenses')->get(); - + $users = User::whereNull('deleted_at')->where('should_autoassign', '==', 0)->with('licenses')->get(); + dd($users); if ($users->count() > $license->getAvailSeatsCountAttribute()) { $this->info('You do not have enough free seats to complete this task, so we will check out as many as we can. '); } diff --git a/resources/lang/en/admin/users/general.php b/resources/lang/en/admin/users/general.php index 2ae8709251..71f56c7a15 100644 --- a/resources/lang/en/admin/users/general.php +++ b/resources/lang/en/admin/users/general.php @@ -19,7 +19,7 @@ return [ 'print_assigned' => 'Print All Assigned', 'email_assigned' => 'Email List of All Assigned', 'user_notified' => 'User has been emailed a list of their currently assigned items.', - 'auto_assign_label' => 'User should skipped during auto assignment commands', + 'auto_assign_label' => 'User should be skipped during auto assignment commands', 'auto_assign_help' => 'Skip this user in auto assignment of licenses', 'software_user' => 'Software Checked out to :name', 'send_email_help' => 'You must provide an email address for this user to send them credentials. Emailing credentials can only be done on user creation. Passwords are stored in a one-way hash and cannot be retrieved once saved.', diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index a689ab8983..f0bbc989f6 100755 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -380,7 +380,7 @@
From 8a0517fb5d83ef055b1a90bdb07903265d8a4011 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 15 Nov 2022 15:59:47 -0800 Subject: [PATCH 0005/1270] removes data dump --- app/Console/Commands/CheckoutLicenseToAllUsers.php | 2 +- resources/views/users/edit.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/CheckoutLicenseToAllUsers.php b/app/Console/Commands/CheckoutLicenseToAllUsers.php index 003c32c738..44ec72e13c 100644 --- a/app/Console/Commands/CheckoutLicenseToAllUsers.php +++ b/app/Console/Commands/CheckoutLicenseToAllUsers.php @@ -57,7 +57,7 @@ class CheckoutLicenseToAllUsers extends Command } $users = User::whereNull('deleted_at')->where('should_autoassign', '==', 0)->with('licenses')->get(); - dd($users); + if ($users->count() > $license->getAvailSeatsCountAttribute()) { $this->info('You do not have enough free seats to complete this task, so we will check out as many as we can. '); } diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index f0bbc989f6..7126428607 100755 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -380,7 +380,7 @@
From 2aa50859b325ea0d31a0ab1e64da1acd34b1c937 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:01:03 -0800 Subject: [PATCH 0006/1270] Bump Dusk version to fix broken macOS chrome driver link --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 07dbf20639..06d8563039 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,7 @@ }, "require-dev": { "fakerphp/faker": "^1.16", - "laravel/dusk": "^6.19", + "laravel/dusk": "^6.25", "mockery/mockery": "^1.4", "phpunit/php-token-stream": "^3.1", "phpunit/phpunit": "^9.0", diff --git a/composer.lock b/composer.lock index bf8cb1f758..7c8b7030ba 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0c1f3848f8c9ede2b5f1513e4feaa7d7", + "content-hash": "4fed0ab76a34ef85a44568e470abab48", "packages": [ { "name": "alek13/slack", @@ -11847,16 +11847,16 @@ }, { "name": "laravel/dusk", - "version": "v6.25.0", + "version": "v6.25.2", "source": { "type": "git", "url": "https://github.com/laravel/dusk.git", - "reference": "b4632b7493a187d31afc5c9ddec437c81b16421a" + "reference": "25a595ac3dc82089a91af10dd23b0d58fd3f6d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/dusk/zipball/b4632b7493a187d31afc5c9ddec437c81b16421a", - "reference": "b4632b7493a187d31afc5c9ddec437c81b16421a", + "url": "https://api.github.com/repos/laravel/dusk/zipball/25a595ac3dc82089a91af10dd23b0d58fd3f6d0b", + "reference": "25a595ac3dc82089a91af10dd23b0d58fd3f6d0b", "shasum": "" }, "require": { @@ -11914,9 +11914,9 @@ ], "support": { "issues": "https://github.com/laravel/dusk/issues", - "source": "https://github.com/laravel/dusk/tree/v6.25.0" + "source": "https://github.com/laravel/dusk/tree/v6.25.2" }, - "time": "2022-07-11T11:38:43+00:00" + "time": "2022-09-29T09:37:07+00:00" }, { "name": "mockery/mockery", From 581655f7562199c61267e15e8ba05f1b3fd32b52 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:02:11 -0800 Subject: [PATCH 0007/1270] Run database migrations for all Dusk tests --- tests/DuskTestCase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/DuskTestCase.php b/tests/DuskTestCase.php index ac750d9efc..e591a7c771 100644 --- a/tests/DuskTestCase.php +++ b/tests/DuskTestCase.php @@ -5,11 +5,13 @@ namespace Tests; use Facebook\WebDriver\Chrome\ChromeOptions; use Facebook\WebDriver\Remote\DesiredCapabilities; use Facebook\WebDriver\Remote\RemoteWebDriver; +use Illuminate\Foundation\Testing\DatabaseMigrations; use Laravel\Dusk\TestCase as BaseTestCase; abstract class DuskTestCase extends BaseTestCase { use CreatesApplication; + use DatabaseMigrations; /** * Prepare for Dusk test execution. From bc0f666906d81eaedc0d9273ed54fb1cc8a6e496 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:03:09 -0800 Subject: [PATCH 0008/1270] Create Setting in test to avoid being redirected to the setup screen --- tests/Browser/LoginTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Browser/LoginTest.php b/tests/Browser/LoginTest.php index 5ed055cda9..18f5172f15 100644 --- a/tests/Browser/LoginTest.php +++ b/tests/Browser/LoginTest.php @@ -2,8 +2,8 @@ namespace Tests\Browser; +use App\Models\Setting; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; use Laravel\Dusk\Browser; use Tests\DuskTestCase; @@ -26,6 +26,9 @@ class LoginTest extends DuskTestCase $user->permissions = '{"superuser": 1}'; $user->save(); + + Setting::factory()->create(); + $this->browse(function (Browser $browser) { $browser->visitRoute('login') ->assertSee(trans('auth/general.login_prompt')); @@ -37,10 +40,7 @@ class LoginTest extends DuskTestCase ->type('password', 'password') ->press(trans('auth/general.login')) ->assertPathIs('/'); - $browser->screenshot('dashboard'); + $browser->screenshot('dashboard'); }); - - // Delete the user afterwards - $user->delete(); } } From b8b2543b0dca61c29e90eac45a44d6852b6d4491 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:04:21 -0800 Subject: [PATCH 0009/1270] Reference the correct table in migration down method --- .../migrations/2017_03_10_210807_add_fields_to_manufacturer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2017_03_10_210807_add_fields_to_manufacturer.php b/database/migrations/2017_03_10_210807_add_fields_to_manufacturer.php index 0d05a680c1..05af7c8316 100644 --- a/database/migrations/2017_03_10_210807_add_fields_to_manufacturer.php +++ b/database/migrations/2017_03_10_210807_add_fields_to_manufacturer.php @@ -28,7 +28,7 @@ class AddFieldsToManufacturer extends Migration */ public function down() { - Schema::table('settings', function ($table) { + Schema::table('manufacturers', function ($table) { $table->dropColumn('url'); $table->dropColumn('support_url'); $table->dropColumn('support_phone'); From e5cb68cc5ebc73fda5266b783440117550f72f6c Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:06:16 -0800 Subject: [PATCH 0010/1270] Move drop column command to correct migration --- .../2016_08_23_145619_add_show_in_nav_to_status_labels.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2016_08_23_145619_add_show_in_nav_to_status_labels.php b/database/migrations/2016_08_23_145619_add_show_in_nav_to_status_labels.php index c4e1a18177..5ea26bf4c1 100644 --- a/database/migrations/2016_08_23_145619_add_show_in_nav_to_status_labels.php +++ b/database/migrations/2016_08_23_145619_add_show_in_nav_to_status_labels.php @@ -25,7 +25,7 @@ class AddShowInNavToStatusLabels extends Migration public function down() { Schema::table('status_labels', function (Blueprint $table) { - $table->dropColumn('show_in_nav', 'field_encrypted'); + $table->dropColumn('show_in_nav'); }); } } From 39ab545cf5b08d3a79d6d4a84d96874db11519ba Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:08:28 -0800 Subject: [PATCH 0011/1270] Update alter statement to use correct suffix for column This is brittle... --- database/migrations/2015_09_22_003413_migrate_mac_address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2015_09_22_003413_migrate_mac_address.php b/database/migrations/2015_09_22_003413_migrate_mac_address.php index 516b5c2ec7..8167e28adf 100644 --- a/database/migrations/2015_09_22_003413_migrate_mac_address.php +++ b/database/migrations/2015_09_22_003413_migrate_mac_address.php @@ -55,6 +55,6 @@ class MigrateMacAddress extends Migration Schema::table('models', function (Blueprint $table) { $table->renameColumn('deprecated_mac_address', 'show_mac_address'); }); - DB::statement('ALTER TABLE assets CHANGE _snipeit_mac_address mac_address varchar(255)'); + DB::statement('ALTER TABLE assets CHANGE _snipeit_mac_address_1 mac_address varchar(255)'); } } From 4ee3cbf60e5b6f17ecae9e6fc2025795f26008bd Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:20:20 -0800 Subject: [PATCH 0012/1270] Comment out migration's down method to match its up method --- ...015_07_29_230054_add_thread_id_to_asset_logs_table.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php b/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php index eefc283e3f..f14dc078cc 100644 --- a/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php +++ b/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php @@ -105,10 +105,10 @@ */ public function down() { - Schema::table('asset_logs', function (Blueprint $table) { - $table->dropIndex('thread_id'); - $table->dropColumn('thread_id'); - }); + // Schema::table('asset_logs', function (Blueprint $table) { + // $table->dropIndex('thread_id'); + // $table->dropColumn('thread_id'); + // }); } /** From c5b09ed95584b01e649c670f9d8b8e2a8778e041 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:21:46 -0800 Subject: [PATCH 0013/1270] Fix column name typo --- .../migrations/2013_12_10_084038_add_eol_on_models_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2013_12_10_084038_add_eol_on_models_table.php b/database/migrations/2013_12_10_084038_add_eol_on_models_table.php index d8d222deec..97e7b266e6 100755 --- a/database/migrations/2013_12_10_084038_add_eol_on_models_table.php +++ b/database/migrations/2013_12_10_084038_add_eol_on_models_table.php @@ -24,7 +24,7 @@ class AddEolOnModelsTable extends Migration public function down() { Schema::table('models', function ($table) { - $table->dropColumn('old'); + $table->dropColumn('eol'); }); } } From 296c9a723d25ec46190273ec39426d489cbe25c3 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:22:29 -0800 Subject: [PATCH 0014/1270] Reverse column rename in migration's down method --- .../2013_11_25_104343_alter_warranty_column_on_assets.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/migrations/2013_11_25_104343_alter_warranty_column_on_assets.php b/database/migrations/2013_11_25_104343_alter_warranty_column_on_assets.php index be62374dce..d63a6ad9b4 100755 --- a/database/migrations/2013_11_25_104343_alter_warranty_column_on_assets.php +++ b/database/migrations/2013_11_25_104343_alter_warranty_column_on_assets.php @@ -23,6 +23,8 @@ class AlterWarrantyColumnOnAssets extends Migration */ public function down() { - // + Schema::table('assets', function ($table) { + $table->renameColumn('warranty_months', 'warrantee_months'); + }); } } From 03938d0f32fd6f1b6891d5aa75e83edc7f8eccc1 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:24:38 -0800 Subject: [PATCH 0015/1270] Conditionally drop table --- .../migrations/2013_11_25_013244_recreate_licenses_table.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2013_11_25_013244_recreate_licenses_table.php b/database/migrations/2013_11_25_013244_recreate_licenses_table.php index fb18452794..a22349dcd6 100755 --- a/database/migrations/2013_11_25_013244_recreate_licenses_table.php +++ b/database/migrations/2013_11_25_013244_recreate_licenses_table.php @@ -37,7 +37,7 @@ class ReCreateLicensesTable extends Migration */ public function down() { - // - Schema::drop('licenses'); + // This was most likely handled in 2013_11_17_054359_drop_licenses_table.php + Schema::dropIfExists('licenses'); } } From aec64fa64ac2a7b59e953972af55c349de7864d7 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:25:25 -0800 Subject: [PATCH 0016/1270] Comment out migration's down method to match its up method --- .../migrations/2013_11_17_054526_add_physical_to_assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2013_11_17_054526_add_physical_to_assets.php b/database/migrations/2013_11_17_054526_add_physical_to_assets.php index 2ccc7c43dc..28d1117201 100755 --- a/database/migrations/2013_11_17_054526_add_physical_to_assets.php +++ b/database/migrations/2013_11_17_054526_add_physical_to_assets.php @@ -26,6 +26,6 @@ class AddPhysicalToAssets extends Migration */ public function down() { - $table->dropColumn('physical'); + // $table->dropColumn('physical'); } } From b5ea8b8a4fd17bc27ddffb05881a748fec4526b2 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:29:38 -0800 Subject: [PATCH 0017/1270] Conditionally drop table --- ..._12_06_225929_migration_cartalyst_sentry_install_groups.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php b/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php index cd45847bc7..49242f2e30 100644 --- a/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php +++ b/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php @@ -44,6 +44,7 @@ class MigrationCartalystSentryInstallGroups extends Migration */ public function down() { - Schema::drop('permission_groups'); + // See 2014_11_04_231416_update_group_field_for_reporting.php and 2019_06_12_184327_rename_groups_table.php + Schema::dropIfExists('permission_groups'); } } From e8c2b84d24b7fcfbd0bcced9bee09e0e701b5bed Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 12:51:15 -0800 Subject: [PATCH 0018/1270] Add example dusk environment file --- .env.dusk.example | 106 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 .env.dusk.example diff --git a/.env.dusk.example b/.env.dusk.example new file mode 100644 index 0000000000..074f6fc3d7 --- /dev/null +++ b/.env.dusk.example @@ -0,0 +1,106 @@ +# -------------------------------------------- +# REQUIRED: BASIC APP SETTINGS +# -------------------------------------------- +APP_ENV=local +APP_DEBUG=false +APP_KEY=base64:hTUIUh9CP6dQx+6EjSlfWTgbaMaaRvlpEwk45vp+xmk= +APP_URL=http://127.0.0.1:8000 +APP_TIMEZONE='US/Eastern' +APP_LOCALE=en +APP_LOCKED=false +MAX_RESULTS=200 + +# -------------------------------------------- +# REQUIRED: UPLOADED FILE STORAGE SETTINGS +# -------------------------------------------- +PRIVATE_FILESYSTEM_DISK=local +PUBLIC_FILESYSTEM_DISK=local_public + +# -------------------------------------------- +# REQUIRED: DATABASE SETTINGS +# -------------------------------------------- +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=null +DB_USERNAME=null +DB_PASSWORD=null +DB_PREFIX=null +#DB_DUMP_PATH= + +# -------------------------------------------- +# OPTIONAL: SSL DATABASE SETTINGS +# -------------------------------------------- +DB_SSL=false +DB_SSL_KEY_PATH=null +DB_SSL_CERT_PATH=null +DB_SSL_CA_PATH=null +DB_SSL_CIPHER=null + +# -------------------------------------------- +# REQUIRED: OUTGOING MAIL SERVER SETTINGS +# -------------------------------------------- +MAIL_DRIVER="log" + + +# -------------------------------------------- +# REQUIRED: IMAGE LIBRARY +# This should be gd or imagick +# -------------------------------------------- +IMAGE_LIB=gd + + +# -------------------------------------------- +# OPTIONAL: SESSION SETTINGS +# -------------------------------------------- +SESSION_LIFETIME=12000 +EXPIRE_ON_CLOSE=false +ENCRYPT=true +COOKIE_NAME=snipeit_v5_local +SECURE_COOKIES=true + +# -------------------------------------------- +# OPTIONAL: SECURITY HEADER SETTINGS +# -------------------------------------------- +REFERRER_POLICY=same-origin +ENABLE_CSP=true +CORS_ALLOWED_ORIGINS="*" + +# -------------------------------------------- +# OPTIONAL: CACHE SETTINGS +# -------------------------------------------- +CACHE_DRIVER=file +SESSION_DRIVER=file +QUEUE_DRIVER=sync + +# -------------------------------------------- +# OPTIONAL: LOGIN THROTTLING +# -------------------------------------------- +LOGIN_MAX_ATTEMPTS=50000 +LOGIN_LOCKOUT_DURATION=1000 +RESET_PASSWORD_LINK_EXPIRES=15 + +# -------------------------------------------- +# OPTIONAL: API +# -------------------------------------------- +API_MAX_REQUESTS_PER_HOUR=200 + +# -------------------------------------------- +# OPTIONAL: SAML SETTINGS +# -------------------------------------------- +DISABLE_NOSAML_LOCAL_LOGIN=true + + +# -------------------------------------------- +# OPTIONAL: MISC +# -------------------------------------------- +LOG_CHANNEL=single +LOG_LEVEL=debug +LOG_CHANNEL=stack +LOG_SLACK_WEBHOOK_URL=null +APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1 +ALLOW_IFRAMING=true +ENABLE_HSTS=false +WARN_DEBUG=false +APP_CIPHER=AES-256-CBC + From 9a3a796e176ad593619d8633b73db77fe1d81ed7 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 12:57:05 -0800 Subject: [PATCH 0019/1270] Add dusk environment files to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 37e9d3f68c..cc67e5c40d 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .couscous .DS_Store .env +.env.dusk.* .idea /bin/ /bootstrap/compiled.php From 49383ddbe0fd3c6a37a5a22a7cfeaa67c0c49926 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 12:58:57 -0800 Subject: [PATCH 0020/1270] Delete old dusk local configuration --- .env.dusk.local | 106 ------------------------------------------------ 1 file changed, 106 deletions(-) delete mode 100644 .env.dusk.local diff --git a/.env.dusk.local b/.env.dusk.local deleted file mode 100644 index 33343ffc51..0000000000 --- a/.env.dusk.local +++ /dev/null @@ -1,106 +0,0 @@ -# -------------------------------------------- -# REQUIRED: BASIC APP SETTINGS -# -------------------------------------------- -APP_ENV=local -APP_DEBUG=false -APP_KEY=base64:hTUIUh9CP6dQx+6EjSlfWTgbaMaaRvlpEwk45vp+xmk= -APP_URL=http://127.0.0.1:8000 -APP_TIMEZONE='US/Eastern' -APP_LOCALE=en -APP_LOCKED=false -MAX_RESULTS=200 - -# -------------------------------------------- -# REQUIRED: UPLOADED FILE STORAGE SETTINGS -# -------------------------------------------- -PRIVATE_FILESYSTEM_DISK=local -PUBLIC_FILESYSTEM_DISK=local_public - -# -------------------------------------------- -# REQUIRED: DATABASE SETTINGS -# -------------------------------------------- -DB_CONNECTION=mysql -DB_HOST=localhost -DB_PORT=3306 -DB_DATABASE=snipeit-local -DB_USERNAME=snipeit-local -DB_PASSWORD=snipeit-local -DB_PREFIX=null -DB_DUMP_PATH='/Applications/MAMP/Library/bin' - -# -------------------------------------------- -# OPTIONAL: SSL DATABASE SETTINGS -# -------------------------------------------- -DB_SSL=false -DB_SSL_KEY_PATH=null -DB_SSL_CERT_PATH=null -DB_SSL_CA_PATH=null -DB_SSL_CIPHER=null - -# -------------------------------------------- -# REQUIRED: OUTGOING MAIL SERVER SETTINGS -# -------------------------------------------- -MAIL_DRIVER="log" - - -# -------------------------------------------- -# REQUIRED: IMAGE LIBRARY -# This should be gd or imagick -# -------------------------------------------- -IMAGE_LIB=gd - - -# -------------------------------------------- -# OPTIONAL: SESSION SETTINGS -# -------------------------------------------- -SESSION_LIFETIME=12000 -EXPIRE_ON_CLOSE=false -ENCRYPT=true -COOKIE_NAME=snipeit_v5_local -SECURE_COOKIES=true - -# -------------------------------------------- -# OPTIONAL: SECURITY HEADER SETTINGS -# -------------------------------------------- -REFERRER_POLICY=same-origin -ENABLE_CSP=true -CORS_ALLOWED_ORIGINS="*" - -# -------------------------------------------- -# OPTIONAL: CACHE SETTINGS -# -------------------------------------------- -CACHE_DRIVER=file -SESSION_DRIVER=file -QUEUE_DRIVER=sync - -# -------------------------------------------- -# OPTIONAL: LOGIN THROTTLING -# -------------------------------------------- -LOGIN_MAX_ATTEMPTS=50000 -LOGIN_LOCKOUT_DURATION=1000 -RESET_PASSWORD_LINK_EXPIRES=15 - -# -------------------------------------------- -# OPTIONAL: API -# -------------------------------------------- -API_MAX_REQUESTS_PER_HOUR=200 - -# -------------------------------------------- -# OPTIONAL: SAML SETTINGS -# -------------------------------------------- -DISABLE_NOSAML_LOCAL_LOGIN=true - - -# -------------------------------------------- -# OPTIONAL: MISC -# -------------------------------------------- -LOG_CHANNEL=single -LOG_LEVEL=debug -LOG_CHANNEL=stack -LOG_SLACK_WEBHOOK_URL=null -APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1 -ALLOW_IFRAMING=true -ENABLE_HSTS=false -WARN_DEBUG=false -APP_CIPHER=AES-256-CBC - From bc80f672ee1f88e8d4bc66facee410f439bcdedd Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 13:00:34 -0800 Subject: [PATCH 0021/1270] Keep the example dusk environment file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cc67e5c40d..078a7e4b8a 100755 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .DS_Store .env .env.dusk.* +!.env.dusk.example .idea /bin/ /bootstrap/compiled.php From 49f2573f36602370666808494d9d738cd96ee436 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 13:51:01 -0800 Subject: [PATCH 0022/1270] Update testing readme --- TESTING.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/TESTING.md b/TESTING.md index 6624289758..f7034895a3 100644 --- a/TESTING.md +++ b/TESTING.md @@ -43,23 +43,25 @@ you want to run. ## Browser Tests -The browser tests use [Dusk](https://laravel.com/docs/8.x/dusk) to run them. -When troubleshooting any problems, make sure that your `.env` file is configured -correctly to run the existing application. +Browser tests are run via [Laravel Dusk](https://laravel.com/docs/8.x/dusk) and require Google Chrome to be installed. + +Before attempting to run Dusk tests copy the example environment file for Dusk and update the values to match your environment: + +`cp .env.dusk.example .env.dusk.local` +> `local` refers to the value of `APP_ENV` in your `.env` so if you have it set to `dev` then the file should be named `.env.dusk.dev`. ### Test Setup -Your application needs to be configued and up and running in order for the browser +Your application needs to be configured and up and running in order for the browser tests to actually run. When running the tests locally, you can start the application using the following command: `php artisan serve` - -To run the test suite use the following command from another terminal tab or window: +Now you are ready to run the test suite. Use the following command from another terminal tab or window: `php artisan dusk` -To run individual test files, you can pass the path to the test that you want to run. +To run individual test files, you can pass the path to the test that you want to run: `php artisan dusk tests/Browser/LoginTest.php` From 0dd7cc9967941a821fe9d45864ab0c6844c8be4d Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 13:54:28 -0800 Subject: [PATCH 0023/1270] Add note about installing ChromeDriver to testing readme --- TESTING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TESTING.md b/TESTING.md index f7034895a3..a1706177a9 100644 --- a/TESTING.md +++ b/TESTING.md @@ -65,3 +65,9 @@ Now you are ready to run the test suite. Use the following command from another To run individual test files, you can pass the path to the test that you want to run: `php artisan dusk tests/Browser/LoginTest.php` + +If you get an error when attempting to run Dusk tests that says `Couldn't connect to server` run: + +`php artisan dusk:chrome-driver --detect` + +This command will install the specific ChromeDriver Dusk needs for your operating system and Chrome version. From 51da747809ff039d5d294f493f13cd726cd4fbc3 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 18:05:07 -0800 Subject: [PATCH 0024/1270] Add note about database requirements when running Dusk tests --- TESTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TESTING.md b/TESTING.md index a1706177a9..8a430d498e 100644 --- a/TESTING.md +++ b/TESTING.md @@ -50,6 +50,8 @@ Before attempting to run Dusk tests copy the example environment file for Dusk a `cp .env.dusk.example .env.dusk.local` > `local` refers to the value of `APP_ENV` in your `.env` so if you have it set to `dev` then the file should be named `.env.dusk.dev`. +**Important**: Dusk tests cannot be run using an in-memory SQLite database. Additionally, the Dusk test suite uses the `DatabaseMigrations` trait which will leave the database in a fresh state after running. Therefore, it is recommended that you create a test database and point `DB_DATABASE` in `.env.dusk.local` to it. + ### Test Setup Your application needs to be configured and up and running in order for the browser From 6fbb484dfd5362c8300d2710fe2a3815a63d87ed Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 18 Jan 2023 08:43:03 -0800 Subject: [PATCH 0025/1270] renames db column for auto_assign boolean, rewords trans string, default value of 1 now --- ..._11_15_232525_adds_should_autoassign_bool_to_users_table.php | 2 +- resources/lang/en/admin/users/general.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php b/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php index 6f6f308e44..854feebfea 100644 --- a/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php +++ b/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php @@ -14,7 +14,7 @@ class AddsShouldAutoassignBoolToUsersTable extends Migration public function up() { Schema::table('users', function (Blueprint $table) { - $table->boolean('should_autoassign')->nullable(false)->default(0); + $table->boolean('autoassign_licenses')->nullable(false)->default(1); }); } diff --git a/resources/lang/en/admin/users/general.php b/resources/lang/en/admin/users/general.php index 71f56c7a15..58c54a7d27 100644 --- a/resources/lang/en/admin/users/general.php +++ b/resources/lang/en/admin/users/general.php @@ -19,7 +19,7 @@ return [ 'print_assigned' => 'Print All Assigned', 'email_assigned' => 'Email List of All Assigned', 'user_notified' => 'User has been emailed a list of their currently assigned items.', - 'auto_assign_label' => 'User should be skipped during auto assignment commands', + 'auto_assign_label' => 'Include this user when auto-assigning eligible licenses', 'auto_assign_help' => 'Skip this user in auto assignment of licenses', 'software_user' => 'Software Checked out to :name', 'send_email_help' => 'You must provide an email address for this user to send them credentials. Emailing credentials can only be done on user creation. Passwords are stored in a one-way hash and cannot be retrieved once saved.', From 7ce230fadcb47a4d1b5f39184bacdb18125059aa Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 18 Jan 2023 08:57:59 -0800 Subject: [PATCH 0026/1270] missed a few renames --- app/Console/Commands/CheckoutLicenseToAllUsers.php | 2 +- app/Http/Controllers/Users/UsersController.php | 4 ++-- ...1_15_232525_adds_should_autoassign_bool_to_users_table.php | 2 +- resources/views/users/edit.blade.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Console/Commands/CheckoutLicenseToAllUsers.php b/app/Console/Commands/CheckoutLicenseToAllUsers.php index 44ec72e13c..1ba57895c2 100644 --- a/app/Console/Commands/CheckoutLicenseToAllUsers.php +++ b/app/Console/Commands/CheckoutLicenseToAllUsers.php @@ -56,7 +56,7 @@ class CheckoutLicenseToAllUsers extends Command return false; } - $users = User::whereNull('deleted_at')->where('should_autoassign', '==', 0)->with('licenses')->get(); + $users = User::whereNull('deleted_at')->where('autoassign_licenses', '==', 1)->with('licenses')->get(); if ($users->count() > $license->getAvailSeatsCountAttribute()) { $this->info('You do not have enough free seats to complete this task, so we will check out as many as we can. '); diff --git a/app/Http/Controllers/Users/UsersController.php b/app/Http/Controllers/Users/UsersController.php index b863fb966b..eecce0aea6 100755 --- a/app/Http/Controllers/Users/UsersController.php +++ b/app/Http/Controllers/Users/UsersController.php @@ -121,7 +121,7 @@ class UsersController extends Controller $user->created_by = Auth::user()->id; $user->start_date = $request->input('start_date', null); $user->end_date = $request->input('end_date', null); - $user->should_autoassign= $request->input('should_autoassign', 0); + $user->autoassign_licenses= $request->input('autoassign_licenses', 1); // Strip out the superuser permission if the user isn't a superadmin $permissions_array = $request->input('permission'); @@ -275,7 +275,7 @@ class UsersController extends Controller $user->website = $request->input('website', null); $user->start_date = $request->input('start_date', null); $user->end_date = $request->input('end_date', null); - $user->should_autoassign = $request->input('should_autoassign', 0); + $user->autoassign_licenses = $request->input('autoassign_licenses', 1); // Update the location of any assets checked out to this user Asset::where('assigned_type', User::class) diff --git a/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php b/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php index 854feebfea..b728e1f22b 100644 --- a/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php +++ b/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php @@ -26,7 +26,7 @@ class AddsShouldAutoassignBoolToUsersTable extends Migration public function down() { Schema::table('users', function (Blueprint $table) { - $table->dropColumn('should_autoassign'); + $table->dropColumn('autoassign_licenses'); }); } } diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index 7126428607..e4666a4d0c 100755 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -379,8 +379,8 @@
-
@if (config('app.lock_passwords')===true) -{{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}}

{{ trans('general.feature_disabled') }}

-
+
@else -
-{{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} +
@endif {!! $errors->first('slack_endpoint', '') !!}
@@ -66,12 +64,11 @@
@if (config('app.lock_passwords')===true) -{{-- {{ Form::text('slack_botname', old('slack_botname', $setting->slack_botname), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'Snipe-Bot')) }}--}} -
+

{{ trans('general.feature_disabled') }}

@else -
+
@endif {!! $errors->first('slack_botname', '') !!}
From 78343ddb7c1269c5f7d59a3e7861ddcd930104e8 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 6 Feb 2023 10:58:10 -0800 Subject: [PATCH 0133/1270] Add asset's company name to checkout page --- resources/views/hardware/checkout.blade.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/views/hardware/checkout.blade.php b/resources/views/hardware/checkout.blade.php index 2b3cdbc19e..13c4514050 100755 --- a/resources/views/hardware/checkout.blade.php +++ b/resources/views/hardware/checkout.blade.php @@ -32,8 +32,7 @@

@if (($asset->model) && ($asset->model->name)) - {{ $asset->model->name }} - + {{ $asset->model->name }}@if ($asset->company && $asset->company->name) ({{ $asset->company->name }}) @endif @else This asset's model is invalid! From 38cdcdf064a039c7e8a051f0e02fc1f18429e818 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 6 Feb 2023 10:59:51 -0800 Subject: [PATCH 0134/1270] Eager load company --- app/Http/Controllers/Assets/AssetCheckoutController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Assets/AssetCheckoutController.php b/app/Http/Controllers/Assets/AssetCheckoutController.php index 38f7460986..e6326da6b1 100644 --- a/app/Http/Controllers/Assets/AssetCheckoutController.php +++ b/app/Http/Controllers/Assets/AssetCheckoutController.php @@ -27,7 +27,7 @@ class AssetCheckoutController extends Controller public function create($assetId) { // Check if the asset exists - if (is_null($asset = Asset::find(e($assetId)))) { + if (is_null($asset = Asset::with('company')->find(e($assetId)))) { return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist')); } From 45e8e9bbed0c33d49f1fe1c9484d278b1c15fd69 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 6 Feb 2023 12:21:09 -0800 Subject: [PATCH 0135/1270] Move company name to better location --- resources/views/hardware/checkout.blade.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/views/hardware/checkout.blade.php b/resources/views/hardware/checkout.blade.php index 13c4514050..6b5d337b73 100755 --- a/resources/views/hardware/checkout.blade.php +++ b/resources/views/hardware/checkout.blade.php @@ -26,13 +26,23 @@

{{csrf_field()}} + @if ($asset->company && $asset->company->name) +
+ {{ Form::label('model', trans('admin/companies/general.company'), array('class' => 'col-md-3 control-label')) }} +
+

+ {{ $asset->company->name }} +

+
+
+ @endif
{{ Form::label('model', trans('admin/hardware/form.model'), array('class' => 'col-md-3 control-label')) }}

@if (($asset->model) && ($asset->model->name)) - {{ $asset->model->name }}@if ($asset->company && $asset->company->name) ({{ $asset->company->name }}) @endif + {{ $asset->model->name }} @else This asset's model is invalid! @@ -167,4 +177,4 @@ -@stop \ No newline at end of file +@stop From 0e57e4836eba840698232cd4387df4d1ad5688d5 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 6 Feb 2023 12:21:23 -0800 Subject: [PATCH 0136/1270] Add translation for Company --- resources/lang/en/admin/companies/general.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/lang/en/admin/companies/general.php b/resources/lang/en/admin/companies/general.php index 37781012ba..6ad64db576 100644 --- a/resources/lang/en/admin/companies/general.php +++ b/resources/lang/en/admin/companies/general.php @@ -1,6 +1,7 @@ 'Company', 'select_company' => 'Select Company', 'about_companies' => 'About Companies', 'about_companies_description' => ' You can use companies as a simple informative field, or you can use them to restrict asset visibility and availability to users with a specific company by enabling Full Company Support in your Admin Settings.', From 686d1aaae73af8b7e5bf161ff347b032bfa3ad78 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:38:29 -0800 Subject: [PATCH 0137/1270] Removed unused variable Signed-off-by: snipe --- upgrade.php | 1 - 1 file changed, 1 deletion(-) diff --git a/upgrade.php b/upgrade.php index 892e92e46c..0a82edfbf7 100644 --- a/upgrade.php +++ b/upgrade.php @@ -43,7 +43,6 @@ echo "--------------------------------------------------------\n\n"; // Check the .env looks ok $env = file('.env'); -$env_error_count = 0; $env_good = ''; $env_bad = ''; From b10ea0c25cf605a4b519a1319c9320f560b63dc9 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:38:56 -0800 Subject: [PATCH 0138/1270] Removed unused variable Signed-off-by: snipe --- upgrade.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/upgrade.php b/upgrade.php index 0a82edfbf7..e3bf64ce1e 100644 --- a/upgrade.php +++ b/upgrade.php @@ -84,7 +84,7 @@ foreach ($env as $line_num => $line) { if ($env_key == 'APP_KEY') { if (($env_value=='') || (strlen($env_value) < 20)) { - $env_bad .= "✘ APP_KEY ERROR in your .env on line #'.$show_line_num.': Your APP_KEY should not be blank. Run `php artisan key:generate` to generate one.\n"; + $env_bad .= "✘ APP_KEY ERROR in your .env on line #'.{$show_line_num}.': Your APP_KEY should not be blank. Run `php artisan key:generate` to generate one.\n"; } else { $env_good .= "√ Your APP_KEY is not blank. \n"; } @@ -92,8 +92,6 @@ foreach ($env as $line_num => $line) { if ($env_key == 'APP_URL') { - $app_url_length = strlen($env_value); - if (($env_value!="null") && ($env_value!="")) { $env_good .= '√ Your APP_URL is not null or blank. It is set to '.$env_value."\n"; From ec2afee57d3abc3ce9c04196559e0f9f95a197fb Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:39:12 -0800 Subject: [PATCH 0139/1270] Fixed yoda operator Signed-off-by: snipe --- upgrade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upgrade.php b/upgrade.php index e3bf64ce1e..ca71a61844 100644 --- a/upgrade.php +++ b/upgrade.php @@ -449,11 +449,11 @@ echo "--------------------------------------------------------\n\n"; function str_begins($haystack, $needle) { - return 0 === substr_compare($haystack, $needle, 0, strlen($needle)); + return (substr_compare($haystack, $needle, 0, strlen($needle)) === 0); } function str_ends($haystack, $needle) { - return 0 === substr_compare($haystack, $needle, -strlen($needle)); + return (substr_compare($haystack, $needle, -strlen($needle)) === 0); } From ab6ca0e06613fccbbf00a4110944c75a66d6341c Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:39:22 -0800 Subject: [PATCH 0140/1270] Added parens Signed-off-by: snipe --- routes/console.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/console.php b/routes/console.php index a4c876ae04..2413e4b189 100644 --- a/routes/console.php +++ b/routes/console.php @@ -20,7 +20,7 @@ Artisan::command('inspire', function () { Artisan::command('snipeit:travisci-install', function () { if (! Setting::setupCompleted()) { - $settings = new Setting; + $settings = new Setting(); $settings->site_name = 'test-ci'; $settings->alert_email = 'test@example.com'; $settings->alerts_enabled = 1; From 8841f04333ef61363250c631a906ec6e55bcdbc4 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:39:38 -0800 Subject: [PATCH 0141/1270] Fixed array bracket indenting Signed-off-by: snipe --- routes/api.php | 66 +++++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 44 deletions(-) diff --git a/routes/api.php b/routes/api.php index d9db5b78ee..37bc3baa8d 100644 --- a/routes/api.php +++ b/routes/api.php @@ -114,8 +114,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('accessories', Api\AccessoriesController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.accessories.index', 'show' => 'api.accessories.show', 'update' => 'api.accessories.update', @@ -144,8 +143,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('categories', Api\CategoriesController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.categories.index', 'show' => 'api.categories.show', 'update' => 'api.categories.update', @@ -173,8 +171,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('companies', Api\CompaniesController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.companies.index', 'show' => 'api.companies.show', 'update' => 'api.companies.update', @@ -203,8 +200,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('departments', Api\DepartmentsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.departments.index', 'show' => 'api.departments.show', 'update' => 'api.departments.update', @@ -254,8 +250,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('components', Api\ComponentsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.components.index', 'show' => 'api.components.show', 'update' => 'api.components.update', @@ -308,8 +303,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('consumables', Api\ConsumablesController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.consumables.index', 'show' => 'api.consumables.show', 'update' => 'api.consumables.update', @@ -328,8 +322,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi */ Route::resource('depreciations', Api\DepreciationsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.depreciations.index', 'show' => 'api.depreciations.show', 'update' => 'api.depreciations.update', @@ -416,8 +409,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('fieldsets', Api\CustomFieldsetsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.fieldsets.index', 'show' => 'api.fieldsets.show', 'update' => 'api.fieldsets.update', @@ -436,8 +428,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi */ Route::resource('groups', Api\GroupsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.groups.index', 'show' => 'api.groups.show', 'update' => 'api.groups.update', @@ -549,8 +540,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('hardware', Api\AssetsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.assets.index', 'show' => 'api.assets.show', 'update' => 'api.assets.update', @@ -567,8 +557,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi */ Route::resource('maintenances', Api\AssetMaintenancesController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.maintenances.index', 'show' => 'api.maintenances.show', 'update' => 'api.maintenances.update', @@ -597,8 +586,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('imports', Api\ImportController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.imports.index', 'show' => 'api.imports.show', 'update' => 'api.imports.update', @@ -628,8 +616,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('licenses', Api\LicensesController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.licenses.index', 'show' => 'api.licenses.show', 'update' => 'api.licenses.update', @@ -644,8 +631,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('licenses.seats', Api\LicenseSeatsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.licenses.seats.index', 'show' => 'api.licenses.seats.show', 'update' => 'api.licenses.seats.update', @@ -686,8 +672,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('locations', Api\LocationsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.locations.index', 'show' => 'api.locations.show', 'update' => 'api.locations.update', @@ -716,8 +701,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('manufacturers', Api\ManufacturersController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.manufacturers.index', 'show' => 'api.manufacturers.show', 'update' => 'api.manufacturers.update', @@ -753,8 +737,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('models', Api\AssetModelsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.models.index', 'show' => 'api.models.show', 'update' => 'api.models.update', @@ -833,8 +816,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('settings', Api\SettingsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.settings.index', 'show' => 'api.settings.show', 'update' => 'api.settings.update', @@ -891,8 +873,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('statuslabels', Api\StatuslabelsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.statuslabels.index', 'show' => 'api.statuslabels.show', 'update' => 'api.statuslabels.update', @@ -921,8 +902,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('suppliers', Api\SuppliersController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.suppliers.index', 'show' => 'api.suppliers.show', 'update' => 'api.suppliers.update', @@ -1015,8 +995,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi Route::resource('users', Api\UsersController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.users.index', 'show' => 'api.users.show', 'update' => 'api.users.update', @@ -1034,8 +1013,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi */ Route::resource('kits', Api\PredefinedKitsController::class, - ['names' => - [ + ['names' => [ 'index' => 'api.kits.index', 'show' => 'api.kits.show', 'update' => 'api.kits.update', From a60510c063b624ca42a1b28dfac4cd1dd6ef41a5 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:39:48 -0800 Subject: [PATCH 0142/1270] Added insights config Signed-off-by: snipe --- config/insights.php | 128 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 config/insights.php diff --git a/config/insights.php b/config/insights.php new file mode 100644 index 0000000000..f0393edeca --- /dev/null +++ b/config/insights.php @@ -0,0 +1,128 @@ + 'laravel', + + /* + |-------------------------------------------------------------------------- + | IDE + |-------------------------------------------------------------------------- + | + | This options allow to add hyperlinks in your terminal to quickly open + | files in your favorite IDE while browsing your PhpInsights report. + | + | Supported: "textmate", "macvim", "emacs", "sublime", "phpstorm", + | "atom", "vscode". + | + | If you have another IDE that is not in this list but which provide an + | url-handler, you could fill this config with a pattern like this: + | + | myide://open?url=file://%f&line=%l + | + */ + + 'ide' => null, + + /* + |-------------------------------------------------------------------------- + | Configuration + |-------------------------------------------------------------------------- + | + | Here you may adjust all the various `Insights` that will be used by PHP + | Insights. You can either add, remove or configure `Insights`. Keep in + | mind that all added `Insights` must belong to a specific `Metric`. + | + */ + + 'exclude' => [ + // 'path/to/directory-or-file' + ], + + 'add' => [ + Classes::class => [ + ForbiddenFinalClasses::class, + ], + ], + + 'remove' => [ + AlphabeticallySortedUsesSniff::class, + DeclareStrictTypesSniff::class, + DisallowMixedTypeHintSniff::class, + ForbiddenDefineFunctions::class, + ForbiddenNormalClasses::class, + ForbiddenTraits::class, + ParameterTypeHintSniff::class, + PropertyTypeHintSniff::class, + ReturnTypeHintSniff::class, + UselessFunctionDocCommentSniff::class, + ], + + 'config' => [ + ForbiddenPrivateMethods::class => [ + 'title' => 'The usage of private methods is not idiomatic in Laravel.', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Requirements + |-------------------------------------------------------------------------- + | + | Here you may define a level you want to reach per `Insights` category. + | When a score is lower than the minimum level defined, then an error + | code will be returned. This is optional and individually defined. + | + */ + + 'requirements' => [ +// 'min-quality' => 0, +// 'min-complexity' => 0, +// 'min-architecture' => 0, +// 'min-style' => 0, +// 'disable-security-check' => false, + ], + + /* + |-------------------------------------------------------------------------- + | Threads + |-------------------------------------------------------------------------- + | + | Here you may adjust how many threads (core) PHPInsights can use to perform + | the analyse. This is optional, don't provide it and the tool will guess + | the max core number available. It accepts null value or integer > 0. + | + */ + + 'threads' => null, + +]; From aeb8dfb07df1bbc79edcc09b4cddf0bbaddf26d7 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:39:55 -0800 Subject: [PATCH 0143/1270] Added phpinsights Signed-off-by: snipe --- composer.json | 1 + composer.lock | 1477 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 1476 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 06d8563039..f682ded9f5 100644 --- a/composer.json +++ b/composer.json @@ -75,6 +75,7 @@ "fakerphp/faker": "^1.16", "laravel/dusk": "^6.25", "mockery/mockery": "^1.4", + "nunomaduro/phpinsights": "^2.7", "phpunit/php-token-stream": "^3.1", "phpunit/phpunit": "^9.0", "squizlabs/php_codesniffer": "^3.5", diff --git a/composer.lock b/composer.lock index d23081089c..41757eb21a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4fed0ab76a34ef85a44568e470abab48", + "content-hash": "03d904cb0c9cd4da1c3c0571bb15dae9", "packages": [ { "name": "alek13/slack", @@ -11727,6 +11727,302 @@ } ], "packages-dev": [ + { + "name": "composer/pcre", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-11-17T09:50:14+00:00" + }, + { + "name": "composer/semver", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-04-01T19:23:25+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "4be43904336affa5c2f70744a348312336afd0da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", + "reference": "4be43904336affa5c2f70744a348312336afd0da", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" + }, + "time": "2023-01-05T11:28:13+00:00" + }, { "name": "fakerphp/faker", "version": "v1.20.0", @@ -11794,6 +12090,95 @@ }, "time": "2022-07-20T13:12:54+00:00" }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.13.2", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "3952f08a81bd3b1b15e11c3de0b6bf037faa8496" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/3952f08a81bd3b1b15e11c3de0b6bf037faa8496", + "reference": "3952f08a81bd3b1b15e11c3de0b6bf037faa8496", + "shasum": "" + }, + "require": { + "composer/semver": "^3.2", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^1.13", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php80": "^1.25", + "symfony/polyfill-php81": "^1.25", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.0", + "mikey179/vfsstream": "^1.6.10", + "php-coveralls/php-coveralls": "^2.5.2", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.15", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "phpunitgoodpractices/polyfill": "^1.6", + "phpunitgoodpractices/traits": "^1.9.2", + "symfony/phpunit-bridge": "^6.0", + "symfony/yaml": "^5.4 || ^6.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.13.2" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2023-01-02T23:53:50+00:00" + }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -11845,6 +12230,76 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.12", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" + }, + "time": "2022-04-13T08:02:27+00:00" + }, { "name": "laravel/dusk", "version": "v6.25.2", @@ -11918,6 +12373,88 @@ }, "time": "2022-09-29T09:37:07+00:00" }, + { + "name": "league/container", + "version": "4.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "375d13cb828649599ef5d48a339c4af7a26cd0ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/375d13cb828649599ef5d48a339c4af7a26cd0ab", + "reference": "375d13cb828649599ef5d48a339c4af7a26cd0ab", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "psr/container": "^1.1 || ^2.0" + }, + "provide": { + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "nette/php-generator": "^3.4", + "nikic/php-parser": "^4.10", + "phpstan/phpstan": "^0.12.47", + "phpunit/phpunit": "^8.5.17", + "roave/security-advisories": "dev-latest", + "scrutinizer/ocular": "^1.8", + "squizlabs/php_codesniffer": "^3.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev", + "dev-4.x": "4.x-dev", + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "mail@philbennett.co.uk", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "support": { + "issues": "https://github.com/thephpleague/container/issues", + "source": "https://github.com/thephpleague/container/tree/4.2.0" + }, + "funding": [ + { + "url": "https://github.com/philipobenito", + "type": "github" + } + ], + "time": "2021-11-16T10:29:06+00:00" + }, { "name": "mockery/mockery", "version": "1.5.0", @@ -12049,6 +12586,112 @@ ], "time": "2022-03-03T13:19:32+00:00" }, + { + "name": "nunomaduro/phpinsights", + "version": "v2.7.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/phpinsights.git", + "reference": "3a2f02cadcd1be920eed19814798810944698c51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/phpinsights/zipball/3a2f02cadcd1be920eed19814798810944698c51", + "reference": "3a2f02cadcd1be920eed19814798810944698c51", + "shasum": "" + }, + "require": { + "composer/semver": "^3.3", + "ext-iconv": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "friendsofphp/php-cs-fixer": "^3.0.0", + "justinrainbow/json-schema": "^5.1", + "league/container": "^3.2|^4.2", + "php": "^7.4 || ^8.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phploc/phploc": "^5.0|^6.0|^7.0", + "psr/container": "^1.0|^2.0", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "sebastian/diff": "^4.0", + "slevomat/coding-standard": "^7.0.8|^8.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/console": "^4.2|^5.0|^6.0", + "symfony/finder": "^4.2|^5.0|^6.0", + "symfony/http-client": "^4.3|^5.0|^6.0", + "symfony/process": "^5.4|^6.0" + }, + "require-dev": { + "ergebnis/phpstan-rules": "^0.15.0", + "illuminate/console": "^5.8|^6.0|^7.0|^8.0|^9.0", + "illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.0", + "mockery/mockery": "^1.0", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^8.0|^9.0", + "rector/rector": "0.11.56", + "symfony/var-dumper": "^4.2|^5.0|^6.0", + "thecodingmachine/phpstan-strict-rules": "^0.12.0" + }, + "suggest": { + "ext-simplexml": "It is needed for the checkstyle formatter" + }, + "bin": [ + "bin/phpinsights" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\PhpInsights\\Application\\Adapters\\Laravel\\InsightsServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "NunoMaduro\\PhpInsights\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Instant PHP quality checks from your console.", + "keywords": [ + "Insights", + "code", + "console", + "php", + "quality", + "source" + ], + "support": { + "issues": "https://github.com/nunomaduro/phpinsights/issues", + "source": "https://github.com/nunomaduro/phpinsights/tree/v2.7.0" + }, + "funding": [ + { + "url": "https://github.com/JustSteveKing", + "type": "github" + }, + { + "url": "https://github.com/cmgmyr", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2023-01-30T20:28:59+00:00" + }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -12160,6 +12803,63 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.2" + }, + "time": "2022-02-21T12:50:22+00:00" + }, { "name": "php-webdriver/webdriver", "version": "1.12.1", @@ -12225,6 +12925,112 @@ }, "time": "2022-05-03T12:16:34+00:00" }, + { + "name": "phploc/phploc", + "version": "7.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phploc.git", + "reference": "af0d5fc84f3f7725513ba59cdcbe670ac2a4532a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/af0d5fc84f3f7725513ba59cdcbe670ac2a4532a", + "reference": "af0d5fc84f3f7725513ba59cdcbe670ac2a4532a", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0", + "sebastian/cli-parser": "^1.0", + "sebastian/version": "^3.0" + }, + "bin": [ + "phploc" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "A tool for quickly measuring the size of a PHP project.", + "homepage": "https://github.com/sebastianbergmann/phploc", + "support": { + "issues": "https://github.com/sebastianbergmann/phploc/issues", + "source": "https://github.com/sebastianbergmann/phploc/tree/7.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-12-07T05:51:20+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.15.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "61800f71a5526081d1b5633766aa88341f1ade76" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/61800f71a5526081d1b5633766aa88341f1ade76", + "reference": "61800f71a5526081d1b5633766aa88341f1ade76", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.15.3" + }, + "time": "2022-12-20T20:56:55+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.15", @@ -13389,6 +14195,247 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "slevomat/coding-standard", + "version": "8.8.0", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "59e25146a4ef0a7b194c5bc55b32dd414345db89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/59e25146a4ef0a7b194c5bc55b32dd414345db89", + "reference": "59e25146a4ef0a7b194c5bc55b32dd414345db89", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", + "php": "^7.2 || ^8.0", + "phpstan/phpdoc-parser": ">=1.15.2 <1.16.0", + "squizlabs/php_codesniffer": "^3.7.1" + }, + "require-dev": { + "phing/phing": "2.17.4", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.4.10|1.9.6", + "phpstan/phpstan-deprecation-rules": "1.1.1", + "phpstan/phpstan-phpunit": "1.0.0|1.3.3", + "phpstan/phpstan-strict-rules": "1.4.4", + "phpunit/phpunit": "7.5.20|8.5.21|9.5.27" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" + ], + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.8.0" + }, + "funding": [ + { + "url": "https://github.com/kukulich", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" + } + ], + "time": "2023-01-09T10:46:13+00:00" + }, + { + "name": "symfony/cache", + "version": "v5.4.19", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "e9147c89fdfdc5d5ef798bb7193f23726ad609f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/e9147c89fdfdc5d5ef798bb7193f23726ad609f5", + "reference": "e9147c89fdfdc5d5ef798bb7193f23726ad609f5", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0", + "psr/log": "^1.1|^2|^3", + "symfony/cache-contracts": "^1.1.7|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "conflict": { + "doctrine/dbal": "<2.13.1", + "symfony/dependency-injection": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/var-dumper": "<4.4" + }, + "provide": { + "psr/cache-implementation": "1.0|2.0", + "psr/simple-cache-implementation": "1.0|2.0", + "symfony/cache-implementation": "1.0|2.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "^1.6|^2.0", + "doctrine/dbal": "^2.13.1|^3.0", + "predis/predis": "^1.1", + "psr/simple-cache": "^1.0|^2.0", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v5.4.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-19T09:49:58+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", + "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0|^3.0" + }, + "suggest": { + "symfony/cache-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v2.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, { "name": "symfony/dom-crawler", "version": "v4.4.42", @@ -13463,6 +14510,432 @@ ], "time": "2022-04-30T18:34:00+00:00" }, + { + "name": "symfony/filesystem", + "version": "v6.0.19", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3d49eec03fda1f0fc19b7349fbbe55ebc1004214", + "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-20T17:44:14+00:00" + }, + { + "name": "symfony/http-client", + "version": "v6.0.20", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "541c04560da1875f62c963c3aab6ea12a7314e11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client/zipball/541c04560da1875f62c963c3aab6ea12a7314e11", + "reference": "541c04560da1875f62c963c3aab6ea12a7314e11", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "psr/log": "^1|^2|^3", + "symfony/http-client-contracts": "^3", + "symfony/service-contracts": "^1.0|^2|^3" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "3.0" + }, + "require-dev": { + "amphp/amp": "^2.5", + "amphp/http-client": "^4.2.1", + "amphp/http-tunnel": "^1.0", + "amphp/socket": "^1.1", + "guzzlehttp/promises": "^1.4", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/stopwatch": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-client/tree/v6.0.20" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-30T15:41:07+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "4184b9b63af1edaf35b6a7974c6f1f9f33294129" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/4184b9b63af1edaf35b6a7974c6f1f9f33294129", + "reference": "4184b9b63af1edaf35b6a7974c6f1f9f33294129", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "suggest": { + "symfony/http-client-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-12T16:11:42+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v6.0.19", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "6a180d1c45e0d9797470ca9eb46215692de00fa3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/6a180d1c45e0d9797470ca9eb46215692de00fa3", + "reference": "6a180d1c45e0d9797470ca9eb46215692de00fa3", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-01T08:36:10+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v6.0.19", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "011e781839dd1d2eb8119f65ac516a530f60226d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/011e781839dd1d2eb8119f65ac516a530f60226d", + "reference": "011e781839dd1d2eb8119f65ac516a530f60226d", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/service-contracts": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-01T08:36:10+00:00" + }, + { + "name": "symfony/var-exporter", + "version": "v6.0.19", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df56f53818c2d5d9f683f4ad2e365ba73a3b69d2", + "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "require-dev": { + "symfony/var-dumper": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-13T08:34:10+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.1", @@ -13530,5 +15003,5 @@ "ext-pdo": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } From 590cb6a15b7c2ed28aec2415bdeece54d8347f9f Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:40:09 -0800 Subject: [PATCH 0144/1270] Removed unneeded concat Signed-off-by: snipe --- app/Presenters/UserPresenter.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index 8f5cfcccf5..bf4c81c809 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -346,8 +346,7 @@ class UserPresenter extends Presenter public function emailLink() { if ($this->email) { - return ''.$this->email.'' - .''; + return ''.$this->email.''; } return ''; From 8a8575bf2dfbda3f6736ecec074e7073d5dc0a51 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:40:32 -0800 Subject: [PATCH 0145/1270] Made constant DATA_SESSION_KEY public Signed-off-by: snipe --- app/Services/Saml.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/Services/Saml.php b/app/Services/Saml.php index c8fed32bb1..3f39be29ff 100644 --- a/app/Services/Saml.php +++ b/app/Services/Saml.php @@ -22,7 +22,7 @@ use Symfony\Component\HttpKernel\Exception\HttpException; */ class Saml { - const DATA_SESSION_KEY = '_samlData'; + public const DATA_SESSION_KEY = '_samlData'; /** * OneLogin_Saml2_Auth instance. @@ -308,12 +308,9 @@ class Saml */ public function samlLogin($data) { - $setting = Setting::getSettings(); $this->saveDataToSession($data); $this->loadDataFromSession(); - $username = $this->getUsername(); - return User::where('username', '=', $username)->whereNull('deleted_at')->where('activated', '=', '1')->first(); } From d95adcae372e6b448b59b3eae9e05d4664f53271 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:41:54 -0800 Subject: [PATCH 0146/1270] Fixed Implicit array creation is disallowed. Signed-off-by: snipe --- app/Notifications/AcceptanceAssetAcceptedNotification.php | 2 +- app/Notifications/AcceptanceAssetDeclinedNotification.php | 2 +- app/Notifications/InventoryAlert.php | 2 +- app/Notifications/SendUpcomingAuditNotification.php | 2 +- app/Notifications/WelcomeNotification.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Notifications/AcceptanceAssetAcceptedNotification.php b/app/Notifications/AcceptanceAssetAcceptedNotification.php index c667588dae..93e75df7b3 100644 --- a/app/Notifications/AcceptanceAssetAcceptedNotification.php +++ b/app/Notifications/AcceptanceAssetAcceptedNotification.php @@ -40,7 +40,7 @@ class AcceptanceAssetAcceptedNotification extends Notification public function via() { - $notifyBy[] = 'mail'; + $notifyBy = ['mail']; return $notifyBy; diff --git a/app/Notifications/AcceptanceAssetDeclinedNotification.php b/app/Notifications/AcceptanceAssetDeclinedNotification.php index 9446747353..82a8de9210 100644 --- a/app/Notifications/AcceptanceAssetDeclinedNotification.php +++ b/app/Notifications/AcceptanceAssetDeclinedNotification.php @@ -38,7 +38,7 @@ class AcceptanceAssetDeclinedNotification extends Notification */ public function via($notifiable) { - $notifyBy[] = 'mail'; + $notifyBy = ['mail']; return $notifyBy; diff --git a/app/Notifications/InventoryAlert.php b/app/Notifications/InventoryAlert.php index ff88b548c0..6d59e3b42a 100644 --- a/app/Notifications/InventoryAlert.php +++ b/app/Notifications/InventoryAlert.php @@ -32,7 +32,7 @@ class InventoryAlert extends Notification */ public function via() { - $notifyBy[] = 'mail'; + $notifyBy = ['mail']; return $notifyBy; } diff --git a/app/Notifications/SendUpcomingAuditNotification.php b/app/Notifications/SendUpcomingAuditNotification.php index a883220f2f..a1005494f6 100644 --- a/app/Notifications/SendUpcomingAuditNotification.php +++ b/app/Notifications/SendUpcomingAuditNotification.php @@ -40,7 +40,7 @@ class SendUpcomingAuditNotification extends Notification */ public function toMail() { - $message = (new MailMessage)->markdown('notifications.markdown.upcoming-audits', + $message = (new MailMessage())->markdown('notifications.markdown.upcoming-audits', [ 'assets' => $this->assets, 'threshold' => $this->threshold, diff --git a/app/Notifications/WelcomeNotification.php b/app/Notifications/WelcomeNotification.php index 639f622188..a5754be4d9 100644 --- a/app/Notifications/WelcomeNotification.php +++ b/app/Notifications/WelcomeNotification.php @@ -44,7 +44,7 @@ class WelcomeNotification extends Notification */ public function toMail() { - return (new MailMessage) + return (new MailMessage()) ->subject(trans('mail.welcome', ['name' => $this->_data['first_name'].' '.$this->_data['last_name']])) ->markdown('notifications.Welcome', $this->_data); } From 1651dbb68d52352b07830794ea39353a51b1849f Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:43:00 -0800 Subject: [PATCH 0147/1270] Use null coalescing operator Signed-off-by: snipe --- app/Console/Commands/LdapSync.php | 24 ++++++++++++------------ app/Models/Ldap.php | 20 ++++++++++---------- app/Models/Traits/Searchable.php | 6 +++--- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index c2d7446934..13a1ee2d3f 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -197,18 +197,18 @@ class LdapSync extends Command for ($i = 0; $i < $results['count']; $i++) { $item = []; - $item['username'] = isset($results[$i][$ldap_result_username][0]) ? $results[$i][$ldap_result_username][0] : ''; - $item['employee_number'] = isset($results[$i][$ldap_result_emp_num][0]) ? $results[$i][$ldap_result_emp_num][0] : ''; - $item['lastname'] = isset($results[$i][$ldap_result_last_name][0]) ? $results[$i][$ldap_result_last_name][0] : ''; - $item['firstname'] = isset($results[$i][$ldap_result_first_name][0]) ? $results[$i][$ldap_result_first_name][0] : ''; - $item['email'] = isset($results[$i][$ldap_result_email][0]) ? $results[$i][$ldap_result_email][0] : ''; - $item['ldap_location_override'] = isset($results[$i]['ldap_location_override']) ? $results[$i]['ldap_location_override'] : ''; - $item['location_id'] = isset($results[$i]['location_id']) ? $results[$i]['location_id'] : ''; - $item['telephone'] = isset($results[$i][$ldap_result_phone][0]) ? $results[$i][$ldap_result_phone][0] : ''; - $item['jobtitle'] = isset($results[$i][$ldap_result_jobtitle][0]) ? $results[$i][$ldap_result_jobtitle][0] : ''; - $item['country'] = isset($results[$i][$ldap_result_country][0]) ? $results[$i][$ldap_result_country][0] : ''; - $item['department'] = isset($results[$i][$ldap_result_dept][0]) ? $results[$i][$ldap_result_dept][0] : ''; - $item['manager'] = isset($results[$i][$ldap_result_manager][0]) ? $results[$i][$ldap_result_manager][0] : ''; + $item['username'] = $results[$i][$ldap_result_username][0] ?? ''; + $item['employee_number'] = $results[$i][$ldap_result_emp_num][0] ?? ''; + $item['lastname'] = $results[$i][$ldap_result_last_name][0] ?? ''; + $item['firstname'] = $results[$i][$ldap_result_first_name][0] ?? ''; + $item['email'] = $results[$i][$ldap_result_email][0] ?? ''; + $item['ldap_location_override'] = $results[$i]['ldap_location_override'] ?? ''; + $item['location_id'] = $results[$i]['location_id'] ?? ''; + $item['telephone'] = $results[$i][$ldap_result_phone][0] ?? ''; + $item['jobtitle'] = $results[$i][$ldap_result_jobtitle][0] ?? ''; + $item['country'] = $results[$i][$ldap_result_country][0] ?? ''; + $item['department'] = $results[$i][$ldap_result_dept][0] ?? ''; + $item['manager'] = $results[$i][$ldap_result_manager][0] ?? ''; $department = Department::firstOrCreate([ diff --git a/app/Models/Ldap.php b/app/Models/Ldap.php index 4c47147625..a29581bf97 100644 --- a/app/Models/Ldap.php +++ b/app/Models/Ldap.php @@ -217,16 +217,16 @@ class Ldap extends Model $ldap_result_manager = Setting::getSettings()->ldap_manager; // Get LDAP user data $item = []; - $item['username'] = isset($ldapattributes[$ldap_result_username][0]) ? $ldapattributes[$ldap_result_username][0] : ''; - $item['employee_number'] = isset($ldapattributes[$ldap_result_emp_num][0]) ? $ldapattributes[$ldap_result_emp_num][0] : ''; - $item['lastname'] = isset($ldapattributes[$ldap_result_last_name][0]) ? $ldapattributes[$ldap_result_last_name][0] : ''; - $item['firstname'] = isset($ldapattributes[$ldap_result_first_name][0]) ? $ldapattributes[$ldap_result_first_name][0] : ''; - $item['email'] = isset($ldapattributes[$ldap_result_email][0]) ? $ldapattributes[$ldap_result_email][0] : ''; - $item['telephone'] = isset($ldapattributes[$ldap_result_phone][0]) ? $ldapattributes[$ldap_result_phone][0] : ''; - $item['jobtitle'] = isset($ldapattributes[$ldap_result_jobtitle][0]) ? $ldapattributes[$ldap_result_jobtitle][0] : ''; - $item['country'] = isset($ldapattributes[$ldap_result_country][0]) ? $ldapattributes[$ldap_result_country][0] : ''; - $item['department'] = isset($ldapattributes[$ldap_result_dept][0]) ? $ldapattributes[$ldap_result_dept][0] : ''; - $item['manager'] = isset($ldapattributes[$ldap_result_manager][0]) ? $ldapattributes[$ldap_result_manager][0] : ''; + $item['username'] = $ldapattributes[$ldap_result_username][0] ?? ''; + $item['employee_number'] = $ldapattributes[$ldap_result_emp_num][0] ?? ''; + $item['lastname'] = $ldapattributes[$ldap_result_last_name][0] ?? ''; + $item['firstname'] = $ldapattributes[$ldap_result_first_name][0] ?? ''; + $item['email'] = $ldapattributes[$ldap_result_email][0] ?? ''; + $item['telephone'] = $ldapattributes[$ldap_result_phone][0] ?? ''; + $item['jobtitle'] = $ldapattributes[$ldap_result_jobtitle][0] ?? ''; + $item['country'] = $ldapattributes[$ldap_result_country][0] ?? ''; + $item['department'] = $ldapattributes[$ldap_result_dept][0] ?? ''; + $item['manager'] = $ldapattributes[$ldap_result_manager][0] ?? ''; return $item; } diff --git a/app/Models/Traits/Searchable.php b/app/Models/Traits/Searchable.php index db46e305df..a7feb62957 100644 --- a/app/Models/Traits/Searchable.php +++ b/app/Models/Traits/Searchable.php @@ -164,7 +164,7 @@ trait Searchable } // I put this here because I only want to add the concat one time in the end of the user relation search if($relation == 'user') { - $query->orWhereRaw('CONCAT (users.first_name, " ", users.last_name) LIKE ?', ["%$term%"]); + $query->orWhereRaw('CONCAT (users.first_name, " ", users.last_name) LIKE ?', ["%{$term}%"]); } }); } @@ -195,7 +195,7 @@ trait Searchable */ private function getSearchableAttributes() { - return isset($this->searchableAttributes) ? $this->searchableAttributes : []; + return $this->searchableAttributes ?? []; } /** @@ -205,7 +205,7 @@ trait Searchable */ private function getSearchableRelations() { - return isset($this->searchableRelations) ? $this->searchableRelations : []; + return $this->searchableRelations ?? []; } /** From c8c5dddcc12ac43ab7b8f7d55f3c434273624971 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:43:19 -0800 Subject: [PATCH 0148/1270] Removed unused else condition Signed-off-by: snipe --- app/Http/Controllers/ReportsController.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index 6cf2091f60..8e29498606 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -1120,8 +1120,6 @@ class ReportsController extends Controller $row[] = str_replace(',', '', e($item['assetItem']->asset_tag)); $row[] = str_replace(',', '', e(($item['acceptance']->assignedTo) ? $item['acceptance']->assignedTo->present()->name() : trans('admin/reports/general.deleted_user'))); $rows[] = implode(',', $row); - } else { - // Log the error maybe? } } From 7363d4e2234176f7a05db42f318a6be1a1a7f033 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:43:35 -0800 Subject: [PATCH 0149/1270] FIxed yoda operator Signed-off-by: snipe --- app/Http/Controllers/SettingsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 9a7c2cc7d5..d8f7ee3b64 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -807,7 +807,7 @@ class SettingsController extends Controller */ public function getPhpInfo() { - if (true === config('app.debug')) { + if (config('app.debug') === true) { return view('settings.phpinfo'); } From d52d32fed9b1b479593d59991e5b7266b128d15e Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:44:02 -0800 Subject: [PATCH 0150/1270] Fixed visibility for constants and methods Signed-off-by: snipe --- app/Http/Controllers/ModalController.php | 2 +- app/Http/Middleware/CheckForTwoFactor.php | 2 +- app/Models/Asset.php | 6 +++--- app/Models/CustomField.php | 2 +- app/Models/Setting.php | 2 +- app/Models/User.php | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/ModalController.php b/app/Http/Controllers/ModalController.php index 385877a3ec..6f6b39dd12 100644 --- a/app/Http/Controllers/ModalController.php +++ b/app/Http/Controllers/ModalController.php @@ -17,7 +17,7 @@ class ModalController extends Controller * @author [A. Gianotto] [ '', 'CUSTOM REGEX' => '', 'ALPHA' => 'alpha', diff --git a/app/Models/Setting.php b/app/Models/Setting.php index f2a4184178..8f1f652017 100755 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -31,7 +31,7 @@ class Setting extends Model * * @var string */ - const SETUP_CHECK_KEY = 'snipeit_setup_check'; + public const SETUP_CHECK_KEY = 'snipeit_setup_check'; /** * Whether the model should inject it's identifier to the unique diff --git a/app/Models/User.php b/app/Models/User.php index 34c0af6b2e..71025eaefe 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -657,7 +657,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo { $query = $query->where('first_name', 'LIKE', '%'.$search.'%') ->orWhere('last_name', 'LIKE', '%'.$search.'%') - ->orWhereRaw('CONCAT('.DB::getTablePrefix().'users.first_name," ",'.DB::getTablePrefix().'users.last_name) LIKE ?', ["%$search%"]); + ->orWhereRaw('CONCAT('.DB::getTablePrefix().'users.first_name," ",'.DB::getTablePrefix().'users.last_name) LIKE ?', ["%{$search}%"]); return $query; } @@ -673,7 +673,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo public function advancedTextSearch(Builder $query, array $terms) { foreach($terms as $term) { - $query = $query->orWhereRaw('CONCAT('.DB::getTablePrefix().'users.first_name," ",'.DB::getTablePrefix().'users.last_name) LIKE ?', ["%$term%"]); + $query = $query->orWhereRaw('CONCAT('.DB::getTablePrefix().'users.first_name," ",'.DB::getTablePrefix().'users.last_name) LIKE ?', ["%{$term}%"]); } return $query; From cd5546e4a1b7fc6330ef3c1f010560e527927f7f Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:44:17 -0800 Subject: [PATCH 0151/1270] Fixed wonky switch statement indenting Signed-off-by: snipe --- app/Http/Requests/SaveUserRequest.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/Http/Requests/SaveUserRequest.php b/app/Http/Requests/SaveUserRequest.php index b6e44c3f44..98e561549e 100644 --- a/app/Http/Requests/SaveUserRequest.php +++ b/app/Http/Requests/SaveUserRequest.php @@ -39,14 +39,12 @@ class SaveUserRequest extends FormRequest // Brand new user case 'POST': - { $rules['first_name'] = 'required|string|min:1'; $rules['username'] = 'required_unless:ldap_import,1|string|min:1'; if ($this->request->get('ldap_import') == false) { $rules['password'] = Setting::passwordComplexityRulesSaving('store').'|confirmed'; } break; - } // Save all fields case 'PUT': @@ -57,12 +55,11 @@ class SaveUserRequest extends FormRequest // Save only what's passed case 'PATCH': - { $rules['password'] = Setting::passwordComplexityRulesSaving('update'); break; - } - default:break; + default: + break; } return $rules; From c03079944a9bc997ca19e83eb4f991624c5ea9b0 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 6 Feb 2023 16:06:13 -0800 Subject: [PATCH 0152/1270] Be more explicit in test case --- tests/Feature/Api/Users/UsersForSelectListTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Feature/Api/Users/UsersForSelectListTest.php b/tests/Feature/Api/Users/UsersForSelectListTest.php index 960cf4e09d..558f362646 100644 --- a/tests/Feature/Api/Users/UsersForSelectListTest.php +++ b/tests/Feature/Api/Users/UsersForSelectListTest.php @@ -52,12 +52,12 @@ class UsersForSelectListTest extends TestCase $results = collect($response->json('results')); - $this->assertEquals($jedi->users->count(), $results->count()); + $this->assertEquals(3, $results->count()); $this->assertTrue( - $results->pluck('text')->contains(fn($text) => str_contains($text, $jedi->users->first()->first_name)) + $results->pluck('text')->contains(fn($text) => str_contains($text, 'Luke')) ); $this->assertFalse( - $results->pluck('text')->contains(fn($text) => str_contains($text, $sith->users->first()->first_name)) + $results->pluck('text')->contains(fn($text) => str_contains($text, 'Darth')) ); } From ddabe7cc9f0328126237612f89685d2a0d9681b3 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Tue, 7 Feb 2023 01:36:55 -0600 Subject: [PATCH 0153/1270] Added Guard Clause to License Importer to return if no empty seat is found --- app/Importer/LicenseImporter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Importer/LicenseImporter.php b/app/Importer/LicenseImporter.php index 894c50bbfa..3bfbf1ee26 100644 --- a/app/Importer/LicenseImporter.php +++ b/app/Importer/LicenseImporter.php @@ -80,6 +80,11 @@ class LicenseImporter extends ItemImporter $checkout_target = $this->item['checkout_target']; $asset = Asset::where('asset_tag', $asset_tag)->first(); $targetLicense = $license->freeSeat(); + + if (is_null($targetLicense)){ + return; + } + if ($checkout_target) { $targetLicense->assigned_to = $checkout_target->id; $targetLicense->user_id = Auth::id(); From d4c838a9797527948636867f171ad5e0329edea6 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Tue, 7 Feb 2023 11:26:49 -0600 Subject: [PATCH 0154/1270] Add condition in activity report to only access assigned item id if it exist --- app/Http/Transformers/ActionlogsTransformer.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index c58760d4de..cd2ce586d1 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -60,12 +60,14 @@ class ActionlogsTransformer if ($actionlog->action_type == 'accepted') { $file_url = route('log.storedeula.download', ['filename' => $actionlog->filename]); } else { - if ($actionlog->itemType() == 'asset') { - $file_url = route('show/assetfile', ['assetId' => $actionlog->item->id, 'fileId' => $actionlog->id]); - } elseif ($actionlog->itemType() == 'license') { - $file_url = route('show.licensefile', ['licenseId' => $actionlog->item->id, 'fileId' => $actionlog->id]); - } elseif ($actionlog->itemType() == 'user') { - $file_url = route('show/userfile', ['userId' => $actionlog->item->id, 'fileId' => $actionlog->id]); + if ($actionlog->item) { + if ($actionlog->itemType() == 'asset') { + $file_url = route('show/assetfile', ['assetId' => $actionlog->item->id, 'fileId' => $actionlog->id]); + } elseif ($actionlog->itemType() == 'license') { + $file_url = route('show.licensefile', ['licenseId' => $actionlog->item->id, 'fileId' => $actionlog->id]); + } elseif ($actionlog->itemType() == 'user') { + $file_url = route('show/userfile', ['userId' => $actionlog->item->id, 'fileId' => $actionlog->id]); + } } } } From 219d92dcfbc32188d2ea97a74a7dce28db462174 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 7 Feb 2023 11:00:30 -0800 Subject: [PATCH 0155/1270] The sea, Brady. Signed-off-by: snipe --- app/Console/Commands/LdapSync.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index 13a1ee2d3f..975db4f5d7 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -74,7 +74,7 @@ class LdapSync extends Command $json_summary = ['error' => true, 'error_message' => $e->getMessage(), 'summary' => []]; $this->info(json_encode($json_summary)); } - LOG::info($e); + Log::info($e); return []; } @@ -84,7 +84,7 @@ class LdapSync extends Command try { if ($this->option('base_dn') != '') { $search_base = $this->option('base_dn'); - LOG::debug('Importing users from specified base DN: \"'.$search_base.'\".'); + Log::debug('Importing users from specified base DN: \"'.$search_base.'\".'); } else { $search_base = null; } @@ -98,7 +98,7 @@ class LdapSync extends Command $json_summary = ['error' => true, 'error_message' => $e->getMessage(), 'summary' => []]; $this->info(json_encode($json_summary)); } - LOG::info($e); + Log::info($e); return []; } @@ -108,16 +108,16 @@ class LdapSync extends Command if ($this->option('location') != '') { $location = Location::where('name', '=', $this->option('location'))->first(); - LOG::debug('Location name '.$this->option('location').' passed'); - LOG::debug('Importing to '.$location->name.' ('.$location->id.')'); + Log::debug('Location name '.$this->option('location').' passed'); + Log::debug('Importing to '.$location->name.' ('.$location->id.')'); } elseif ($this->option('location_id') != '') { $location = Location::where('id', '=', $this->option('location_id'))->first(); - LOG::debug('Location ID '.$this->option('location_id').' passed'); - LOG::debug('Importing to '.$location->name.' ('.$location->id.')'); + Log::debug('Location ID '.$this->option('location_id').' passed'); + Log::debug('Importing to '.$location->name.' ('.$location->id.')'); } if (! isset($location)) { - LOG::debug('That location is invalid or a location was not provided, so no location will be assigned by default.'); + Log::debug('That location is invalid or a location was not provided, so no location will be assigned by default.'); } /* Process locations with explicitly defined OUs, if doing a full import. */ @@ -133,7 +133,7 @@ class LdapSync extends Command array_multisort($ldap_ou_lengths, SORT_ASC, $ldap_ou_locations); if (count($ldap_ou_locations) > 0) { - LOG::debug('Some locations have special OUs set. Locations will be automatically set for users in those OUs.'); + Log::debug('Some locations have special OUs set. Locations will be automatically set for users in those OUs.'); } // Inject location information fields @@ -151,7 +151,7 @@ class LdapSync extends Command $json_summary = ['error' => true, 'error_message' => trans('admin/users/message.error.ldap_could_not_search').' Location: '.$ldap_loc['name'].' (ID: '.$ldap_loc['id'].') cannot connect to "'.$ldap_loc['ldap_ou'].'" - '.$e->getMessage(), 'summary' => []]; $this->info(json_encode($json_summary)); } - LOG::info($e); + Log::info($e); return []; } From 32be88d796fa3404293e0c08c99369486e3ccd32 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 7 Feb 2023 11:00:59 -0800 Subject: [PATCH 0156/1270] Psalm and phpstan configs Signed-off-by: snipe --- phpstan.neon | 22 ++++++++++++++++++++++ psalm.xml | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 phpstan.neon create mode 100644 psalm.xml diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000000..12cdbff72a --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,22 @@ +parameters: + paths: + - app + - resources/views + - resources/lang + - database/migrations + - config + + level: 4 + + ignoreErrors: + - '#Class, interface or enum named #' + - '#Call to an undefined static method App\\Models\\.*::where.*\(\)#' + - '#Call to an undefined static method App\\Models\\.*::firstOr.*\(\)#' + - '#Call to an undefined static method App\\Models\\.*::find.*\(\)#' + - '#Call to an undefined static method App\\Models\\.*::get.*\(\)#' + - '#Call to an undefined static method App\\Models\\.*::has.*\(\)#' + - '#Call to static method info\(\) on an unknown class Log#' + - '#Call to static method debug\(\) on an unknown class Log#' + - '#Call to static method getSchemaBuilder\(\) on an unknown class DB#' + - '#Call to static method call\(\) on an unknown class Artisan.#' + diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000000..4c8b877262 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + From f4617d8d5b12a968e1711d347760693c1e0f40cb Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 7 Feb 2023 11:01:21 -0800 Subject: [PATCH 0157/1270] Added larastan and psalm to composer dev Signed-off-by: snipe --- composer.json | 4 +- composer.lock | 1339 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 1341 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f682ded9f5..4e71debc65 100644 --- a/composer.json +++ b/composer.json @@ -75,12 +75,14 @@ "fakerphp/faker": "^1.16", "laravel/dusk": "^6.25", "mockery/mockery": "^1.4", + "nunomaduro/larastan": "^1.0", "nunomaduro/phpinsights": "^2.7", "phpunit/php-token-stream": "^3.1", "phpunit/phpunit": "^9.0", "squizlabs/php_codesniffer": "^3.5", "symfony/css-selector": "^4.4", - "symfony/dom-crawler": "^4.4" + "symfony/dom-crawler": "^4.4", + "vimeo/psalm": "^5.6" }, "extra": { "laravel": { diff --git a/composer.lock b/composer.lock index 41757eb21a..b9022ba84f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "03d904cb0c9cd4da1c3c0571bb15dae9", + "content-hash": "9bd2bbbd4b08d23336364da3d3a4561a", "packages": [ { "name": "alek13/slack", @@ -11727,6 +11727,500 @@ } ], "packages-dev": [ + { + "name": "amphp/amp", + "version": "v2.6.2", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^7 | ^8 | ^9", + "psalm/phar": "^3.11@dev", + "react/promise": "^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "files": [ + "lib/functions.php", + "lib/Internal/functions.php" + ], + "psr-4": { + "Amp\\": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "https://amphp.org/amp", + "keywords": [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/amp/issues", + "source": "https://github.com/amphp/amp/tree/v2.6.2" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2022-02-20T17:52:18+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "v1.8.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.4", + "friendsofphp/php-cs-fixer": "^2.3", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6 || ^7 || ^8", + "psalm/phar": "^3.11.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "files": [ + "lib/functions.php" + ], + "psr-4": { + "Amp\\ByteStream\\": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "http://amphp.org/byte-stream", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/byte-stream/issues", + "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2021-03-30T17:13:30+00:00" + }, + { + "name": "composer/ca-bundle", + "version": "1.3.5", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.3.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-01-11T08:27:00+00:00" + }, + { + "name": "composer/composer", + "version": "2.3.10", + "source": { + "type": "git", + "url": "https://github.com/composer/composer.git", + "reference": "ebac357c0a41359f3981098729042ed6dedc97ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/composer/zipball/ebac357c0a41359f3981098729042ed6dedc97ba", + "reference": "ebac357c0a41359f3981098729042ed6dedc97ba", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "composer/metadata-minifier": "^1.0", + "composer/pcre": "^2 || ^3", + "composer/semver": "^3.0", + "composer/spdx-licenses": "^1.2", + "composer/xdebug-handler": "^2.0.2 || ^3.0.3", + "justinrainbow/json-schema": "^5.2.11", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "react/promise": "^2.8", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.2", + "symfony/console": "^5.4.7 || ^6.0.7", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/polyfill-php73": "^1.24", + "symfony/polyfill-php80": "^1.24", + "symfony/process": "^5.4 || ^6.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4.1", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-strict-rules": "^1", + "phpstan/phpstan-symfony": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" + }, + "bin": [ + "bin/composer" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.3-dev" + }, + "phpstan": { + "includes": [ + "phpstan/rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Composer\\": "src/Composer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "https://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", + "homepage": "https://getcomposer.org/", + "keywords": [ + "autoload", + "dependency", + "package" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/composer/issues", + "source": "https://github.com/composer/composer/tree/2.3.10" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-07-13T13:48:23+00:00" + }, + { + "name": "composer/metadata-minifier", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/metadata-minifier.git", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "composer/composer": "^2", + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\MetadataMinifier\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Small utility library that handles metadata minification and expansion.", + "keywords": [ + "composer", + "compression" + ], + "support": { + "issues": "https://github.com/composer/metadata-minifier/issues", + "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-04-07T13:37:33+00:00" + }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.5", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-17T14:14:24+00:00" + }, { "name": "composer/pcre", "version": "3.1.0", @@ -11879,6 +12373,86 @@ ], "time": "2022-04-01T19:23:25+00:00" }, + { + "name": "composer/spdx-licenses", + "version": "1.5.7", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "c848241796da2abf65837d51dce1fae55a960149" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/c848241796da2abf65837d51dce1fae55a960149", + "reference": "c848241796da2abf65837d51dce1fae55a960149", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/spdx-licenses/issues", + "source": "https://github.com/composer/spdx-licenses/tree/1.5.7" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-05-23T07:37:50+00:00" + }, { "name": "composer/xdebug-handler", "version": "3.0.3", @@ -12023,6 +12597,43 @@ }, "time": "2023-01-05T11:28:13+00:00" }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php", + "support": { + "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", + "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" + }, + "time": "2019-12-04T15:06:13+00:00" + }, { "name": "fakerphp/faker", "version": "v1.20.0", @@ -12090,6 +12701,168 @@ }, "time": "2022-07-20T13:12:54+00:00" }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "php": "^7.1 || ^8.0", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "support": { + "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", + "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" + }, + "time": "2021-06-11T22:34:44+00:00" + }, + { + "name": "felixfbecker/language-server-protocol", + "version": "v1.5.2", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", + "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpstan/phpstan": "*", + "squizlabs/php_codesniffer": "^3.1", + "vimeo/psalm": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "LanguageServerProtocol\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], + "support": { + "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" + }, + "time": "2022-03-02T22:36:06+00:00" + }, + { + "name": "fidry/cpu-core-counter", + "version": "0.4.1", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/79261cc280aded96d098e1b0e0ba0c4881b432c2", + "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^9.5.26 || ^8.5.31", + "theofidry/php-cs-fixer-config": "^1.0", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/0.4.1" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2022-12-16T22:01:02+00:00" + }, { "name": "friendsofphp/php-cs-fixer", "version": "v3.13.2", @@ -12586,6 +13359,155 @@ ], "time": "2022-03-03T13:19:32+00:00" }, + { + "name": "netresearch/jsonmapper", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", + "squizlabs/php_codesniffer": "~3.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "support": { + "email": "cweiske@cweiske.de", + "issues": "https://github.com/cweiske/jsonmapper/issues", + "source": "https://github.com/cweiske/jsonmapper/tree/v4.1.0" + }, + "time": "2022-12-08T20:46:14+00:00" + }, + { + "name": "nunomaduro/larastan", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/larastan.git", + "reference": "769bc6346a6cce3b823c30eaace33d9c3a0dd40e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/769bc6346a6cce3b823c30eaace33d9c3a0dd40e", + "reference": "769bc6346a6cce3b823c30eaace33d9c3a0dd40e", + "shasum": "" + }, + "require": { + "composer/composer": "^1.0 || ^2.0", + "ext-json": "*", + "illuminate/console": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/container": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/contracts": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/database": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/http": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/pipeline": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "mockery/mockery": "^0.9 || ^1.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.0 <1.9", + "symfony/process": "^4.3 || ^5.0 || ^6.0" + }, + "require-dev": { + "nikic/php-parser": "^4.13.0", + "orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0", + "phpunit/phpunit": "^7.3 || ^8.2 || ^9.3" + }, + "suggest": { + "orchestra/testbench": "Using Larastan for analysing a package needs Testbench" + }, + "type": "phpstan-extension", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "NunoMaduro\\Larastan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan wrapper for Laravel", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "larastan", + "laravel", + "package", + "php", + "static analysis" + ], + "support": { + "issues": "https://github.com/nunomaduro/larastan/issues", + "source": "https://github.com/nunomaduro/larastan/tree/1.0.4" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/canvural", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2022-11-09T09:09:31+00:00" + }, { "name": "nunomaduro/phpinsights", "version": "v2.7.0", @@ -13031,6 +13953,65 @@ }, "time": "2022-12-20T20:56:55+00:00" }, + { + "name": "phpstan/phpstan", + "version": "1.8.11", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "46e223dd68a620da18855c23046ddb00940b4014" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/46e223dd68a620da18855c23046ddb00940b4014", + "reference": "46e223dd68a620da18855c23046ddb00940b4014", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/1.8.11" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2022-10-24T15:45:13+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.15", @@ -13511,6 +14492,82 @@ ], "time": "2022-06-19T12:14:25+00:00" }, + { + "name": "react/promise", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-02-11T10:27:51+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.1", @@ -14195,6 +15252,118 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "seld/jsonlint", + "version": "1.9.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "4211420d25eba80712bff236a98960ef68b866b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7", + "reference": "4211420d25eba80712bff236a98960ef68b866b7", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.5", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], + "time": "2022-04-01T13:37:23+00:00" + }, + { + "name": "seld/phar-utils", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/phar-utils.git", + "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", + "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\PharUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "PHAR file format utilities, for when PHP phars you up", + "keywords": [ + "phar" + ], + "support": { + "issues": "https://github.com/Seldaek/phar-utils/issues", + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" + }, + "time": "2022-08-31T10:31:18+00:00" + }, { "name": "slevomat/coding-standard", "version": "8.8.0", @@ -14260,6 +15429,70 @@ ], "time": "2023-01-09T10:46:13+00:00" }, + { + "name": "spatie/array-to-xml", + "version": "2.17.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/array-to-xml.git", + "reference": "5cbec9c6ab17e320c58a259f0cebe88bde4a7c46" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/5cbec9c6ab17e320c58a259f0cebe88bde4a7c46", + "reference": "5cbec9c6ab17e320c58a259f0cebe88bde4a7c46", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": "^7.4|^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.2", + "pestphp/pest": "^1.21", + "phpunit/phpunit": "^9.0", + "spatie/pest-plugin-snapshots": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\ArrayToXml\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://freek.dev", + "role": "Developer" + } + ], + "description": "Convert an array to xml", + "homepage": "https://github.com/spatie/array-to-xml", + "keywords": [ + "array", + "convert", + "xml" + ], + "support": { + "source": "https://github.com/spatie/array-to-xml/tree/2.17.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-12-26T08:22:07+00:00" + }, { "name": "symfony/cache", "version": "v5.4.19", @@ -14985,6 +16218,110 @@ } ], "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "vimeo/psalm", + "version": "5.6.0", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "e784128902dfe01d489c4123d69918a9f3c1eac5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/e784128902dfe01d489c4123d69918a9f3c1eac5", + "reference": "e784128902dfe01d489c4123d69918a9f3c1eac5", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.4.2", + "amphp/byte-stream": "^1.5", + "composer/package-versions-deprecated": "^1.10.0", + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^2.0 || ^3.0", + "dnoegel/php-xdg-base-dir": "^0.1.1", + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "felixfbecker/advanced-json-rpc": "^3.1", + "felixfbecker/language-server-protocol": "^1.5.2", + "fidry/cpu-core-counter": "^0.4.0", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "nikic/php-parser": "^4.13", + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "sebastian/diff": "^4.0 || ^5.0", + "spatie/array-to-xml": "^2.17.0", + "symfony/console": "^4.1.6 || ^5.0 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0" + }, + "provide": { + "psalm/psalm": "self.version" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4", + "brianium/paratest": "^6.0", + "ext-curl": "*", + "mockery/mockery": "^1.5", + "nunomaduro/mock-final-classes": "^1.1", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpdoc-parser": "^1.6", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.6", + "symfony/process": "^4.4 || ^5.0 || ^6.0" + }, + "suggest": { + "ext-curl": "In order to send data to shepherd", + "ext-igbinary": "^2.0.5 is required, used to serialize caching data" + }, + "bin": [ + "psalm", + "psalm-language-server", + "psalm-plugin", + "psalm-refactor", + "psalter" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev", + "dev-4.x": "4.x-dev", + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psalm\\": "src/Psalm/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Brown" + } + ], + "description": "A static analysis tool for finding errors in PHP applications", + "keywords": [ + "code", + "inspection", + "php" + ], + "support": { + "issues": "https://github.com/vimeo/psalm/issues", + "source": "https://github.com/vimeo/psalm/tree/5.6.0" + }, + "time": "2023-01-23T20:32:47+00:00" } ], "aliases": [], From dd5f256450ee5c22a088dcba678bfc1e917b195d Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 7 Feb 2023 11:02:02 -0800 Subject: [PATCH 0158/1270] =?UTF-8?q?We=20shouldn=E2=80=99t=20need=20this?= =?UTF-8?q?=20because=20aliases=3F=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- app/Http/Transformers/AssetModelsTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Transformers/AssetModelsTransformer.php b/app/Http/Transformers/AssetModelsTransformer.php index d694ac5b49..5725e55930 100644 --- a/app/Http/Transformers/AssetModelsTransformer.php +++ b/app/Http/Transformers/AssetModelsTransformer.php @@ -4,7 +4,7 @@ namespace App\Http\Transformers; use App\Helpers\Helper; use App\Models\AssetModel; -use Gate; +use Illuminate\Support\Facades\Gate; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\Storage; From ea644f8d47b2ef0bc174652557bc3758745b8980 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 7 Feb 2023 11:02:20 -0800 Subject: [PATCH 0159/1270] Still throwing errors, but trying to fix the docblock Signed-off-by: snipe --- app/Console/Commands/CreateAdmin.php | 29 +++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/app/Console/Commands/CreateAdmin.php b/app/Console/Commands/CreateAdmin.php index a4b4b9e42c..5aebde3777 100644 --- a/app/Console/Commands/CreateAdmin.php +++ b/app/Console/Commands/CreateAdmin.php @@ -3,14 +3,29 @@ namespace App\Console\Commands; use Illuminate\Console\Command; +use \App\Models\User; + class CreateAdmin extends Command { + + /** @mixin User **/ /** - * The name and signature of the console command. - * - * @var string + * App\Console\CreateAdmin + * @property mixed $first_name + * @property string $last_name + * @property string $username + * @property string $email + * @property string $permissions + * @property string $password + * @property boolean $activated + * @property boolean $show_in_list + * @property \Illuminate\Support\Carbon|null $created_at + * @property mixed $created_by */ + + + protected $signature = 'snipeit:create-admin {--first_name=} {--last_name=} {--email=} {--username=} {--password=} {show_in_list?}'; /** @@ -30,11 +45,7 @@ class CreateAdmin extends Command parent::__construct(); } - /** - * Execute the console command. - * - * @return mixed - */ + public function handle() { $first_name = $this->option('first_name'); @@ -47,7 +58,7 @@ class CreateAdmin extends Command if (($first_name == '') || ($last_name == '') || ($username == '') || ($email == '') || ($password == '')) { $this->info('ERROR: All fields are required.'); } else { - $user = new \App\Models\User; + $user = new User; $user->first_name = $first_name; $user->last_name = $last_name; $user->username = $username; From efac2259db667771aee7b6672e721a4d713c6ca8 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 7 Feb 2023 12:25:13 -0800 Subject: [PATCH 0160/1270] Include Larastan configuration file --- phpstan.neon | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpstan.neon b/phpstan.neon index 12cdbff72a..951c00ff30 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,3 +1,6 @@ +includes: + - ./vendor/nunomaduro/larastan/extension.neon + parameters: paths: - app From e4cf59c0344a56bdae5d4476af3114d705c2829b Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 7 Feb 2023 12:46:13 -0800 Subject: [PATCH 0161/1270] Sort paths --- phpstan.neon | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 951c00ff30..9720523dac 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,10 +4,11 @@ includes: parameters: paths: - app - - resources/views - - resources/lang - - database/migrations - config + - database/migrations + - resources/lang + - resources/views + level: 4 From fd524c5f14f3fdd202a7d3ad2cba5b383b751c49 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 7 Feb 2023 12:48:41 -0800 Subject: [PATCH 0162/1270] Remove ignore errors section covered by larastan config --- phpstan.neon | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 9720523dac..d5edda6884 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -9,18 +9,4 @@ parameters: - resources/lang - resources/views - level: 4 - - ignoreErrors: - - '#Class, interface or enum named #' - - '#Call to an undefined static method App\\Models\\.*::where.*\(\)#' - - '#Call to an undefined static method App\\Models\\.*::firstOr.*\(\)#' - - '#Call to an undefined static method App\\Models\\.*::find.*\(\)#' - - '#Call to an undefined static method App\\Models\\.*::get.*\(\)#' - - '#Call to an undefined static method App\\Models\\.*::has.*\(\)#' - - '#Call to static method info\(\) on an unknown class Log#' - - '#Call to static method debug\(\) on an unknown class Log#' - - '#Call to static method getSchemaBuilder\(\) on an unknown class DB#' - - '#Call to static method call\(\) on an unknown class Artisan.#' - From c1d484b5df0b08598ffd50b4fe94f81a269471cb Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 7 Feb 2023 13:31:50 -0800 Subject: [PATCH 0163/1270] Fixed mismatched field/fieldset Signed-off-by: snipe --- app/Http/Controllers/CustomFieldsetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/CustomFieldsetsController.php b/app/Http/Controllers/CustomFieldsetsController.php index 8128b3369f..8c14502285 100644 --- a/app/Http/Controllers/CustomFieldsetsController.php +++ b/app/Http/Controllers/CustomFieldsetsController.php @@ -169,7 +169,7 @@ class CustomFieldsetsController extends Controller */ public function destroy($id) { - $fieldset = CustomField::find($id); + $fieldset = CustomFieldset::find($id); $this->authorize('delete', $fieldset); From 321a34a9d3b5fb19505d7aec197e10fbcf60e1fa Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 7 Feb 2023 13:32:32 -0800 Subject: [PATCH 0164/1270] Make phpstan configuration more flexible --- .gitignore | 1 + phpstan.neon => phpstan.neon.dist | 0 phpstan.neon.example | 8 ++++++++ 3 files changed, 9 insertions(+) rename phpstan.neon => phpstan.neon.dist (100%) create mode 100644 phpstan.neon.example diff --git a/.gitignore b/.gitignore index 078a7e4b8a..e49e69c9ae 100755 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .env .env.dusk.* !.env.dusk.example +phpstan.neon .idea /bin/ /bootstrap/compiled.php diff --git a/phpstan.neon b/phpstan.neon.dist similarity index 100% rename from phpstan.neon rename to phpstan.neon.dist diff --git a/phpstan.neon.example b/phpstan.neon.example new file mode 100644 index 0000000000..a9bc1a30de --- /dev/null +++ b/phpstan.neon.example @@ -0,0 +1,8 @@ +# Copy this file to "phpstan.neon" and update the parameters section as needed + +includes: + - phpstan.neon.dist + +parameters: + # https://phpstan.org/user-guide/output-format#opening-file-in-an-editor + editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%' From c0074baa266ae0bb15d81e7b9dc62757eef8200d Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 7 Feb 2023 17:27:39 -0500 Subject: [PATCH 0165/1270] functionality to Apple Warranty link --- resources/views/hardware/view.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index b4cd6d4988..d8adad00d8 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -595,10 +595,12 @@ {{ $asset->warranty_months }} {{ trans('admin/hardware/form.months') }} - @if (($asset->serial && $asset->model->manufacturer) && $asset->model->manufacturer->name == 'Apple') + @if ($asset->serial) + @if ((strtolower($asset->model->manufacturer->name) == "apple") || (str_starts_with(str_replace(' ','',strtolower($asset->model->manufacturer->name)),"appleinc"))) + @endif @endif

From 75f3cb30790d6140cbd8a8fb34b6193134849d16 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 7 Feb 2023 19:02:12 -0500 Subject: [PATCH 0166/1270] fixing external if statement --- resources/views/hardware/view.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index d8adad00d8..933392d8e9 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -595,7 +595,7 @@ {{ $asset->warranty_months }} {{ trans('admin/hardware/form.months') }} - @if ($asset->serial) + @if ($asset->serial && $asset->model->manufacturer) @if ((strtolower($asset->model->manufacturer->name) == "apple") || (str_starts_with(str_replace(' ','',strtolower($asset->model->manufacturer->name)),"appleinc"))) From 6dbcec23105380c93fedab1059d7b841d2758311 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 7 Feb 2023 16:16:39 -0800 Subject: [PATCH 0167/1270] Exclude Dusk tests from phpunit test suite --- phpunit.xml | 1 + tests/Unit/ConsumableTest.php | 19 ------------------- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 tests/Unit/ConsumableTest.php diff --git a/phpunit.xml b/phpunit.xml index bf3fd2dc33..9706518ab4 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,6 +8,7 @@ ./tests/ + ./tests/Browser diff --git a/tests/Unit/ConsumableTest.php b/tests/Unit/ConsumableTest.php deleted file mode 100644 index cbe89b13bb..0000000000 --- a/tests/Unit/ConsumableTest.php +++ /dev/null @@ -1,19 +0,0 @@ - Date: Tue, 7 Feb 2023 16:17:05 -0800 Subject: [PATCH 0168/1270] Use factories for relationships in asset factory --- database/factories/AssetFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/factories/AssetFactory.php b/database/factories/AssetFactory.php index 24021921b3..858febe829 100644 --- a/database/factories/AssetFactory.php +++ b/database/factories/AssetFactory.php @@ -38,7 +38,7 @@ class AssetFactory extends Factory { return [ 'name' => null, - 'rtd_location_id' => Location::all()->random()->id, + 'rtd_location_id' => Location::factory(), 'serial' => $this->faker->uuid, 'status_id' => 1, 'user_id' => 1, @@ -47,7 +47,7 @@ class AssetFactory extends Factory 'purchase_date' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()), 'purchase_cost' => $this->faker->randomFloat(2, '299.99', '2999.99'), 'order_number' => $this->faker->numberBetween(1000000, 50000000), - 'supplier_id' => Supplier::all()->random()->id, + 'supplier_id' => Supplier::factory(), 'requestable' => $this->faker->boolean(), 'assigned_to' => null, 'assigned_type' => null, From 6b8c0f9e8838e6ad4c5e834a90e6d26d824c92de Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 7 Feb 2023 16:17:16 -0800 Subject: [PATCH 0169/1270] Make BaseTest abstract --- tests/Unit/BaseTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/BaseTest.php b/tests/Unit/BaseTest.php index 83f1181083..136978be27 100644 --- a/tests/Unit/BaseTest.php +++ b/tests/Unit/BaseTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; use Auth; use Artisan; -class BaseTest extends TestCase +abstract class BaseTest extends TestCase { use DatabaseTransactions; From 505ca48da283eaab368bca067cca839ddef25cda Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 7 Feb 2023 16:17:36 -0800 Subject: [PATCH 0170/1270] Remove test method without assertions --- tests/Unit/CustomFieldTest.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/Unit/CustomFieldTest.php b/tests/Unit/CustomFieldTest.php index 7df281fe1d..f991fda208 100644 --- a/tests/Unit/CustomFieldTest.php +++ b/tests/Unit/CustomFieldTest.php @@ -15,11 +15,6 @@ class CustomFieldTest extends BaseTest { protected $tester; - public function testConstructor() - { - $customfield = new CustomField(); - } - public function testFormat() { $customfield = CustomField::factory()->make(['format' => 'IP']); From 787f619a6b51859ed808a1edb2dd331a2d2a92bc Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 7 Feb 2023 16:28:40 -0800 Subject: [PATCH 0171/1270] Standardize test method syntax --- tests/Unit/AssetMaintenanceTest.php | 20 ++++------------ tests/Unit/AssetTest.php | 5 ---- tests/Unit/SnipeModelTest.php | 37 ++++++----------------------- 3 files changed, 11 insertions(+), 51 deletions(-) diff --git a/tests/Unit/AssetMaintenanceTest.php b/tests/Unit/AssetMaintenanceTest.php index ccae46ed76..ad16679887 100644 --- a/tests/Unit/AssetMaintenanceTest.php +++ b/tests/Unit/AssetMaintenanceTest.php @@ -12,10 +12,7 @@ class AssetMaintenanceTest extends BaseTest */ protected $tester; - /** - * @test - */ - public function it_zeros_out_warranty_if_blank() + public function testZerosOutWarrantyIfBlank() { $c = new AssetMaintenance; $c->is_warranty = ''; @@ -24,10 +21,7 @@ class AssetMaintenanceTest extends BaseTest $this->assertTrue($c->is_warranty == 4); } - /** - * @test - */ - public function it_sets_costs_appropriately() + public function testSetsCostsAppropriately() { $c = new AssetMaintenance(); $c->cost = '0.00'; @@ -38,10 +32,7 @@ class AssetMaintenanceTest extends BaseTest $this->assertTrue($c->cost === 9.5); } - /** - * @test - */ - public function it_nulls_out_notes_if_blank() + public function testNullsOutNotesIfBlank() { $c = new AssetMaintenance; $c->notes = ''; @@ -50,10 +41,7 @@ class AssetMaintenanceTest extends BaseTest $this->assertTrue($c->notes === 'This is a long note'); } - /** - * @test - */ - public function it_nulls_out_completion_date_if_blank_or_invalid() + public function testNullsOutCompletionDateIfBlankOrInvalid() { $c = new AssetMaintenance; $c->completion_date = ''; diff --git a/tests/Unit/AssetTest.php b/tests/Unit/AssetTest.php index 0cc27d80db..e3fa5b4497 100644 --- a/tests/Unit/AssetTest.php +++ b/tests/Unit/AssetTest.php @@ -41,10 +41,6 @@ class AssetTest extends BaseTest // $this->assertEquals($expected, $next); // } - - /** - * @test - */ public function testWarrantyExpiresAttribute() { @@ -66,5 +62,4 @@ class AssetTest extends BaseTest $this->assertEquals(Carbon::createFromDate(2019, 1, 1)->format('Y-m-d'), $asset->warranty_expires->format('Y-m-d')); } - } diff --git a/tests/Unit/SnipeModelTest.php b/tests/Unit/SnipeModelTest.php index 8884ecf6d3..f9dcfe0cb4 100644 --- a/tests/Unit/SnipeModelTest.php +++ b/tests/Unit/SnipeModelTest.php @@ -11,12 +11,7 @@ class SnipeModelTest extends BaseTest */ protected $tester; - // tests - - /** - * @test - */ - public function it_sets_purchase_dates_appropriately() + public function testSetsPurchaseDatesAppropriately() { $c = new SnipeModel; $c->purchase_date = ''; @@ -25,10 +20,7 @@ class SnipeModelTest extends BaseTest $this->assertTrue($c->purchase_date === '2016-03-25 12:35:50'); } - /** - * @test - */ - public function it_sets_purchase_costs_appropriately() + public function testSetsPurchaseCostsAppropriately() { $c = new SnipeModel; $c->purchase_cost = '0.00'; @@ -39,10 +31,7 @@ class SnipeModelTest extends BaseTest $this->assertTrue($c->purchase_cost === 9.5); } - /** - * @test - */ - public function it_nulls_blank_location_ids_but_not_others() + public function testNullsBlankLocationIdsButNotOthers() { $c = new SnipeModel; $c->location_id = ''; @@ -51,10 +40,7 @@ class SnipeModelTest extends BaseTest $this->assertTrue($c->location_id == 5); } - /** - * @test - */ - public function it_nulls_blank_categories_but_not_others() + public function testNullsBlankCategoriesButNotOthers() { $c = new SnipeModel; $c->category_id = ''; @@ -63,10 +49,7 @@ class SnipeModelTest extends BaseTest $this->assertTrue($c->category_id == 1); } - /** - * @test - */ - public function it_nulls_blank_suppliers_but_not_others() + public function testNullsBlankSuppliersButNotOthers() { $c = new SnipeModel; $c->supplier_id = ''; @@ -75,10 +58,7 @@ class SnipeModelTest extends BaseTest $this->assertTrue($c->supplier_id == 4); } - /** - * @test - */ - public function it_nulls_blank_depreciations_but_not_others() + public function testNullsBlankDepreciationsButNotOthers() { $c = new SnipeModel; $c->depreciation_id = ''; @@ -87,10 +67,7 @@ class SnipeModelTest extends BaseTest $this->assertTrue($c->depreciation_id == 4); } - /** - * @test - */ - public function it_nulls_blank_manufacturers_but_not_others() + public function testNullsBlankManufacturersButNotOthers() { $c = new SnipeModel; $c->manufacturer_id = ''; From 49b6a1cc5374f6990b32e78fab13344afe3de4e9 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Tue, 7 Feb 2023 18:29:19 -0600 Subject: [PATCH 0172/1270] Adds translation strings to theinventory report sent to users --- app/Notifications/CurrentInventory.php | 2 +- resources/lang/en/mail.php | 2 ++ resources/views/vendor/notifications/email.blade.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Notifications/CurrentInventory.php b/app/Notifications/CurrentInventory.php index d0161aa165..158955b273 100644 --- a/app/Notifications/CurrentInventory.php +++ b/app/Notifications/CurrentInventory.php @@ -44,7 +44,7 @@ class CurrentInventory extends Notification 'accessories' => $this->user->accessories, 'licenses' => $this->user->licenses, ]) - ->subject('Inventory Report'); + ->subject(trans('mail.inventory_report')); return $message; } diff --git a/resources/lang/en/mail.php b/resources/lang/en/mail.php index b0ae7de76b..6bf36b4ebf 100644 --- a/resources/lang/en/mail.php +++ b/resources/lang/en/mail.php @@ -43,6 +43,7 @@ return [ 'login_first_admin' => 'Login to your new Snipe-IT installation using the credentials below:', 'login' => 'Login:', 'Low_Inventory_Report' => 'Low Inventory Report', + 'inventory_report' => 'Inventory Report', 'min_QTY' => 'Min QTY', 'name' => 'Name', 'new_item_checked' => 'A new item has been checked out under your name, details are below.', @@ -79,4 +80,5 @@ return [ 'Expected_Checkin_Notification' => 'Reminder: :name checkin deadline approaching', 'Expected_Checkin_Date' => 'An asset checked out to you is due to be checked back in on :date', 'your_assets' => 'View Your Assets', + 'rights_reserved' => 'All rights reserved.', ]; diff --git a/resources/views/vendor/notifications/email.blade.php b/resources/views/vendor/notifications/email.blade.php index 0147ef40d7..f25cfcec8c 100644 --- a/resources/views/vendor/notifications/email.blade.php +++ b/resources/views/vendor/notifications/email.blade.php @@ -204,7 +204,7 @@ $style = [

© {{ date('Y') }} {{ $snipeSettings->site_name }}. - All rights reserved. + {{ trans('mail.rights_reserved') }}

@if ($snipeSettings->privacy_policy_link!='') From 4f9ebf6cde33451e918d1b818c70d227ff4a1b59 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 7 Feb 2023 16:40:27 -0800 Subject: [PATCH 0173/1270] Fix array key --- tests/Unit/AccessoryTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/AccessoryTest.php b/tests/Unit/AccessoryTest.php index dafcce663f..57b91b8f06 100644 --- a/tests/Unit/AccessoryTest.php +++ b/tests/Unit/AccessoryTest.php @@ -62,7 +62,7 @@ class AccessoryTest extends BaseTest $accessory = Accessory::factory()->appleBtKeyboard()->create( [ 'category_id' => Category::factory()->create(), - 'category_id' => Manufacturer::factory()->apple()->create() + 'manufacturer_id' => Manufacturer::factory()->apple()->create() ]); $this->assertInstanceOf(Manufacturer::class, $accessory->manufacturer); } From 16fcc6dc444b20c28aab9432f2ba620a69f38978 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 7 Feb 2023 18:40:00 -0800 Subject: [PATCH 0174/1270] Fixed UI bug where download button was missing for non-images Signed-off-by: snipe --- resources/lang/en/general.php | 1 + resources/views/users/view.blade.php | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index a2c7e367d9..e071124a05 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -396,6 +396,7 @@ return [ 'alt_uploaded_image_thumbnail' => 'Uploaded thumbnail', 'placeholder_kit' => 'Select a kit', 'file_not_found' => 'File not found', + 'preview_not_available' => '(no preview)', diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php index 3fb3b9a58c..cd9757854a 100755 --- a/resources/views/users/view.blade.php +++ b/resources/views/users/view.blade.php @@ -868,13 +868,15 @@ - @if ($file->filename) - @if ((Storage::exists('private_uploads/users/'.$file->filename)) && ( Helper::checkUploadIsImage($file->get_src('users')))) + @if (($file->filename) && (Storage::exists('private_uploads/users/'.$file->filename))) + @if (Helper::checkUploadIsImage($file->get_src('users'))) @else - - {{ trans('general.file_not_found') }} + {{ trans('general.preview_not_available') }} @endif + @else + + {{ trans('general.file_not_found') }} @endif @@ -891,7 +893,7 @@ @if ($file->filename) - @if ((Storage::exists('private_uploads/users/'.$file->filename)) && ( Helper::checkUploadIsImage($file->get_src('users')))) + @if (Storage::exists('private_uploads/users/'.$file->filename)) {{ trans('general.download') }} From dea175bd40a8c7bf73af32210b3198dc53bdb4aa Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Wed, 8 Feb 2023 09:57:54 -0600 Subject: [PATCH 0175/1270] Don't auto assign feature requests to Snipe --- .github/ISSUE_TEMPLATE/feature_request.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 8f13e1f1b7..dec3a8fe08 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -2,8 +2,6 @@ name: Feature Request description: Suggest an idea for this project title: "[Feature Request]: " labels: ["feature request"] -assignees: - - snipe body: - type: textarea attributes: From 5962f1b6271713e8157ddea158188cf15d4eb938 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 8 Feb 2023 12:21:51 -0800 Subject: [PATCH 0176/1270] Catch json encoding exceptions and display them to the user --- app/Http/Controllers/Api/ImportController.php | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/ImportController.php b/app/Http/Controllers/Api/ImportController.php index 9742cc1644..15f46f2df8 100644 --- a/app/Http/Controllers/Api/ImportController.php +++ b/app/Http/Controllers/Api/ImportController.php @@ -10,6 +10,7 @@ use App\Models\Asset; use App\Models\Company; use App\Models\Import; use Artisan; +use Illuminate\Database\Eloquent\JsonEncodingException; use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Storage; @@ -64,7 +65,18 @@ class ImportController extends Controller ini_set('auto_detect_line_endings', '1'); } $reader = Reader::createFromFileObject($file->openFile('r')); //file pointer leak? - $import->header_row = $reader->fetchOne(0); + + try { + $import->header_row = $reader->fetchOne(0); + } catch (JsonEncodingException $e) { + return response()->json( + Helper::formatStandardApiResponse( + 'error', + null, + 'One or more attributes in the header row contain malformed UTF-8 characters'), + 500 + ); + } //duplicate headers check $duplicate_headers = []; @@ -85,8 +97,18 @@ class ImportController extends Controller return response()->json(Helper::formatStandardApiResponse('error', null, implode('; ', $duplicate_headers)), 500); //should this be '4xx'? } - // Grab the first row to display via ajax as the user picks fields - $import->first_row = $reader->fetchOne(1); + try { + // Grab the first row to display via ajax as the user picks fields + $import->first_row = $reader->fetchOne(1); + } catch (JsonEncodingException $e) { + return response()->json( + Helper::formatStandardApiResponse( + 'error', + null, + 'One or more attributes in row 2 contain malformed UTF-8 characters'), + 500 + ); + } $date = date('Y-m-d-his'); $fixed_filename = str_slug($file->getClientOriginalName()); From c2c666aef09e995de739919a6a87423961e4a70b Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 8 Feb 2023 12:32:57 -0800 Subject: [PATCH 0177/1270] Formatting --- app/Http/Controllers/Api/ImportController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/ImportController.php b/app/Http/Controllers/Api/ImportController.php index 15f46f2df8..54ebea6ba5 100644 --- a/app/Http/Controllers/Api/ImportController.php +++ b/app/Http/Controllers/Api/ImportController.php @@ -73,7 +73,8 @@ class ImportController extends Controller Helper::formatStandardApiResponse( 'error', null, - 'One or more attributes in the header row contain malformed UTF-8 characters'), + 'One or more attributes in the header row contain malformed UTF-8 characters' + ), 500 ); } @@ -105,7 +106,8 @@ class ImportController extends Controller Helper::formatStandardApiResponse( 'error', null, - 'One or more attributes in row 2 contain malformed UTF-8 characters'), + 'One or more attributes in row 2 contain malformed UTF-8 characters' + ), 500 ); } From b3881a43a7963831677c364828e1e4633ba4aa8d Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 8 Feb 2023 12:34:25 -0800 Subject: [PATCH 0178/1270] Fix return type --- app/Http/Controllers/Api/ImportController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/ImportController.php b/app/Http/Controllers/Api/ImportController.php index 54ebea6ba5..d76decfc53 100644 --- a/app/Http/Controllers/Api/ImportController.php +++ b/app/Http/Controllers/Api/ImportController.php @@ -36,7 +36,7 @@ class ImportController extends Controller * Process and store a CSV upload file. * * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response + * @return \Illuminate\Http\JsonResponse */ public function store() { @@ -132,9 +132,9 @@ class ImportController extends Controller } $results = (new ImportsTransformer)->transformImports($results); - return [ + return response()->json([ 'files' => $results, - ]; + ]); } return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.feature_disabled')), 500); From 73f355f3a8036e4d3d6227656616db44878dadff Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 8 Feb 2023 12:39:42 -0800 Subject: [PATCH 0179/1270] Return 422 instead of 500 when import is invalid --- app/Http/Controllers/Api/ImportController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Api/ImportController.php b/app/Http/Controllers/Api/ImportController.php index d76decfc53..9820b9ca0b 100644 --- a/app/Http/Controllers/Api/ImportController.php +++ b/app/Http/Controllers/Api/ImportController.php @@ -57,7 +57,7 @@ class ImportController extends Controller 'text/tsv', ])) { $results['error'] = 'File type must be CSV. Uploaded file is '.$file->getMimeType(); - return response()->json(Helper::formatStandardApiResponse('error', null, $results['error']), 500); + return response()->json(Helper::formatStandardApiResponse('error', null, $results['error']), 422); } //TODO: is there a lighter way to do this? @@ -75,7 +75,7 @@ class ImportController extends Controller null, 'One or more attributes in the header row contain malformed UTF-8 characters' ), - 500 + 422 ); } @@ -95,7 +95,7 @@ class ImportController extends Controller } } if (count($duplicate_headers) > 0) { - return response()->json(Helper::formatStandardApiResponse('error', null, implode('; ', $duplicate_headers)), 500); //should this be '4xx'? + return response()->json(Helper::formatStandardApiResponse('error', null, implode('; ', $duplicate_headers)),422); } try { @@ -108,7 +108,7 @@ class ImportController extends Controller null, 'One or more attributes in row 2 contain malformed UTF-8 characters' ), - 500 + 422 ); } @@ -137,7 +137,7 @@ class ImportController extends Controller ]); } - return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.feature_disabled')), 500); + return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.feature_disabled')), 422); } /** From 1a651b33fc46fb2a8879b2b867856188189aae10 Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 8 Feb 2023 17:31:39 -0500 Subject: [PATCH 0180/1270] manufacturer marker removal --- resources/views/modals/model.blade.php | 12 ++++++------ resources/views/models/edit.blade.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/views/modals/model.blade.php b/resources/views/modals/model.blade.php index 6fc0359c81..519767f304 100644 --- a/resources/views/modals/model.blade.php +++ b/resources/views/modals/model.blade.php @@ -16,17 +16,17 @@
-
+
- +
-
-
- +
+
+
diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index f7ec2796b6..a643ee2fe2 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -11,8 +11,8 @@ @section('inputFields') @include ('partials.forms.edit.name', ['translated_name' => trans('admin/models/table.name'), 'required' => 'true']) -@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id', 'required' => 'true']) @include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'asset']) +@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id']) @include ('partials.forms.edit.model_number') @include ('partials.forms.edit.depreciation') From 32ed70259e26a7f00b0ebccf35ccdc15b432be10 Mon Sep 17 00:00:00 2001 From: akemidx Date: Thu, 9 Feb 2023 15:39:10 -0500 Subject: [PATCH 0181/1270] sweedish chef fixes up your typos --- resources/views/modals/model.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/modals/model.blade.php b/resources/views/modals/model.blade.php index 519767f304..360d14ce32 100644 --- a/resources/views/modals/model.blade.php +++ b/resources/views/modals/model.blade.php @@ -26,7 +26,7 @@
- +
From 5714824aa77e6a2955f7b5882c24148634960a71 Mon Sep 17 00:00:00 2001 From: akemidx Date: Thu, 9 Feb 2023 17:24:34 -0500 Subject: [PATCH 0182/1270] translations for the layout setup --- resources/lang/en/general.php | 6 ++++++ resources/views/layouts/default.blade.php | 9 +++++---- resources/views/layouts/setup.blade.php | 5 +++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index e071124a05..cc7ee7fa1c 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -397,6 +397,12 @@ return [ 'placeholder_kit' => 'Select a kit', 'file_not_found' => 'File not found', 'preview_not_available' => '(no preview)', + 'setup' => 'Setup', + 'pre_flight' => 'Pre-Flight', + 'skip_to_main_content' => 'Skip to main content', + 'toggle_navigation' => 'Toggle navigation', + 'alerts' => 'Alerts', + 'tasks_view_all' => 'View all tasks', diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index ceabe13553..2bb9bc8cf9 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -88,7 +88,7 @@ @endif -
Skip to main content + {{ trans('general.skip_to_main_content') }}
@@ -100,7 +100,7 @@