1 | <?php |
||
13 | class Logger { |
||
14 | /** |
||
15 | * Array of foreground colors |
||
16 | * |
||
17 | * @var Array |
||
18 | */ |
||
19 | private $foreground_colors = array(); |
||
20 | /** |
||
21 | * Array of background colors |
||
22 | * |
||
23 | * @var Array |
||
24 | */ |
||
25 | private $background_colors = array(); |
||
26 | |||
27 | /** |
||
28 | * A generic log command |
||
29 | * |
||
30 | * @param String $string string to log. |
||
31 | * @param String $foreground_color foreground color. |
||
|
|||
32 | * @param String $background_color background color. |
||
33 | */ |
||
34 | public static function log( $string, $foreground_color = null, $background_color = null ) { |
||
45 | |||
46 | /** |
||
47 | * Info log command in yellow |
||
48 | * |
||
49 | * @param String $string string to log. |
||
50 | */ |
||
51 | public static function info( $string ) { |
||
54 | |||
55 | /** |
||
56 | * Set up shell colors |
||
57 | */ |
||
58 | public function __construct() { |
||
85 | |||
86 | /** |
||
87 | * Returns colored string |
||
88 | * |
||
89 | * @param String $string string to log. |
||
90 | * @param String $foreground_color foreground color. |
||
91 | * @param String $background_color background color. |
||
92 | */ |
||
93 | public function get_colored_string( $string, $foreground_color = null, $background_color = null ) { |
||
110 | |||
111 | /** |
||
112 | * Returns all foreground color names |
||
113 | */ |
||
114 | public function get_foreground_colors() { |
||
117 | |||
118 | /** |
||
119 | * Returns all background color names |
||
120 | */ |
||
121 | public function get_background_colors() { |
||
124 | } |
||
125 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.