PHPCS passing for abstract-wc-csv-exporter.php

This commit is contained in:
Gerhard Potgieter 2018-03-06 07:55:15 +02:00
parent 1c191688f8
commit 38892f3067
1 changed files with 7 additions and 8 deletions

View File

@ -74,7 +74,7 @@ abstract class WC_CSV_Exporter {
/** /**
* Prepare data that will be exported. * Prepare data that will be exported.
*/ */
abstract function prepare_data_to_export(); abstract public function prepare_data_to_export();
/** /**
* Return an array of supported column names and ids. * Return an array of supported column names and ids.
@ -171,7 +171,7 @@ abstract class WC_CSV_Exporter {
*/ */
public function send_headers() { public function send_headers() {
if ( function_exists( 'gc_enable' ) ) { if ( function_exists( 'gc_enable' ) ) {
gc_enable(); gc_enable(); // phpcs:ignore PHPCompatibility.PHP.NewFunctions.gc_enableFound
} }
if ( function_exists( 'apache_setenv' ) ) { if ( function_exists( 'apache_setenv' ) ) {
@apache_setenv( 'no-gzip', 1 ); // @codingStandardsIgnoreLine @apache_setenv( 'no-gzip', 1 ); // @codingStandardsIgnoreLine
@ -192,7 +192,6 @@ abstract class WC_CSV_Exporter {
* Set filename to export to. * Set filename to export to.
* *
* @param string $filename Filename to export to. * @param string $filename Filename to export to.
* @return string
*/ */
public function set_filename( $filename ) { public function set_filename( $filename ) {
$this->filename = sanitize_file_name( str_replace( '.csv', '', $filename ) . '.csv' ); $this->filename = sanitize_file_name( str_replace( '.csv', '', $filename ) . '.csv' );
@ -236,7 +235,7 @@ abstract class WC_CSV_Exporter {
protected function export_column_headers() { protected function export_column_headers() {
$columns = $this->get_column_names(); $columns = $this->get_column_names();
$export_row = array(); $export_row = array();
$buffer = fopen( 'php://output', 'w' ); $buffer = fopen( 'php://output', 'w' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen
ob_start(); ob_start();
foreach ( $columns as $column_id => $column_name ) { foreach ( $columns as $column_id => $column_name ) {
@ -269,7 +268,7 @@ abstract class WC_CSV_Exporter {
*/ */
protected function export_rows() { protected function export_rows() {
$data = $this->get_data_to_export(); $data = $this->get_data_to_export();
$buffer = fopen( 'php://output', 'w' ); $buffer = fopen( 'php://output', 'w' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen
ob_start(); ob_start();
array_walk( $data, array( $this, 'export_row' ), $buffer ); array_walk( $data, array( $this, 'export_row' ), $buffer );