| @@ -108,9 +108,9 @@ | ||
| 108 | 108 | * @abstract |
| 109 | 109 | * @access public |
| 110 | 110 | * @return string The name of source. |
| 111 | 111 | */ |
| 112 | - abstract public function getSourceName(); | |
| 112 | + public abstract function getSourceName(); | |
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * Fetches information from source, parses it and builds series and data arrays. |
| 116 | 116 | * |
| @@ -118,9 +118,9 @@ | ||
| 118 | 118 | * |
| 119 | 119 | * @abstract |
| 120 | 120 | * @access public |
| 121 | 121 | */ |
| 122 | - abstract public function fetch(); | |
| 122 | + public abstract function fetch(); | |
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | 125 | * Returns series parsed from source. |
| 126 | 126 | * |
| @@ -217,9 +217,8 @@ | ||
| 217 | 217 | continue; |
| 218 | 218 | } |
| 219 | 219 | switch ( $series['type'] ) { |
| 220 | 220 | case 'number': |
| 221 | - $data[ $i ] = preg_replace( '/[\x{200B}-\x{200D}\x{FEFF}]/u', '', $data[ $i ] ); | |
| 222 | 221 | $data[ $i ] = ( is_numeric( $data[ $i ] ) ) ? floatval( $data[ $i ] ) : ( is_numeric( str_replace( ',', '', $data[ $i ] ) ) ? floatval( str_replace( ',', '', $data[ $i ] ) ) : null ); |
| 223 | 222 | break; |
| 224 | 223 | case 'boolean': |
| 225 | 224 | $datum = trim( strval( $data[ $i ] ) ); |
| @@ -262,9 +261,9 @@ | ||
| 262 | 261 | * @param string $datum The data to convert. |
| 263 | 262 | * |
| 264 | 263 | * @return string The converted data. |
| 265 | 264 | */ |
| 266 | - final protected function toUTF8( $datum ) { | |
| 265 | + protected final function toUTF8( $datum ) { | |
| 267 | 266 | if ( ! function_exists( 'mb_detect_encoding' ) || mb_detect_encoding( $datum ) !== 'ASCII' ) { |
| 268 | 267 | $datum = \ForceUTF8\Encoding::toUTF8( $datum ); |
| 269 | 268 | } |
| 270 | 269 | return $datum; |
| @@ -279,9 +278,9 @@ | ||
| 279 | 278 | * @param array $data The actual array of data. |
| 280 | 279 | * |
| 281 | 280 | * @return array |
| 282 | 281 | */ |
| 283 | - final public static function get_date_formats_if_exists( $series, $data ) { | |
| 282 | + public static final function get_date_formats_if_exists( $series, $data ) { | |
| 284 | 283 | $date_formats = array(); |
| 285 | 284 | $types = array(); |
| 286 | 285 | $index = 0; |
| 287 | 286 | foreach ( $series as $column ) { |
| @@ -287,9 +286,9 @@ | ||
| 287 | 286 | foreach ( $series as $column ) { |
| 288 | 287 | if ( in_array( $column['type'], array( 'date', 'datetime', 'timeofday' ), true ) ) { |
| 289 | 288 | $types[] = array( 'index' => $index, 'type' => $column['type'] ); |
| 290 | 289 | } |
| 291 | - ++$index; | |
| 290 | + $index++; | |
| 292 | 291 | } |
| 293 | 292 | |
| 294 | 293 | if ( ! $types ) { |
| 295 | 294 | return $date_formats; |
| @@ -428,9 +427,9 @@ | ||
| 428 | 427 | if ( $headers ) { |
| 429 | 428 | foreach ( $headers as $header ) { |
| 430 | 429 | if ( ! empty( $types[ $header ] ) ) { |
| 431 | 430 | $this->_series[] = array( |
| 432 | - 'label' => sanitize_text_field( wp_strip_all_tags( $header ) ), | |
| 431 | + 'label' => $header, | |
| 433 | 432 | 'type' => $types[ $header ], |
| 434 | 433 | ); |
| 435 | 434 | } |
| 436 | 435 | } |
| @@ -473,5 +472,7 @@ | ||
| 473 | 472 | do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Data found for %s = %s', print_r( $this->_args, true ), print_r( $this->_data, true ) ), 'debug', __FILE__, __LINE__ ); |
| 474 | 473 | |
| 475 | 474 | return true; |
| 476 | 475 | } |
| 476 | + | |
| 477 | + | |
| 477 | 478 | } |