Issues (1270)

plugins/close_button/init.php (2 issues)

1
<?php
2
class Close_Button extends Plugin {
3
    private $host;
4
5
    public function init($host) {
6
        $this->host = $host;
7
8
        $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
9
    }
10
11
    public function about() {
12
        return array(1.0,
13
            "Adds a button to close article panel",
14
            "fox");
15
    }
16
17
    public function get_css() {
18
        return "i.icon-close-article { color : red; }";
19
    }
20
21
    /**
22
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
23
     */
24
    public function hook_article_button($line) {
0 ignored issues
show
The parameter $line 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

24
    public function hook_article_button(/** @scrutinizer ignore-unused */ $line) {

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...
25
        if (!get_pref("COMBINED_DISPLAY_MODE")) {
26
            $rv = "<i class='material-icons icon-close-article'
27
				style='cursor : pointer' onclick='Article.close()'
28
				title='".__('Close article')."'>close</i>";
29
        }
30
31
        return $rv;
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $rv does not seem to be defined for all execution paths leading up to this point.
Loading history...
32
    }
33
34
    public function api_version() {
35
        return 2;
36
    }
37
38
}
39