Skip to content

A free open source IT asset/license management system

Added @SuppressWarnings(PHPMD.UnusedFormalParameter) for required laravel signature variables

snipe96261201e12d
diff --git a/app/Importer/AccessoryImporter.php b/app/Importer/AccessoryImporter.php
index 28fffb1b08..097f349683 100644
--- a/app/Importer/AccessoryImporter.php
+++ b/app/Importer/AccessoryImporter.php
@@ -84,6 +84,8 @@ class AccessoryImporter extends ItemImporter
/**
* Override the base sanitize to skip the reject-empty pass. See handle()
* above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
diff --git a/app/Importer/AssetImporter.php b/app/Importer/AssetImporter.php
index 530abc9b5b..9a20d15f51 100644
--- a/app/Importer/AssetImporter.php
+++ b/app/Importer/AssetImporter.php
@@ -182,6 +182,8 @@ class AssetImporter extends ItemImporter
* populates $this->item exclusively from CSV columns that were present in
* the row, so an empty value here is an explicit intent to clear the DB
* field on update. See handle() above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
diff --git a/app/Importer/AssetModelImporter.php b/app/Importer/AssetModelImporter.php
index 22c1c5469d..cd752fa20f 100644
--- a/app/Importer/AssetModelImporter.php
+++ b/app/Importer/AssetModelImporter.php
@@ -68,6 +68,8 @@ class AssetModelImporter extends ItemImporter
/**
* Override the base sanitize to skip the reject-empty pass. See handle()
* above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
diff --git a/app/Importer/CategoryImporter.php b/app/Importer/CategoryImporter.php
index d3f3bc91eb..e859c41b82 100644
--- a/app/Importer/CategoryImporter.php
+++ b/app/Importer/CategoryImporter.php
@@ -58,6 +58,8 @@ class CategoryImporter extends ItemImporter
/**
* Override the base sanitize to skip the reject-empty pass. See handle()
* above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
diff --git a/app/Importer/ComponentImporter.php b/app/Importer/ComponentImporter.php
index 64ef9260db..b4f3d276dd 100644
--- a/app/Importer/ComponentImporter.php
+++ b/app/Importer/ComponentImporter.php
@@ -79,6 +79,8 @@ class ComponentImporter extends ItemImporter
/**
* Override the base sanitize to skip the reject-empty pass. See handle()
* above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
diff --git a/app/Importer/ConsumableImporter.php b/app/Importer/ConsumableImporter.php
index 7e62919f62..bd3d474458 100644
--- a/app/Importer/ConsumableImporter.php
+++ b/app/Importer/ConsumableImporter.php
@@ -60,11 +60,10 @@ class ConsumableImporter extends ItemImporter
if ($this->csvRowHas($row, 'purchase_date')) {
$raw = $this->findCsvMatch($row, 'purchase_date');
+ $this->item['purchase_date'] = null;
if ($raw !== '') {
$this->item['purchase_date'] = $raw;
$this->item['purchase_date'] = $this->parseOrNullDate('purchase_date');
- } else {
- $this->item['purchase_date'] = null;
}
}
@@ -80,6 +79,8 @@ class ConsumableImporter extends ItemImporter
/**
* Override the base sanitize to skip the reject-empty pass. See handle()
* above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
diff --git a/app/Importer/LicenseImporter.php b/app/Importer/LicenseImporter.php
index 80305bfcab..8f1cc01e30 100644
--- a/app/Importer/LicenseImporter.php
+++ b/app/Importer/LicenseImporter.php
@@ -76,6 +76,8 @@ class LicenseImporter extends ItemImporter
* populates $this->item exclusively from CSV columns that were present in
* the row, so an empty value here is an explicit intent to clear the DB
* field on update. See handle() above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
diff --git a/app/Importer/LocationImporter.php b/app/Importer/LocationImporter.php
index 2028e28489..c69883ec91 100644
--- a/app/Importer/LocationImporter.php
+++ b/app/Importer/LocationImporter.php
@@ -86,6 +86,8 @@ class LocationImporter extends ItemImporter
/**
* Override the base sanitize to skip the reject-empty pass. See handle()
* above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
diff --git a/app/Importer/ManufacturerImporter.php b/app/Importer/ManufacturerImporter.php
index 7038c06a9b..d7934c7cbf 100644
--- a/app/Importer/ManufacturerImporter.php
+++ b/app/Importer/ManufacturerImporter.php
@@ -31,15 +31,15 @@ class ManufacturerImporter extends ItemImporter
$this->item = [];
foreach ([
- 'name',
- 'support_phone',
- 'support_email',
- 'url',
- 'support_url',
- 'warranty_lookup_url',
- 'notes',
- 'tag_color',
- ] as $field) {
+ 'name',
+ 'support_phone',
+ 'support_email',
+ 'url',
+ 'support_url',
+ 'warranty_lookup_url',
+ 'notes',
+ 'tag_color',
+ ] as $field) {
$this->setItemFromCsvIfPresent($row, $field);
}
@@ -49,6 +49,8 @@ class ManufacturerImporter extends ItemImporter
/**
* Override the base sanitize to skip the reject-empty pass. See handle()
* above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
@@ -79,7 +81,7 @@ class ManufacturerImporter extends ItemImporter
if ($manufacturer) {
if (! $this->updating) {
- $this->log('A matching Manufacturer ' . $name . ' already exists');
+ $this->log('A matching Manufacturer '.$name.' already exists');
$this->recordSkipped();
return;
@@ -117,7 +119,7 @@ class ManufacturerImporter extends ItemImporter
} else {
Log::debug($manufacturer->getErrors());
$this->recordErrored();
- $this->logError($manufacturer, 'Manufacturer "' . $name . '"');
+ $this->logError($manufacturer, 'Manufacturer "'.$name.'"');
return $manufacturer->errors;
}
diff --git a/app/Importer/SupplierImporter.php b/app/Importer/SupplierImporter.php
index e38fc6e309..81cd2fe07c 100644
--- a/app/Importer/SupplierImporter.php
+++ b/app/Importer/SupplierImporter.php
@@ -55,6 +55,8 @@ class SupplierImporter extends ItemImporter
/**
* Override the base sanitize to skip the reject-empty pass. See handle()
* above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
diff --git a/app/Importer/UserImporter.php b/app/Importer/UserImporter.php
index 50dc304af5..5612fe16e4 100644
--- a/app/Importer/UserImporter.php
+++ b/app/Importer/UserImporter.php
@@ -144,6 +144,8 @@ class UserImporter extends ItemImporter
/**
* Override the base sanitize to skip the reject-empty pass. See handle()
* above for the matching item-population.
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function sanitizeItemForStoring($model, $updating = false)
{
diff --git a/tests/Feature/Licenses/Ui/BulkDeleteWithCheckinLicensesTest.php b/tests/Feature/Licenses/Ui/BulkDeleteWithCheckinLicensesTest.php
index 002085ca58..44de649001 100644
--- a/tests/Feature/Licenses/Ui/BulkDeleteWithCheckinLicensesTest.php
+++ b/tests/Feature/Licenses/Ui/BulkDeleteWithCheckinLicensesTest.php
@@ -52,7 +52,7 @@ class BulkDeleteWithCheckinLicensesTest extends TestCase implements TestsPermiss
{
$license = License::factory()->create(['seats' => 3]);
$asset = Asset::factory()->create();
- $seat = LicenseSeat::factory()->assignedToAsset($asset)->create(['license_id' => $license->id]);
+ LicenseSeat::factory()->assignedToAsset($asset)->create(['license_id' => $license->id]);
$this->actingAs(User::factory()->deleteLicenses()->checkinLicenses()->create())
->post(route('licenses.bulk.delete'), [