| 1 | <?php |
||
| 15 | class Sensei_Notices{ |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var $notices |
||
| 19 | */ |
||
| 20 | protected $notices; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * constructor |
||
| 24 | */ |
||
| 25 | public function __construct(){ |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Add a notice to the array of notices for display at a later stage. |
||
| 32 | * |
||
| 33 | * |
||
| 34 | * |
||
| 35 | * @param string $message |
||
| 36 | * @param string $type defaults to alert options( alert, tick , download , info ) |
||
|
|
|||
| 37 | * |
||
| 38 | * @return void |
||
| 39 | */ |
||
| 40 | |||
| 41 | public function add_notice( $content , $type = 'alert' ){ |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Output all notices added |
||
| 48 | * |
||
| 49 | * @param string $message |
||
| 50 | * @param string $type |
||
| 51 | * |
||
| 52 | * @return void |
||
| 53 | */ |
||
| 54 | |||
| 55 | public function print_notices(){ |
||
| 56 | if( count( $this->notices ) > 0 ){ |
||
| 57 | foreach ($this->notices as $notice) { |
||
| 58 | |||
| 59 | $classes = 'sensei-message '. $notice['type']; |
||
| 60 | $html = '<div class="'. $classes . '">'. $notice['content'] . '</div>'; |
||
| 61 | |||
| 62 | echo $html; |
||
| 63 | } |
||
| 64 | // empty the notice queue to avoid reprinting the same notices |
||
| 65 | $this->clear_notices(); |
||
| 66 | } |
||
| 67 | } // end print_notice() |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Clear all notices |
||
| 71 | * |
||
| 72 | * @return void |
||
| 73 | */ |
||
| 74 | |||
| 75 | public function clear_notices(){ |
||
| 79 | |||
| 80 | } // end Woothemes_Sensei_Notices |
||
| 81 | |||
| 88 |
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.