diff --git a/.php_cs.cache b/.php_cs.cache new file mode 100644 index 0000000..a16be59 --- /dev/null +++ b/.php_cs.cache @@ -0,0 +1 @@ +{"php":"7.1.10","version":"2.7.1:v2.7.1#ab2e189d94698178988f9732bc75bb4ce8d16f77","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_constants":true,"lowercase_keywords":true,"method_argument_space":{"ensure_fully_multiline":true},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true},"hashes":{"\/config\/throttleable.php":1719320333,"\/src\/Models\/Throttle.php":594379226,"\/src\/Providers\/ThrottleableServiceProvider.php":2018943658,"\/src\/Traits\/Throttleable.php":1858438076}} \ No newline at end of file diff --git a/src/Models/Throttle.php b/src/Models/Throttle.php index 162ee10..55e61d6 100644 --- a/src/Models/Throttle.php +++ b/src/Models/Throttle.php @@ -42,5 +42,4 @@ public function __construct($request, $attemptLimit = null, $expiryWeeks = null) $this->expiryMetric = $expiryMetric ?? config('throttleable.expiry_metric'); $this->expiryTimeLimit = $expiryTimeLimit ?? config('throttleable.expiry_timelimit'); } - } diff --git a/src/Providers/ThrottleableServiceProvider.php b/src/Providers/ThrottleableServiceProvider.php index 65ffa2c..73df95d 100644 --- a/src/Providers/ThrottleableServiceProvider.php +++ b/src/Providers/ThrottleableServiceProvider.php @@ -34,7 +34,8 @@ public function boot() public function register() { $this->mergeConfigFrom( - __DIR__ . '/../../config/throttleable.php', 'throttleable' + __DIR__ . '/../../config/throttleable.php', + 'throttleable' ); } } diff --git a/src/Traits/Throttleable.php b/src/Traits/Throttleable.php index 2faae6d..13a46d4 100644 --- a/src/Traits/Throttleable.php +++ b/src/Traits/Throttleable.php @@ -5,7 +5,7 @@ use Illuminate\Http\Request; use MadMikeyB\Throttleable\Models\Throttle; -trait Throttleable +trait Throttleable { /** * Check if the IP address exists in the throttles table @@ -57,8 +57,7 @@ protected function createThrottle() { $this->ip = $this->request->ip(); $this->attempts = 0; - switch ($this->expiryMetric) - { + switch ($this->expiryMetric) { case 'hour': $this->expires_at = Carbon::now()->addHours($this->expiryTimeLimit); break;