Skip to content

Commit fc67f04

Browse files
committed
styling
1 parent 064fc2a commit fc67f04

File tree

10 files changed

+54
-54
lines changed

10 files changed

+54
-54
lines changed

src/Abstracts/Middleware.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function skip($request)
4444
return true;
4545
}
4646

47-
if (!$this->isMethod()) {
47+
if (! $this->isMethod()) {
4848
return true;
4949
}
5050

@@ -72,7 +72,7 @@ public function check($patterns)
7272
$log = null;
7373

7474
foreach ($patterns as $pattern) {
75-
if (!$match = $this->match($pattern, $this->request->input())) {
75+
if (! $match = $this->match($pattern, $this->request->input())) {
7676
continue;
7777
}
7878

@@ -94,11 +94,11 @@ public function match($pattern, $input)
9494
{
9595
$result = false;
9696

97-
if (!is_array($input) && !is_string($input)) {
97+
if (! is_array($input) && !is_string($input)) {
9898
return false;
9999
}
100100

101-
if (!is_array($input)) {
101+
if (! is_array($input)) {
102102
$input = $this->prepareInput($input);
103103

104104
return preg_match($pattern, $input);
@@ -117,13 +117,13 @@ public function match($pattern, $input)
117117
break;
118118
}
119119

120-
if (!$this->isInput($key)) {
120+
if (! $this->isInput($key)) {
121121
continue;
122122
}
123123

124124
$value = $this->prepareInput($value);
125125

126-
if (!$result = preg_match($pattern, $value)) {
126+
if (! $result = preg_match($pattern, $value)) {
127127
continue;
128128
}
129129

src/Middleware/Agent.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ public function check($patterns)
2020
$status = true;
2121
}
2222

23-
if (!$status && $this->isBrowser()) {
23+
if (! $status && $this->isBrowser()) {
2424
$status = true;
2525
}
2626

27-
if (!$status && $this->isPlatform()) {
27+
if (! $status && $this->isPlatform()) {
2828
$status = true;
2929
}
3030

31-
if (!$status && $this->isDevice()) {
31+
if (! $status && $this->isDevice()) {
3232
$status = true;
3333
}
3434

35-
if (!$status && $this->isProperty()) {
35+
if (! $status && $this->isProperty()) {
3636
$status = true;
3737
}
3838

@@ -60,7 +60,7 @@ protected function isMalicious()
6060
];
6161

6262
foreach ($patterns as $pattern) {
63-
if (!preg_match($pattern, $agent) == 1) {
63+
if (! preg_match($pattern, $agent) == 1) {
6464
continue;
6565
}
6666

@@ -72,11 +72,11 @@ protected function isMalicious()
7272

7373
protected function isBrowser()
7474
{
75-
if (!$browsers = config('firewall.middleware.' . $this->middleware . '.browsers')) {
75+
if (! $browsers = config('firewall.middleware.' . $this->middleware . '.browsers')) {
7676
return false;
7777
}
7878

79-
if (!empty($browsers['allow']) && !in_array((string) $this->parser->browser(), (array) $browsers['allow'])) {
79+
if (! empty($browsers['allow']) && ! in_array((string) $this->parser->browser(), (array) $browsers['allow'])) {
8080
return true;
8181
}
8282

@@ -89,11 +89,11 @@ protected function isBrowser()
8989

9090
protected function isPlatform()
9191
{
92-
if (!$platforms = config('firewall.middleware.' . $this->middleware . '.platforms')) {
92+
if (! $platforms = config('firewall.middleware.' . $this->middleware . '.platforms')) {
9393
return false;
9494
}
9595

96-
if (!empty($platforms['allow']) && !in_array((string) $this->parser->platform(), (array) $platforms['allow'])) {
96+
if (! empty($platforms['allow']) && ! in_array((string) $this->parser->platform(), (array) $platforms['allow'])) {
9797
return true;
9898
}
9999

@@ -106,14 +106,14 @@ protected function isPlatform()
106106

107107
protected function isDevice()
108108
{
109-
if (!$devices = config('firewall.middleware.' . $this->middleware . '.devices')) {
109+
if (! $devices = config('firewall.middleware.' . $this->middleware . '.devices')) {
110110
return false;
111111
}
112112

113113
$list = ['Desktop', 'Mobile', 'Tablet'];
114114

115115
foreach ((array) $devices['allow'] as $allow) {
116-
if (!in_array($allow, $list)) {
116+
if (! in_array($allow, $list)) {
117117
continue;
118118
}
119119

@@ -127,7 +127,7 @@ protected function isDevice()
127127
}
128128

129129
foreach ((array) $devices['block'] as $block) {
130-
if (!in_array($block, $list)) {
130+
if (! in_array($block, $list)) {
131131
continue;
132132
}
133133

@@ -145,7 +145,7 @@ protected function isDevice()
145145

146146
protected function isProperty()
147147
{
148-
if (!$agents = config('firewall.middleware.' . $this->middleware . '.properties')) {
148+
if (! $agents = config('firewall.middleware.' . $this->middleware . '.properties')) {
149149
return false;
150150
}
151151

@@ -158,7 +158,7 @@ protected function isProperty()
158158
}
159159

160160
foreach ((array) $agents['block'] as $block) {
161-
if (!$this->parser->is((string) $block)) {
161+
if (! $this->parser->is((string) $block)) {
162162
continue;
163163
}
164164

src/Middleware/Bot.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ public function check($patterns)
1212
{
1313
$agent = new Agent();
1414

15-
if (!$agent->isRobot()) {
15+
if (! $agent->isRobot()) {
1616
return false;
1717
}
1818

19-
if (!$crawlers = config('firewall.middleware.' . $this->middleware . '.crawlers')) {
19+
if (! $crawlers = config('firewall.middleware.' . $this->middleware . '.crawlers')) {
2020
return false;
2121
}
2222

2323
$status = false;
2424

25-
if (!empty($crawlers['allow']) && !in_array((string) $agent->robot(), (array) $crawlers['allow'])) {
25+
if (! empty($crawlers['allow']) && ! in_array((string) $agent->robot(), (array) $crawlers['allow'])) {
2626
$status = true;
2727
}
2828

src/Middleware/Geo.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ public function check($patterns)
1515
return false;
1616
}
1717

18-
if (!$location = $this->getLocation()) {
18+
if (! $location = $this->getLocation()) {
1919
return false;
2020
}
2121

2222
foreach ($places as $place) {
23-
if (!$this->isFiltered($location, $place)) {
23+
if (! $this->isFiltered($location, $place)) {
2424
continue;
2525
}
2626

@@ -33,7 +33,7 @@ public function check($patterns)
3333
protected function isEmpty($places)
3434
{
3535
foreach ($places as $place) {
36-
if (!$list = config('firewall.middleware.' . $this->middleware . '.' . $place)) {
36+
if (! $list = config('firewall.middleware.' . $this->middleware . '.' . $place)) {
3737
continue;
3838
}
3939

@@ -49,13 +49,13 @@ protected function isEmpty($places)
4949

5050
protected function isFiltered($location, $place)
5151
{
52-
if (!$list = config('firewall.middleware.' . $this->middleware . '.' . $place)) {
52+
if (! $list = config('firewall.middleware.' . $this->middleware . '.' . $place)) {
5353
return false;
5454
}
5555

5656
$s_place = Str::singular($place);
5757

58-
if (!empty($list['allow']) && !in_array((string) $location->$s_place, (array) $list['allow'])) {
58+
if (! empty($list['allow']) && ! in_array((string) $location->$s_place, (array) $list['allow'])) {
5959
return true;
6060
}
6161

@@ -128,7 +128,7 @@ protected function ipdata($location)
128128
{
129129
$response = $this->getResponse('https://api.ipdata.co/' . $this->ip() . '?api-key=' . env('IPSTACK_KEY'));
130130

131-
if (!is_object($response) || empty($response->country_name) || empty($response->region_name)) {
131+
if (! is_object($response) || empty($response->country_name) || empty($response->region_name)) {
132132
return false;
133133
}
134134

@@ -144,7 +144,7 @@ protected function ipinfo($location)
144144
{
145145
$response = $this->getResponse('https://ipinfo.io/' . $this->ip() . '/geo?token=' . env('IPINFO_KEY'));
146146

147-
if (!is_object($response) || empty($response->country) || empty($response->city)) {
147+
if (! is_object($response) || empty($response->country) || empty($response->city)) {
148148
return false;
149149
}
150150

@@ -165,7 +165,7 @@ protected function getResponse($url)
165165
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
166166
$content = curl_exec($ch);
167167
curl_close($ch);
168-
168+
169169
$response = json_decode($content);
170170
} catch (\ErrorException $e) {
171171
$response = null;

src/Middleware/Php.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ public function match($pattern, $input)
1010
{
1111
$result = false;
1212

13-
if (!is_array($input) && !is_string($input)) {
13+
if (! is_array($input) && ! is_string($input)) {
1414
return false;
1515
}
1616

17-
if (!is_array($input)) {
17+
if (! is_array($input)) {
1818
return (stripos($input, $pattern) === 0);
1919
}
2020

@@ -24,18 +24,18 @@ public function match($pattern, $input)
2424
}
2525

2626
if (is_array($value)) {
27-
if (!$result = $this->match($pattern, $value)) {
27+
if (! $result = $this->match($pattern, $value)) {
2828
continue;
2929
}
3030

3131
break;
3232
}
3333

34-
if (!$this->isInput($key)) {
34+
if (! $this->isInput($key)) {
3535
continue;
3636
}
3737

38-
if (!$result = (stripos($value, $pattern) === 0)) {
38+
if (! $result = (stripos($value, $pattern) === 0)) {
3939
continue;
4040
}
4141

src/Middleware/Referrer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function check($patterns)
1111
{
1212
$status = false;
1313

14-
if (!$blocked = config('firewall.middleware.' . $this->middleware . '.blocked')) {
14+
if (! $blocked = config('firewall.middleware.' . $this->middleware . '.blocked')) {
1515
return $status;
1616
}
1717

src/Middleware/Rfi.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public function match($pattern, $input)
1010
{
1111
$result = false;
1212

13-
if (!is_array($input) && !is_string($input)) {
13+
if (! is_array($input) && ! is_string($input)) {
1414
return false;
1515
}
1616

17-
if (!is_array($input)) {
18-
if (!$result = preg_match($pattern, $this->applyExceptions($input))) {
17+
if (! is_array($input)) {
18+
if (! $result = preg_match($pattern, $this->applyExceptions($input))) {
1919
return false;
2020
}
2121

@@ -28,22 +28,22 @@ public function match($pattern, $input)
2828
}
2929

3030
if (is_array($value)) {
31-
if (!$result = $this->match($pattern, $value)) {
31+
if (! $result = $this->match($pattern, $value)) {
3232
continue;
3333
}
3434

3535
break;
3636
}
3737

38-
if (!$this->isInput($key)) {
38+
if (! $this->isInput($key)) {
3939
continue;
4040
}
4141

42-
if (!$result = preg_match($pattern, $this->applyExceptions($value))) {
42+
if (! $result = preg_match($pattern, $this->applyExceptions($value))) {
4343
continue;
4444
}
4545

46-
if (!$this->checkContent($result)) {
46+
if (! $this->checkContent($result)) {
4747
continue;
4848
}
4949

src/Middleware/Swear.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function getPatterns()
1010
{
1111
$patterns = [];
1212

13-
if (!$words = config('firewall.middleware.' . $this->middleware . '.words')) {
13+
if (! $words = config('firewall.middleware.' . $this->middleware . '.words')) {
1414
return $patterns;
1515
}
1616

src/Middleware/Url.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public function check($patterns)
1111
{
1212
$protected = false;
1313

14-
if (!$inspections = config('firewall.middleware.' . $this->middleware . '.inspections')) {
14+
if (! $inspections = config('firewall.middleware.' . $this->middleware . '.inspections')) {
1515
return $protected;
1616
}
1717

1818
foreach ($inspections as $inspection) {
19-
if (!$this->request->is($inspection)) {
19+
if (! $this->request->is($inspection)) {
2020
continue;
2121
}
2222

0 commit comments

Comments
 (0)