for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Sensei Notices Class
*
* All functionality pertaining to displaying of various notices accross.
* @package Core
* @author Automattic
* @since 1.6.3
*/
class Sensei_Notices{
* @var $notices
protected $notices;
* constructor
public function __construct(){
//initialize the notices variable
$this->notices = array();
}
* Add a notice to the array of notices for display at a later stage.
* @param string $message
* @param string $type defaults to alert options( alert, tick , download , info )
$message
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @return void
public function add_notice( $content , $type = 'alert' ){
// append the new notice
$this->notices[] = array('content' => $content , 'type'=> $type );
} // end add_notice()
* Output all notices added
* @param string $type
$type
public function print_notices(){
if( count( $this->notices ) > 0 ){
foreach ($this->notices as $notice) {
$classes = 'sensei-message '. $notice['type'];
$html = '<div class="'. $classes . '">'. $notice['content'] . '</div>';
echo $html;
// empty the notice queue to avoid reprinting the same notices
$this->clear_notices();
} // end print_notice()
* Clear all notices
public function clear_notices(){
// assign an empty array to clear all existing notices
} // end clear_notices()
} // end Woothemes_Sensei_Notices
* Class Woothemes_Sensei_Notices
* @ignore only for backward compatibility
* @since 1.9.0
class Woothemes_Sensei_Notices extends Sensei_Notices{}
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.