Skip to content

Commit 39bf718

Browse files
committed
fix phpcs
1 parent 78d22ad commit 39bf718

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

plugins/wporg-5ftf/includes/reports.php

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
/*
3+
/**
44
* List of contributors and useful stats around it.
55
*/
66

@@ -18,7 +18,7 @@
1818
add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );
1919
add_action( 'admin_init', __NAMESPACE__ . '\export_csv' );
2020

21-
/*
21+
/**
2222
* Register admin page.
2323
*/
2424
function add_admin_pages() {
@@ -32,7 +32,7 @@ function add_admin_pages() {
3232
);
3333
}
3434

35-
/*
35+
/**
3636
* Enqueue assets/
3737
*/
3838
function enqueue_assets() {
@@ -51,14 +51,14 @@ function enqueue_assets() {
5151
}
5252
}
5353

54-
/*
54+
/**
5555
* Render results and download button.
5656
*/
5757
function render_company_report_page() {
5858

5959
$status = sanitize_title( $_GET['status'] );
6060

61-
if ( ! in_array( $status, [ 'draft', '5ftf-deactivated', 'publish' ] ) ) {
61+
if ( ! in_array( $status, array( 'draft','5ftf-deactivated','publish' ) ) ) {
6262
$status = 'all';
6363
}
6464

@@ -87,9 +87,9 @@ function render_company_report_page() {
8787

8888
<form action="#" method="post">
8989
<input type="hidden" name="wporg-5ftf-cr" value="1">
90-
<input type="hidden" name="status" value="<?php echo $status; ?>">
90+
<input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>">
9191
<input type="submit" value="Export">
92-
<?php echo wp_nonce_field( '5ftf_download_company_report' ); ?>
92+
<?php wp_nonce_field( '5ftf_download_company_report' ); ?>
9393
</form>
9494

9595
<table id="wporg-5ftf-company-report">
@@ -140,10 +140,8 @@ function render_company_report_page() {
140140
echo ' <td>' . esc_html( $email ). '</td>';
141141
echo ' <td>' . esc_html( $date_created ) . '</td>';
142142
echo ' <td>' . esc_html( $date_modified ) . '</td>';
143-
144143
echo '</tr>';
145-
$export_data[] = [ $pledge->post_title, $pledge->post_status, $hours, $contributors, $usernames, $teams, $company_url, $pledge_url, $email, $date_created, $date_modified ];
146-
144+
$export_data[] = array( $pledge->post_title, $pledge->post_status, $hours, $contributors, $usernames, $teams, $company_url, $pledge_url, $email, $date_created, $date_modified );
147145
}
148146
echo '</table>';
149147
echo '<p>Total contributors: ' . esc_html( $all_contributors ) . '</p>';
@@ -152,7 +150,7 @@ function render_company_report_page() {
152150
set_transient( 'wporg_5ftf_company_report_' . $status, $export_data, 60 );
153151
}
154152

155-
/*
153+
/**
156154
* CSV export runner, grabs data lazily from a transient.
157155
* @param $data array.
158156
*/
@@ -172,7 +170,7 @@ function export_csv() {
172170

173171
$exporter = new Export_CSV( array(
174172
'filename' => 'company-report-' . $status,
175-
'headers' => array( 'Company', 'Status', 'Hours', 'Contributors', 'Users', 'Teams', 'Company URL', 'Pledge URL', 'Email', 'Created', 'Last updated' ),
173+
'headers' => array( 'Company','Status','Hours','Contributors','Users','Teams','Company URL','Pledge URL','Email','Created','Last updated' ),
176174
'data' => $data,
177175
) );
178176

0 commit comments

Comments
 (0)