WP_Widget   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 0
cbo 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
3
/*
4
 * This file is part of the WPPhpSpecBridge library.
5
 *
6
 * Copyright (c) 2015-2016 LIN3S <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @author Beñat Espiña <[email protected]>
12
 */
13
14
namespace {
15
    define('WP_DEBUG', true);
16
17
    class WP_Widget
18
    {
19
        public $id_base;
20
        public $name;
21
        public $number = false;
22
23
        public function __construct($id_base, $name, $widget_options = [], $control_options = [])
0 ignored issues
show
Unused Code introduced by
The parameter $widget_options is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $control_options is not used and could be removed.

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

Loading history...
24
        {
25
            $this->id_base = empty($id_base) ? preg_replace('/(wp_)?widget_/', '', strtolower(get_class($this))) : strtolower($id_base);
26
            $this->name = $name;
27
            $this->option_name = 'widget_' . $this->id_base;
0 ignored issues
show
Bug introduced by
The property option_name does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
28
        }
29
    }
30
31
    function add_action($hook, $callback)
0 ignored issues
show
Unused Code introduced by
The parameter $hook is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $callback is not used and could be removed.

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

Loading history...
32
    {
33
        return true;
34
    }
35
36
    function add_filter($tag, $functionToAdd)
0 ignored issues
show
Unused Code introduced by
The parameter $tag is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $functionToAdd is not used and could be removed.

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

Loading history...
37
    {
38
        return true;
39
    }
40
41
    function add_theme_support($feature)
0 ignored issues
show
Unused Code introduced by
The parameter $feature is not used and could be removed.

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

Loading history...
42
    {
43
        return true;
44
    }
45
46
    function wp_enqueue_script($name, $from, $dependencies, $version, $inFooter)
0 ignored issues
show
Unused Code introduced by
The parameter $name is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $from is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $dependencies is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $version is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $inFooter is not used and could be removed.

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

Loading history...
47
    {
48
        return true;
49
    }
50
51
    function wp_enqueue_style($name, $from, $dependencies, $version, $media)
0 ignored issues
show
Unused Code introduced by
The parameter $name is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $from is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $dependencies is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $version is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $media is not used and could be removed.

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

Loading history...
52
    {
53
        return true;
54
    }
55
56
    function get_template_directory_uri()
57
    {
58
        return true;
59
    }
60
61
    function is_admin()
62
    {
63
        return true;
64
    }
65
66
    function add_post_type_support()
67
    {
68
        return true;
69
    }
70
71
    function remove_post_type_support()
72
    {
73
        return true;
74
    }
75
76
    function register_widget($className)
0 ignored issues
show
Unused Code introduced by
The parameter $className is not used and could be removed.

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

Loading history...
77
    {
78
        return true;
79
    }
80
81
    function get_bloginfo()
82
    {
83
        return 'WordPress Standard';
84
    }
85
86
    function home_url()
87
    {
88
        return 'http://wordpress-standard';
89
    }
90
91
    function is_embed()
92
    {
93
        return true;
94
    }
95
96
    function is_404()
97
    {
98
        return true;
99
    }
100
101
    function is_search()
102
    {
103
        return true;
104
    }
105
106
    function is_front_page()
107
    {
108
        return true;
109
    }
110
111
    function is_home()
112
    {
113
        return true;
114
    }
115
116
    function is_post_type_archive()
117
    {
118
        return true;
119
    }
120
121
    function is_tax()
122
    {
123
        return true;
124
    }
125
126
    function is_attachment()
127
    {
128
        return true;
129
    }
130
131
    function is_single()
132
    {
133
        return true;
134
    }
135
136
    function is_page()
137
    {
138
        return true;
139
    }
140
141
    function is_singular()
142
    {
143
        return true;
144
    }
145
146
    function is_category()
147
    {
148
        return true;
149
    }
150
151
    function is_tag()
152
    {
153
        return true;
154
    }
155
156
    function is_author()
157
    {
158
        return true;
159
    }
160
161
    function is_date()
162
    {
163
        return true;
164
    }
165
166
    function is_archive()
167
    {
168
        return true;
169
    }
170
171
    function is_paged()
172
    {
173
        return true;
174
    }
175
176
    function remove_filter($tag, $function_to_remove, $priority = 10)
0 ignored issues
show
Unused Code introduced by
The parameter $tag is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $function_to_remove is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $priority is not used and could be removed.

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

Loading history...
177
    {
178
        return true;
179
    }
180
181
    function get_template_directory()
182
    {
183
        return 'src/themes/AppTheme/Resources/views';
184
    }
185
}
186