Skip to content

A free open source IT asset/license management system

Apply pint to actions directory

snipea3c7410c3538
diff --git a/app/Actions/Categories/DestroyCategoryAction.php b/app/Actions/Categories/DestroyCategoryAction.php
index 305f88fc15..469fe60387 100644
--- a/app/Actions/Categories/DestroyCategoryAction.php
+++ b/app/Actions/Categories/DestroyCategoryAction.php
@@ -21,7 +21,7 @@ class DestroyCategoryAction
* @throws ItemStillHasLicenses
* @throws ItemStillHasConsumables
*/
- static function run(Category $category): bool
+ public static function run(Category $category): bool
{
$category->loadCount([
'assets as assets_count',
@@ -29,7 +29,7 @@ class DestroyCategoryAction
'consumables as consumables_count',
'components as components_count',
'licenses as licenses_count',
- 'models as models_count'
+ 'models as models_count',
]);
if ($category->assets_count > 0) {
@@ -56,4 +56,4 @@ class DestroyCategoryAction
return true;
}
-}
\ No newline at end of file
+}
diff --git a/app/Actions/CheckoutRequests/CancelCheckoutRequestAction.php b/app/Actions/CheckoutRequests/CancelCheckoutRequestAction.php
index 2d6dd68a08..65a4b63fdb 100644
--- a/app/Actions/CheckoutRequests/CancelCheckoutRequestAction.php
+++ b/app/Actions/CheckoutRequests/CancelCheckoutRequestAction.php
@@ -14,8 +14,8 @@ class CancelCheckoutRequestAction
{
public static function run(Asset $asset, User $user)
{
- if (!Company::isCurrentUserHasAccess($asset)) {
- throw new AuthorizationException();
+ if (! Company::isCurrentUserHasAccess($asset)) {
+ throw new AuthorizationException;
}
$asset->cancelRequest();
@@ -27,7 +27,7 @@ class CancelCheckoutRequestAction
$data['item_quantity'] = 1;
$settings = Setting::getSettings();
- $logaction = new Actionlog();
+ $logaction = new Actionlog;
$logaction->item_id = $data['asset_id'] = $asset->id;
$logaction->item_type = $data['item_type'] = Asset::class;
$logaction->created_at = $data['requested_date'] = date('Y-m-d H:i:s');
@@ -44,5 +44,4 @@ class CancelCheckoutRequestAction
return true;
}
-
-}
\ No newline at end of file
+}
diff --git a/app/Actions/CheckoutRequests/CreateCheckoutRequestAction.php b/app/Actions/CheckoutRequests/CreateCheckoutRequestAction.php
index 6870cfba2d..68782c90bf 100644
--- a/app/Actions/CheckoutRequests/CreateCheckoutRequestAction.php
+++ b/app/Actions/CheckoutRequests/CreateCheckoutRequestAction.php
@@ -23,8 +23,8 @@ class CreateCheckoutRequestAction
if (is_null(Asset::RequestableAssets()->find($asset->id))) {
throw new AssetNotRequestable($asset);
}
- if (!Company::isCurrentUserHasAccess($asset)) {
- throw new AuthorizationException();
+ if (! Company::isCurrentUserHasAccess($asset)) {
+ throw new AuthorizationException;
}
$data['item'] = $asset;
@@ -32,7 +32,7 @@ class CreateCheckoutRequestAction
$data['item_quantity'] = 1;
$settings = Setting::getSettings();
- $logaction = new Actionlog();
+ $logaction = new Actionlog;
$logaction->item_id = $data['asset_id'] = $asset->id;
$logaction->item_type = $data['item_type'] = Asset::class;
$logaction->created_at = $data['requested_date'] = date('Y-m-d H:i:s');
@@ -51,4 +51,4 @@ class CreateCheckoutRequestAction
return true;
}
-}
\ No newline at end of file
+}
diff --git a/app/Actions/Manufacturers/DeleteManufacturerAction.php b/app/Actions/Manufacturers/DeleteManufacturerAction.php
index bb17a27367..fd918fe1dd 100644
--- a/app/Actions/Manufacturers/DeleteManufacturerAction.php
+++ b/app/Actions/Manufacturers/DeleteManufacturerAction.php
@@ -20,7 +20,7 @@ class DeleteManufacturerAction
* @throws ItemStillHasLicenses
* @throws ItemStillHasConsumables
*/
- static function run(Manufacturer $manufacturer): bool
+ public static function run(Manufacturer $manufacturer): bool
{
$manufacturer->loadCount([
'assets as assets_count',
@@ -55,9 +55,8 @@ class DeleteManufacturerAction
}
$manufacturer->delete();
- //dd($manufacturer);
+ // dd($manufacturer);
return true;
}
-
-}
\ No newline at end of file
+}
diff --git a/app/Actions/Suppliers/DestroySupplierAction.php b/app/Actions/Suppliers/DestroySupplierAction.php
index 6c6e211ac6..da5260bd53 100644
--- a/app/Actions/Suppliers/DestroySupplierAction.php
+++ b/app/Actions/Suppliers/DestroySupplierAction.php
@@ -3,19 +3,18 @@
namespace App\Actions\Suppliers;
use App\Exceptions\ItemStillHasAccessories;
+use App\Exceptions\ItemStillHasAssets;
use App\Exceptions\ItemStillHasComponents;
use App\Exceptions\ItemStillHasConsumables;
-use App\Models\Supplier;
-use App\Exceptions\ItemStillHasAssets;
-use App\Exceptions\ItemStillHasMaintenances;
use App\Exceptions\ItemStillHasLicenses;
+use App\Exceptions\ItemStillHasMaintenances;
+use App\Models\Supplier;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
class DestroySupplierAction
{
/**
- *
* @throws ItemStillHasLicenses
* @throws ItemStillHasAssets
* @throws ItemStillHasMaintenances
@@ -23,7 +22,7 @@ class DestroySupplierAction
* @throws ItemStillHasConsumables
* @throws ItemStillHasComponents
*/
- static function run(Supplier $supplier): bool
+ public static function run(Supplier $supplier): bool
{
$supplier->loadCount([
'maintenances as maintenances_count',