1 | <?php |
||
12 | class Gallery |
||
13 | { |
||
14 | public $image; |
||
15 | public $postmeta; |
||
16 | public $theme; |
||
17 | public $utility; |
||
18 | |||
19 | protected $args; |
||
20 | |||
21 | public function __construct( Image $image, PostMeta $postmeta, Theme $theme, Utility $utility ) |
||
28 | |||
29 | /** |
||
30 | * @return WP_Query |
||
31 | */ |
||
32 | public function query( array $args = [] ) |
||
46 | |||
47 | /** |
||
48 | * @return string |
||
49 | */ |
||
50 | public function render( WP_Query $gallery ) |
||
57 | |||
58 | /** |
||
59 | * @return null|string |
||
60 | */ |
||
61 | public function renderImage( WP_Post $attachment ) |
||
79 | |||
80 | /** |
||
81 | * @return null|string |
||
82 | */ |
||
83 | public function renderPagination( WP_Query $query ) |
||
95 | |||
96 | /** |
||
97 | * @param string $key |
||
98 | * @param mixed $value |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | protected function getBoolValue( $key, $value = null ) |
||
113 | |||
114 | /** |
||
115 | * @param mixed $value |
||
116 | * |
||
117 | * @return int |
||
118 | */ |
||
119 | protected function getGalleryArg( $value = null ) |
||
130 | |||
131 | /** |
||
132 | * @param mixed $value |
||
133 | * |
||
134 | * @return int |
||
135 | */ |
||
136 | protected function getImagesPerPageArg( $value = null ) |
||
147 | |||
148 | /** |
||
149 | * @param mixed $value |
||
150 | * |
||
151 | * @return bool |
||
152 | */ |
||
153 | protected function getLazyloadArg( $value = null ) |
||
157 | |||
158 | /** |
||
159 | * @param mixed $value |
||
160 | * |
||
161 | * @return array |
||
162 | */ |
||
163 | protected function getMediaArg( $value = null ) |
||
177 | |||
178 | /** |
||
179 | * @return int |
||
180 | */ |
||
181 | protected function getPaged() |
||
185 | |||
186 | /** |
||
187 | * @param mixed $value |
||
188 | * |
||
189 | * @return bool |
||
190 | */ |
||
191 | protected function getPaginationArg( $value = null ) |
||
195 | |||
196 | /** |
||
197 | * @param mixed $value |
||
198 | * |
||
199 | * @return bool |
||
200 | */ |
||
201 | protected function getPermalinksArg( $value = null ) |
||
205 | |||
206 | /** |
||
207 | * @return string |
||
208 | */ |
||
209 | protected function getPhotoswipeData( $image ) |
||
220 | |||
221 | /** |
||
222 | * @param string $key |
||
223 | * @param mixed $value |
||
224 | * |
||
225 | * @return mixed |
||
226 | */ |
||
227 | protected function getValue( $key, $value = null ) |
||
234 | |||
235 | /** |
||
236 | * @return array |
||
237 | */ |
||
238 | protected function normalizeArgs( array $args = [] ) |
||
260 | |||
261 | /** |
||
262 | * @param object $image |
||
263 | * |
||
264 | * @return null|string |
||
265 | */ |
||
266 | protected function renderImageTag( $image ) |
||
282 | } |
||
283 |
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.