Commit f0dfae5d authored by Michael Iseard's avatar Michael Iseard
Browse files

Minor formatting/comment changes

parent 13387706
......@@ -70,7 +70,7 @@ class Admin {
}
/**
* Create the Kudos Donations admin pages
* Create the Kudos Donations admin pages.
*
* @since 2.0.0
*/
......@@ -189,7 +189,7 @@ class Admin {
}
/**
* Assets specific to the Kudos Settings page
* Assets specific to the Kudos Settings page.
*
* @since 2.0.0
*/
......@@ -226,7 +226,7 @@ class Admin {
}
/**
* Assets common to all Kudos Table pages
* Assets common to all Kudos Table pages.
*
* @since 2.0.0
*/
......@@ -245,7 +245,7 @@ class Admin {
}
/**
* Assets specific to the Kudos Transactions page
* Assets specific to the Kudos Transactions page.
*
* @since 2.0.0
*/
......@@ -271,7 +271,7 @@ class Admin {
}
/**
* Assets specific to the Kudos Subscriptions page
* Assets specific to the Kudos Subscriptions page.
*
* @since 2.0.0
*/
......@@ -290,7 +290,7 @@ class Admin {
}
/**
* Assets specific to the Kudos Donors page
* Assets specific to the Kudos Donors page.
*
* @since 2.0.0
*/
......@@ -308,7 +308,7 @@ class Admin {
}
/**
* Assets specific to the Kudos Campaigns page
* Assets specific to the Kudos Campaigns page.
*
* @since 2.0.0
*/
......@@ -361,13 +361,13 @@ class Admin {
case 'kudos_clear_mollie':
$settings = new Settings();
$settings->remove_setting('vendor_mollie');
$settings->remove_setting( 'vendor_mollie' );
$settings->add_defaults();
break;
case 'kudos_clear_campaigns':
$settings = new Settings();
$settings->remove_setting('campaigns');
$settings->remove_setting( 'campaigns' );
$settings->add_defaults();
break;
......@@ -449,7 +449,7 @@ class Admin {
}
/**
* Register the kudos settings
* Register the kudos settings.
*
* @since 2.0.0
*/
......
......@@ -325,10 +325,10 @@ class DonorsTable extends WP_List_Table {
/**
* Returns an associative array containing the bulk action
*
* @return array|string
* @return array
* @since 2.0.0
*/
protected function get_bulk_actions() {
protected function get_bulk_actions(): array {
return [
'bulk-delete' => __( 'Delete', 'kudos-donations' ),
];
......
......@@ -473,10 +473,10 @@ class TransactionsTable extends WP_List_Table {
/**
* Returns an associative array containing the bulk action
*
* @return array|string
* @return array
* @since 1.0.0
*/
protected function get_bulk_actions() {
protected function get_bulk_actions(): array {
return [
'bulk-delete' => __( 'Delete', 'kudos-donations' ),
......
......@@ -48,7 +48,7 @@ $tab = $_GET['tab'] ?? $default_tab;
?>
<p>This logfile location: <?php echo esc_url( $file ); ?></p>
<p>Current filesize: <?php echo Utils::human_filesize((int) filesize( $file )); ?></p>
<p>Current filesize: <?php echo Utils::human_filesize( (int) filesize( $file ) ); ?></p>
<form style="display:inline-block;" action="<?php echo esc_url( $url ); ?>"
method='post'>
......
......@@ -143,7 +143,7 @@ class ActivatorService {
if ( version_compare( $old_version, '2.4.1', '<' ) ) {
// Cast connected variable as boolean
$vendor_settings = Settings::get_setting('vendor_mollie');
$connected = !empty($vendor_settings['connected']) ? (bool) $vendor_settings['connected'] : false;
$connected = ! empty( $vendor_settings['connected'] ) && $vendor_settings['connected'];
Settings::update_array('vendor_mollie', [
'connected' => $connected
]);
......
......@@ -181,10 +181,10 @@ class MapperService extends AbstractService {
*
* @param bool $prefix Whether to return the prefix or not.
*
* @return string|false
* @return string
* @since 2.0.0
*/
public function get_table_name( $prefix = true ) {
public function get_table_name( $prefix = true ): string {
return $this->get_repository()::get_table_name( $prefix );
......@@ -193,10 +193,10 @@ class MapperService extends AbstractService {
/**
* Gets the current repository
*
* @return AbstractEntity|string
* @return string
* @since 2.0.5
*/
public function get_repository() {
public function get_repository(): ?string {
if ( null === $this->repository ) {
$this->logger->warning( 'Failed to get repository.' );
......
......@@ -54,9 +54,9 @@ class PaymentService extends AbstractService {
/**
* Returns the name of the current vendor.
*
* @return mixed
* @return string
*/
public static function get_vendor_name() {
public static function get_vendor_name(): string {
return static::get_current_vendor_class()::get_vendor_name();
}
......@@ -130,7 +130,7 @@ class PaymentService extends AbstractService {
$values = $request->get_json_params();
// Add submit action and pass form data.
do_action('kudos_submit_payment', $values);
do_action( 'kudos_submit_payment', $values );
// Assign form fields.
$value = $values['value'];
......@@ -183,7 +183,7 @@ class PaymentService extends AbstractService {
$customer_id = $donor->customer_id ?? null;
do_action('kudos_payment_submit_successful', $values);
do_action( 'kudos_payment_submit_successful', $values );
$result = $this->create_payment(
$value,
......@@ -198,7 +198,7 @@ class PaymentService extends AbstractService {
// Return checkout url if payment successfully created in Mollie
if ( $result instanceof Payment ) {
do_action('kudos_payment_submit_successful', $values);
do_action( 'kudos_payment_submit_successful', $values );
wp_send_json_success( $result->getCheckoutUrl() );
}
......
......@@ -88,7 +88,7 @@ function run_kudos() {
// Check compatibility and run kudos if OK
$compatibility = new CompatibilityService();
$continue = $compatibility->init();
$continue = $compatibility->init();
if ( $continue ) {
$plugin = new KudosDonations();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment