GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

EcommerceTaskDashboardReset::run()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Adds all members, who have bought something, to the customer group.
5
 *
6
 * @authors: Nicolaas [at] Sunny Side Up .co.nz
7
 * @package: ecommerce
8
 * @sub-package: tasks
9
 * @inspiration: Silverstripe Ltd, Jeremy
10
 **/
11
class EcommerceTaskDashboardReset extends BuildTask
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
12
{
13
    protected $title = 'Reset all dashboard settings';
14
15
    protected $description = 'Resets all data set for the dashboard customisation.  There is NO undo!';
16
17
    protected $tables = array(
18
        "DashboardBlogEntryPanel",
19
        "DashboardGoogleAnalyticsPanel",
20
        "DashboardGridFieldPanel",
21
        "DashboardModelAdminPanel",
22
        "DashboardPanel",
23
        "DashboardPanelDataObject",
24
        "DashboardQuickLink",
25
        "DashboardRecentEditsPanel",
26
        "DashboardRecentFilesPanel",
27
        "DashboardRSSFeedPanel",
28
        "DashboardSectionEditorPanel",
29
        "DashboardWeatherPanel",
30
        "EcommerceDashboardPanel",
31
        "EcommerceDashboardPanel_FavouriteProducts",
32
        "EcommerceDashboardPanel_LatestOrders",
33
        "EcommerceDashboardPanel_OrderCount",
34
        "EcommerceDashboardPanel_SearchHistory"
35
    );
36
37
    public function run($request)
38
    {
39
        foreach ($this->tables as $table) {
40
            DB::alteration_message('deleting '.$table, "deleted");
41
            DB::query('DELETE FROM '.$table.';');
42
        }
43
        DB::alteration_message('------------------ END ------------------');
44
    }
45
}
46