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.

__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 8
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 13
rs 10
1
<?php
2
3
class Tabify_Edit_Screen_Feature_Plugin_Support {
4
	/**
5
	 * Set hooks
6
	 *
7
	 * @since 0.4.0
8
	 */
9
	public function __construct() {
10
		$screen = get_current_screen();
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $screen is correct as get_current_screen() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
11
12
		if ( 'settings_page_tabify-edit-screen' != $screen->base ) {
13
			return;
14
		}
15
16
		add_action( 'tabify_add_meta_boxes', array( $this, 'types' ) );
17
		add_action( 'tabify_add_meta_boxes', array( $this, 'members' ) );
18
		add_action( 'tabify_add_meta_boxes', array( $this, 'wpml' ) );
19
20
		add_filter( 'wpseo_always_register_metaboxes_on_admin', '__return_true' );
21
		add_action( 'tabify_add_meta_boxes', array( $this, 'wpseo' ) ); // The old way, will be removed in 1.0
22
	}
23
24
	/**
25
	 * Load widgets created by Types
26
	 *
27
	 * @param string $posttype The posttype the metaboxes should be loaded from
28
	 * 
29
	 * @since 0.4.0
30
	 */
31
	public function types( $posttype ) {
0 ignored issues
show
Unused Code introduced by
The parameter $posttype is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

31
	public function types( /** @scrutinizer ignore-unused */ $posttype ) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
32
		
33
	}
34
35
	/**
36
	 * Load widgets created by WordPress SEO
37
	 * 
38
	 * @since 0.4.0
39
	 */
40
	public function wpseo() {
41
		if ( defined( 'WPSEO_PATH' ) && is_file( WPSEO_PATH . 'admin/class-metabox.php' ) ) {
0 ignored issues
show
Bug introduced by
The constant WPSEO_PATH was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
42
			include_once WPSEO_PATH . 'admin/class-metabox.php';
43
		}
44
	}
45
	
46
47
	/**
48
	 * Load widgets created by Members
49
	 * 
50
	 * @since 0.4.0
51
	 */
52
	public function members() {
53
		if ( function_exists( 'members_admin_setup' ) && ! did_action( 'load-post.php' ) ) {
54
			do_action( 'load-post.php' );
55
		}
56
	}
57
	
58
	/**
59
	 * Load widgets created by Members
60
	 *
61
	 * @param string $posttype The posttype the metaboxes should be loaded from
62
	 * 
63
	 * @since 0.7.0
64
	 */
65
	public function wpml( $posttype ) {
66
		global $sitepress, $post;
67
68
		if ( defined('ICL_SITEPRESS_VERSION') && $sitepress && ! $post ) {
69
			$post = (object) array( 'post_type' => $posttype );
70
			$sitepress->post_edit_language_options();
71
72
			$post = null;
73
		}
74
	}
75
76
}