@@ -72,7 +72,7 @@ |
||
72 | 72 | ->cannotBeEmpty() |
73 | 73 | ->defaultNull() |
74 | 74 | ->validate() |
75 | - ->ifTrue(function ($v) { |
|
75 | + ->ifTrue(function($v) { |
|
76 | 76 | if (!class_exists($v)) { |
77 | 77 | return true; |
78 | 78 | } |
@@ -65,11 +65,11 @@ |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | if ('rate-limit-asc' === $config['throttle']['sort']) { |
68 | - uasort($config['throttle']['roles'], function (array $a, array $b) { |
|
68 | + uasort($config['throttle']['roles'], function(array $a, array $b) { |
|
69 | 69 | return ($a['limit'] / $a['period']) <=> ($b['limit'] / $b['period']); |
70 | 70 | }); |
71 | 71 | } elseif ('rate-limit-desc' === $config['throttle']['sort']) { |
72 | - uasort($config['throttle']['roles'], function (array $a, array $b) { |
|
72 | + uasort($config['throttle']['roles'], function(array $a, array $b) { |
|
73 | 73 | return ($b['limit'] / $b['period']) <=> ($a['limit'] / $a['period']); |
74 | 74 | }); |
75 | 75 | } |
@@ -127,7 +127,7 @@ |
||
127 | 127 | public static function generateCacheKey(string $ip, string $username = null, string $userRole = null): string |
128 | 128 | { |
129 | 129 | if (!empty($username) && !empty($userRole)) { |
130 | - return sprintf('_api_rate_limit_metadata$%s', sha1($userRole . $username)); |
|
130 | + return sprintf('_api_rate_limit_metadata$%s', sha1($userRole.$username)); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | return sprintf('_api_rate_limit_metadata$%s', sha1($ip)); |