Skip to content

Commit

Permalink
phpcs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanaldea89 committed Jan 4, 2024
1 parent e0b4a1d commit 02c9c9f
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 106 deletions.
Binary file added .DS_Store
Binary file not shown.
46 changes: 26 additions & 20 deletions class-dlm-as-hooks.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<?php

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Class DLM_AS_Hooks
* Handles all the hooks for the plugin
*
* @since 1.0.0
*/
class DLM_AS_Hooks {

/**
Expand All @@ -25,7 +32,7 @@ class DLM_AS_Hooks {
/**
* Constructor
*
* @param array $settings The settings.
* @param array $settings The settings.
*
* @since 1.0.0
*/
Expand All @@ -36,13 +43,12 @@ private function __construct( $settings ) {
/**
* Returns the singleton instance of the class.
*
* @param array $settings The settings.
* @param array $settings The settings.
*
* @return object The DLM_AS_Hooks object.
* @since 1.0.0
*/
public static function get_instance( $settings ) {

if ( ! isset( self::$instance ) && ! ( self::$instance instanceof DLM_AS_Hooks ) ) {
self::$instance = new DLM_AS_Hooks( $settings );
}
Expand All @@ -53,7 +59,7 @@ public static function get_instance( $settings ) {
/**
* Filter for reports server limits
*
* @param array $value The default value.
* @param array $value The default value.
*
* @return array
* @since 1.0.0
Expand All @@ -77,7 +83,7 @@ public function filter_dlm_reports_server_limits( $value ) {
/**
* Filter for XHR progress bar
*
* @param array $value The default value.
* @param array $value The default value.
*
* @return array
* @since 1.0.0
Expand All @@ -88,16 +94,16 @@ public function filter_dlm_xhr_progress( $value ) {
return $value;
}
// Return the new options.
$value['display'] = ! empty( $this->settings['dlm_xhr_progress']['display'] ) ? $this->settings['dlm_xhr_progress']['display'] : $value['display'];
$value['display'] = ! empty( $this->settings['dlm_xhr_progress']['display'] ) ? $this->settings['dlm_xhr_progress']['display'] : $value['display'];
$value['animation'] = ! empty( $this->settings['dlm_xhr_progress']['animation'] ) ? $this->settings['dlm_xhr_progress']['animation'] : $value['animation'];

return $value;
}

/**
* Filter for 404 redirect
*
* @param string $value The default value.
* @param string $value The default value.
*
* @return string
* @since 1.0.0
Expand All @@ -115,7 +121,7 @@ public function filter_dlm_404_redirect( $value ) {
/**
* Filter for placeholder image src
*
* @param string $value The default value.
* @param string $value The default value.
*
* @return string
* @since 1.0.0
Expand All @@ -133,7 +139,7 @@ public function filter_dlm_placeholder_image_src( $value ) {
/**
* Filer for restricted file types
*
* @param array $value The default value.
* @param array $value The default value.
*
* @return array
* @since 1.0.0
Expand All @@ -145,15 +151,15 @@ public function filter_dlm_restricted_file_types( array $value ) {
}
// The new files should be string with every file separated by a comma. Make an array from them.
$new_files = explode( ',', $this->settings['dlm_restricted_file_types'] );

// Send the merge between $value and $new_files.
return array_merge( $value, $new_files );
}

/**
* Filter for Reports
*
* @param bool $value The default value.
* @param bool $value The default value.
*
* @return bool
* @since 1.0.0
Expand All @@ -170,7 +176,7 @@ public function filter_dlm_enable_reports( $value ) {
/**
* Filter timestamp link
*
* @param bool $value The default value.
* @param bool $value The default value.
*
* @return bool
* @since 1.0.0
Expand All @@ -187,7 +193,7 @@ public function filter_dlm_timestamp_link( $value ) {
/**
* Filter for XHR downloads
*
* @param bool $value The default value.
* @param bool $value The default value.
*
* @return mixed
* @since 1.0.0
Expand All @@ -204,7 +210,7 @@ public function filter_dlm_do_xhr( $value ) {
/**
* Filter for meta version in header
*
* @param bool $value The default value.
* @param bool $value The default value.
*
* @return bool
* @since 1.0.0
Expand All @@ -221,7 +227,7 @@ public function filter_dlm_count_meta_downloads( $value ) {
/**
* Filter for meta version in header
*
* @param bool $value The default value.
* @param bool $value The default value.
*
* @return bool
* @since 1.0.0
Expand All @@ -233,7 +239,7 @@ public function filter_dlm_hide_meta_version( $value ) {
/**
* Filter for delete files when deleting a download
*
* @param bool $value The default value.
* @param bool $value The default value.
*
* @return bool
* @since 1.0.0
Expand All @@ -250,7 +256,7 @@ public function filter_dlm_delete_files( $value ) {
/**
* Filter for X-Accel-Redirect / X-Sendfile
*
* @param bool $value The default value.
* @param bool $value The default value.
*
* @return bool
* @since 1.0.0
Expand All @@ -267,7 +273,7 @@ public function filter_dlm_x_sendfile( $value ) {
/**
* Filter for preventing hot linking
*
* @param bool $value The default value.
* @param bool $value The default value.
*
* @return bool
* @since 1.0.0
Expand All @@ -284,7 +290,7 @@ public function filter_dlm_hotlink_protection( $value ) {
/**
* Filter for allowing proxy IP override
*
* @param bool $value The default value.
* @param bool $value The default value.
*
* @return bool
* @since 1.0.0
Expand Down
Loading

0 comments on commit 02c9c9f

Please sign in to comment.