for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class Close_Button extends Plugin {
private $host;
public function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
}
public function about() {
return array(1.0,
"Adds a button to close article panel",
"fox");
public function get_css() {
return "i.icon-close-article { color : red; }";
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function hook_article_button($line) {
$line
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
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.
if (!get_pref("COMBINED_DISPLAY_MODE")) {
$rv = "<i class='material-icons icon-close-article'
style='cursor : pointer' onclick='Article.close()'
title='".__('Close article')."'>close</i>";
return $rv;
$rv
public function api_version() {
return 2;
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.