Skip to content

Commit

Permalink
Code refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jun 3, 2024
1 parent 8803a6d commit 18d2ea3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ parameters:
count: 1
path: src/Admin/Models/StatusHistory.php

-
message: "#^Call to an undefined static method Igniter\\\\Admin\\\\Models\\\\Status\\:\\:find\\(\\)\\.$#"
count: 1
path: src/Admin/Models/StatusHistory.php

-
message: "#^Call to an undefined static method Igniter\\\\Admin\\\\Models\\\\StatusHistory\\:\\:where\\(\\)\\.$#"
count: 1
Expand Down
4 changes: 4 additions & 0 deletions src/Admin/Models/StatusHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public function getNotifiedAttribute()
*/
public static function createHistory($status, $object, $options = [])
{
if (!$status instanceof Status) {
$status = Status::find($status);
}

$statusId = $status->getKey();
$previousStatus = $object->getOriginal('status_id');

Expand Down
7 changes: 1 addition & 6 deletions src/Main/Providers/FormServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
namespace Igniter\Main\Providers;

use Igniter\Admin\Classes\Widgets;
use Igniter\Flame\Igniter;
use Illuminate\Support\ServiceProvider;

class FormServiceProvider extends ServiceProvider
{
public function register()
{
if (!Igniter::runningInAdmin()) {
return;
}

resolve(Widgets::class)->registerFormWidgets(function(Widgets $manager) {
$manager->registerFormWidget(\Igniter\Main\FormWidgets\Components::class, [
'label' => 'Components',
Expand All @@ -31,4 +26,4 @@ public function register()
]);
});
}
}
}

0 comments on commit 18d2ea3

Please sign in to comment.