Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore phpcs file system errors #7725

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions includes/admin/class-sensei-status.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ private function get_template_version( $file ) {
}

// Read the first 8kb of the file.
$fp = fopen( $file, 'r' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen -- Read only open.
$file_data = fread( $fp, 8192 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fread
fclose( $fp ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose
$fp = fopen( $file, 'r' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen -- Read only open.
$file_data = fread( $fp, 8192 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fread
fclose( $fp ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose

// Make sure we catch CR-only line endings.
$file_data = str_replace( "\r", "\n", $file_data );
Expand Down
2 changes: 1 addition & 1 deletion includes/class-sensei-analysis.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ public function report_write_download( $report_data = array() ) {
foreach ( $report_data as $row ) {
fputcsv( $fp, $row );
}
fclose( $fp );
fclose( $fp ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
}

/**
Expand Down
Loading