← All changes
|
includes/donations/class-charitable-donation-report.php
+19
-16
1.6.8
→
1.8.13
View file →
| @@ -2,10 +2,10 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Model for generating a donation report. |
| 4 | 4 | * |
| 5 | 5 | * @package Charitable/Classes/Charitable_Donation_Report |
| 6 | - * @author Eric Daams | |
| 7 | - * @copyright Copyright (c) 2019, Studio 164a | |
| 6 | + * @author David Bisset | |
| 7 | + * @copyright Copyright (c) 2023, WP Charitable LLC | |
| 8 | 8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | 9 | * @since 1.6.0 |
| 10 | 10 | * @version 1.6.0 |
| 11 | 11 | */ |
| @@ -81,9 +81,9 @@ | ||
| 81 | 81 | return $this->reports; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | foreach ( $this->types as $type ) { |
| 85 | - if ( in_array( $type, $this->args['report_type'] ) ) { | |
| 85 | + if ( in_array( $type, $this->args['report_type'] ) ) { // phpcs:ignore | |
| 86 | 86 | $this->reports[ $type ] = $this->run_report_query( $type ); |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | } |
| @@ -150,13 +150,15 @@ | ||
| 150 | 150 | * |
| 151 | 151 | * @return int |
| 152 | 152 | */ |
| 153 | 153 | private function run_donation_query() { |
| 154 | - $query = new Charitable_Donations_Query( array( | |
| 155 | - 'output' => 'count', | |
| 156 | - 'campaign' => $this->args['campaigns'], | |
| 157 | - 'status' => $this->args['status'], | |
| 158 | - ) ); | |
| 154 | + $query = new Charitable_Donations_Query( | |
| 155 | + array( | |
| 156 | + 'output' => 'count', | |
| 157 | + 'campaign' => $this->args['campaigns'], | |
| 158 | + 'status' => $this->args['status'], | |
| 159 | + ) | |
| 160 | + ); | |
| 159 | 161 | |
| 160 | 162 | return $query->count(); |
| 161 | 163 | } |
| 162 | 164 | |
| @@ -167,13 +169,15 @@ | ||
| 167 | 169 | * |
| 168 | 170 | * @return int |
| 169 | 171 | */ |
| 170 | 172 | private function run_donor_query() { |
| 171 | - $query = new Charitable_Donor_Query( array( | |
| 172 | - 'output' => 'count', | |
| 173 | - 'campaign' => $this->args['campaigns'], | |
| 174 | - 'status' => $this->args['status'], | |
| 175 | - ) ); | |
| 173 | + $query = new Charitable_Donor_Query( | |
| 174 | + array( | |
| 175 | + 'output' => 'count', | |
| 176 | + 'campaign' => $this->args['campaigns'], | |
| 177 | + 'status' => $this->args['status'], | |
| 178 | + ) | |
| 179 | + ); | |
| 176 | 180 | |
| 177 | 181 | return $query->count(); |
| 178 | 182 | } |
| 179 | 183 | |
| @@ -198,9 +202,8 @@ | ||
| 198 | 202 | |
| 199 | 203 | return $args; |
| 200 | 204 | } |
| 201 | 205 | |
| 202 | - | |
| 203 | 206 | /** |
| 204 | 207 | * Parse campaigns argument. |
| 205 | 208 | * |
| 206 | 209 | * @since 1.6.0 |
| @@ -224,9 +227,9 @@ | ||
| 224 | 227 | * @param string|array $report_type The type of report to get. May be a string or an array of strings. |
| 225 | 228 | * @return array|false |
| 226 | 229 | */ |
| 227 | 230 | private function parse_report_type( $report_type ) { |
| 228 | - if ( 'all' == $report_type ) { | |
| 231 | + if ( 'all' == $report_type ) { // phpcs:ignore | |
| 229 | 232 | return $this->types; |
| 230 | 233 | } |
| 231 | 234 | |
| 232 | 235 | if ( is_array( $report_type ) ) { |
| @@ -232,9 +235,9 @@ | ||
| 232 | 235 | if ( is_array( $report_type ) ) { |
| 233 | 236 | return $report_type; |
| 234 | 237 | } |
| 235 | 238 | |
| 236 | - if ( ! in_array( $report_type, $this->types ) ) { | |
| 239 | + if ( ! in_array( $report_type, $this->types ) ) { // phpcs:ignore | |
| 237 | 240 | charitable_get_deprecated()->doing_it_wrong( |
| 238 | 241 | __METHOD__, |
| 239 | 242 | /* translators: %s: report type */ |
| 240 | 243 | sprintf( __( '%s is not a valid donation report type.', 'charitable' ), $report_type ), |