| @@ -18,9 +18,8 @@ | ||
| 18 | 18 | // | MA 02110-1301 USA | |
| 19 | 19 | // +----------------------------------------------------------------------+ |
| 20 | 20 | // | Author: Eugene Manuilov <eugene@manuilov.org> | |
| 21 | 21 | // +----------------------------------------------------------------------+ |
| 22 | - | |
| 23 | 22 | /** |
| 24 | 23 | * The abstract class for source managers. |
| 25 | 24 | * |
| 26 | 25 | * @category Visualizer |
| @@ -118,30 +117,30 @@ | ||
| 118 | 117 | * @return array Normalized row of data. |
| 119 | 118 | */ |
| 120 | 119 | protected function _normalizeData( $data ) { |
| 121 | 120 | // normalize values |
| 122 | - //print_r($data); | |
| 121 | + // print_r($data); | |
| 123 | 122 | foreach ( $this->_series as $i => $series ) { |
| 124 | 123 | // if no value exists for the seires, then add null |
| 125 | - if ( !isset( $data[$i] ) ) { | |
| 126 | - $data[$i] = null; | |
| 124 | + if ( ! isset( $data[ $i ] ) ) { | |
| 125 | + $data[ $i ] = null; | |
| 127 | 126 | } |
| 128 | 127 | |
| 129 | - if ( is_null( $data[$i] ) && !is_numeric($data[$i])) { | |
| 128 | + if ( is_null( $data[ $i ] ) && ! is_numeric( $data[ $i ] ) ) { | |
| 130 | 129 | continue; |
| 131 | 130 | } |
| 132 | 131 | |
| 133 | 132 | switch ( $series['type'] ) { |
| 134 | 133 | case 'number': |
| 135 | - $data[$i] = ( is_numeric($data[$i]) ) ? floatval( $data[$i] ) : null; | |
| 134 | + $data[ $i ] = ( is_numeric( $data[ $i ] ) ) ? floatval( $data[ $i ] ) : null; | |
| 136 | 135 | break; |
| 137 | 136 | case 'boolean': |
| 138 | - $data[$i] = !empty( $data[$i] ) ? filter_validate( $data[$i], FILTER_VALIDATE_BOOLEAN ) : null; | |
| 137 | + $data[ $i ] = ! empty( $data[ $i ] ) ? filter_validate( $data[ $i ], FILTER_VALIDATE_BOOLEAN ) : null; | |
| 139 | 138 | break; |
| 140 | 139 | case 'timeofday': |
| 141 | - $date = new DateTime( '1984-03-16T' . $data[$i] ); | |
| 140 | + $date = new DateTime( '1984-03-16T' . $data[ $i ] ); | |
| 142 | 141 | if ( $date ) { |
| 143 | - $data[$i] = array( | |
| 142 | + $data[ $i ] = array( | |
| 144 | 143 | intval( $date->format( 'H' ) ), |
| 145 | 144 | intval( $date->format( 'i' ) ), |
| 146 | 145 | intval( $date->format( 's' ) ), |
| 147 | 146 | 0, |
| @@ -165,9 +164,9 @@ | ||
| 165 | 164 | */ |
| 166 | 165 | protected static function _validateTypes( $types ) { |
| 167 | 166 | $allowed_types = array( 'string', 'number', 'boolean', 'date', 'datetime', 'timeofday' ); |
| 168 | 167 | foreach ( $types as $type ) { |
| 169 | - if ( !in_array( $type, $allowed_types ) ) { | |
| 168 | + if ( ! in_array( $type, $allowed_types ) ) { | |
| 170 | 169 | return false; |
| 171 | 170 | } |
| 172 | 171 | } |
| 173 | 172 | |
| @@ -180,9 +179,9 @@ | ||
| 180 | 179 | * @since 1.1.0 |
| 181 | 180 | * |
| 182 | 181 | * @access public |
| 183 | 182 | * @param array $series The actual array of series. |
| 184 | - * @param int $chart_id The chart id. | |
| 183 | + * @param int $chart_id The chart id. | |
| 185 | 184 | * @return array The re populated array of series or old one. |
| 186 | 185 | */ |
| 187 | 186 | public function repopulateSeries( $series, $chart_id ) { |
| 188 | 187 | return $series; |
| @@ -194,9 +193,9 @@ | ||
| 194 | 193 | * @since 1.1.0 |
| 195 | 194 | * |
| 196 | 195 | * @access public |
| 197 | 196 | * @param array $data The actual array of data. |
| 198 | - * @param int $chart_id The chart id. | |
| 197 | + * @param int $chart_id The chart id. | |
| 199 | 198 | * @return array The re populated array of data or old one. |
| 200 | 199 | */ |
| 201 | 200 | public function repopulateData( $data, $chart_id ) { |
| 202 | 201 | return $data; |
| @@ -201,5 +200,5 @@ | ||
| 201 | 200 | public function repopulateData( $data, $chart_id ) { |
| 202 | 201 | return $data; |
| 203 | 202 | } |
| 204 | 203 | |
| 205 | -} | |
| 204 | +} | |