Passed
Push — master ( 6b8ca8...3384db )
by Paul
04:57
created

Actions   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 71
ccs 0
cts 39
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
B run() 0 44 1
1
<?php
2
3
namespace GeminiLabs\SiteReviews;
4
5
use GeminiLabs\SiteReviews\Application;
6
use GeminiLabs\SiteReviews\Contracts\HooksContract;
7
use GeminiLabs\SiteReviews\Controllers\AdminController;
8
// use GeminiLabs\SiteReviews\Controllers\EditorController;
9
use GeminiLabs\SiteReviews\Controllers\ListTableController;
10
use GeminiLabs\SiteReviews\Controllers\MainController;
11
use GeminiLabs\SiteReviews\Controllers\MenuController;
12
// use GeminiLabs\SiteReviews\Controllers\PublicController;
0 ignored issues
show
Unused Code Comprehensibility introduced by
37% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
13
// use GeminiLabs\SiteReviews\Controllers\SettingsController;
14
use GeminiLabs\SiteReviews\Router;
15
16
class Actions implements HooksContract
17
{
18
	protected $admin;
19
	protected $app;
20
	// protected $editor;
21
	protected $listtable;
22
	protected $menu;
23
	protected $main;
24
	// protected $public;
25
	protected $router;
26
	// protected $settings;
27
28
	public function __construct( Application $app ) {
29
		$this->app = $app;
30
		$this->admin = $app->make( AdminController::class );
31
		// $this->editor = $app->make( EditorController::class );
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
32
		$this->listtable = $app->make( ListTableController::class );
33
		$this->main = $app->make( MainController::class );
34
		$this->menu = $app->make( MenuController::class );
35
		// $this->public = $app->make( PublicController::class );
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
36
		$this->router = $app->make( Router::class );
37
		// $this->settings = $app->make( SettingsController::class );
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
38
	}
39
40
	/**
41
	 * @return void
42
	 */
43
	public function run()
44
	{
45
		add_action( 'admin_enqueue_scripts',                     [$this->admin, 'enqueueAssets'] );
46
		add_action( 'admin_enqueue_scripts',                     [$this->admin, 'registerPointers'], 13 );
47
		add_action( 'admin_init',                                [$this->admin, 'registerShortcodeButtons'] );
48
		add_action( 'edit_form_after_title',                     [$this->admin, 'renderReviewEditor'] );
49
		add_action( 'edit_form_top',                             [$this->admin, 'renderReviewNotice'] );
50
		add_action( 'media_buttons',                             [$this->admin, 'renderTinymceButton'], 11 );
51
		add_action( 'plugins_loaded',                            [$this->app, 'getDefaults'], 11 );
52
		add_action( 'plugins_loaded',                            [$this->app, 'registerAddons'] );
53
		add_action( 'plugins_loaded',                            [$this->app, 'registerLanguages'] );
54
		add_action( 'plugins_loaded',                            [$this->app, 'registerReviewTypes'] );
55
		add_action( 'upgrader_process_complete',                 [$this->app, 'upgraded'], 10, 2 );
56
		// add_action( 'admin_enqueue_scripts',                     [$this->editor, 'customizePostStatusLabels'] );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
57
		// add_action( 'site-reviews/create/review',                [$this->editor, 'onCreateReview'], 10, 3 );
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
58
		// add_action( 'before_delete_post',                        [$this->editor, 'onDeleteReview'] );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
59
		// add_action( 'save_post_'.Application::POST_TYPE,         [$this->editor, 'onSaveReview'], 20, 2 );
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
60
		// add_action( 'add_meta_boxes',                            [$this->editor, 'registerMetaBoxes'] );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
61
		// add_action( 'admin_print_scripts',                       [$this->editor, 'removeAutosave'], 999 );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
62
		// add_action( 'admin_menu',                                [$this->editor, 'removeMetaBoxes'] );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
63
		// add_action( 'post_submitbox_misc_actions',               [$this->editor, 'renderMetaBoxPinned'] );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
64
		// add_action( 'admin_action_revert',                       [$this->editor, 'revert'] );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
65
		// add_action( 'save_post_'.Application::POST_TYPE,         [$this->editor, 'saveMetaboxes'] );
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
66
		add_action( 'admin_action_approve',                      [$this->listtable, 'approve'] );
67
		add_action( 'bulk_edit_custom_box',                      [$this->listtable, 'renderBulkEditFields'], 10, 2 );
68
		add_action( 'restrict_manage_posts',                     [$this->listtable, 'renderColumnFilters'] );
69
		add_action( 'manage_posts_custom_column',                [$this->listtable, 'renderColumnValues'] );
70
		add_action( 'save_post_'.Application::POST_TYPE,         [$this->listtable, 'saveBulkEditFields'] );
71
		add_action( 'pre_get_posts',                             [$this->listtable, 'setQueryForColumn'] );
72
		add_action( 'admin_action_unapprove',                    [$this->listtable, 'unapprove'] );
73
		add_action( 'init',                                      [$this->main, 'registerPostType'], 8 );
74
		add_action( 'init',                                      [$this->main, 'registerShortcodes'] );
75
		add_action( 'init',                                      [$this->main, 'registerTaxonomy'] );
76
		add_action( 'widgets_init',                              [$this->main, 'registerWidgets'] );
77
		add_action( 'wp_footer',                                 [$this->main, 'renderSchema'] );
78
		add_action( 'admin_menu',                                [$this->menu, 'registerMenuCount'] );
79
		add_action( 'admin_menu',                                [$this->menu, 'registerSubMenus'] );
80
		// add_action( 'admin_init',                                [$this->menu, 'setCustomPermissions'], 999 );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
81
		// add_action( 'wp_enqueue_scripts',                        [$this->public, 'enqueueAssets'], 999 );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
82
		add_action( 'admin_init',                                   [$this->router, 'routeAdminPostRequest'] );
83
		add_action( 'wp_ajax_'.Application::PREFIX.'action',        [$this->router, 'routeAjaxRequest'] );
84
		add_action( 'wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] );
85
		add_action( 'init',                                         [$this->router, 'routePublicPostRequest'] );
86
		add_action( 'admin_init',                                   [$this->router, 'routeWebhookRequest'] );
87
		// add_action( 'admin_init',                                [$this->settings, 'registerSettings'] );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
88
	}
89
}
90