Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Dashboard/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@

class Grid
{
public static function getDashboardCards(): array
public static function getDashboardCards(?array $cards = null): array
{
$cards = [];
$cards ??= [];
// Declare the following cards only if we show / edit the quick report page of the plugin
$in_carbon_report_page = self::in_carbon_report_page();

Expand Down
6 changes: 3 additions & 3 deletions src/Dashboard/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@

class Widget extends GlpiDashboardWidget
{
public static function WidgetTypes(): array
public static function WidgetTypes(?array $types = null): array
{
$types = [
$types = array_merge($types ?? [], [
// Informative
'information_video' => [
'label' => __('Environmental impact information video', 'carbon'),
Expand Down Expand Up @@ -111,7 +111,7 @@ public static function WidgetTypes(): array
'width' => 6,
'height' => 3,
],
];
]);

// Data diagnostic
if (in_array(Computer::class, PLUGIN_CARBON_TYPES)) {
Expand Down