Skip to content

Commit 001fe29

Browse files
authored
Merge pull request #18 from rappasoft/analysis-A7oB5k
Apply fixes from StyleCI
2 parents 3653599 + 94b4a9e commit 001fe29

File tree

12 files changed

+26
-33
lines changed

12 files changed

+26
-33
lines changed

src/Console/Commands/LockoutDisable.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,3 @@ public function handle(): int
6262
return Command::SUCCESS;
6363
}
6464
}
65-

src/Console/Commands/LockoutEnable.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,3 @@ public function handle(): int
6262
return Command::SUCCESS;
6363
}
6464
}
65-

src/Console/Commands/LockoutStatus.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,3 @@ public function handle(): int
4747
return Command::SUCCESS;
4848
}
4949
}
50-

src/Events/LockoutDisabled.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ public function __construct()
1717
//
1818
}
1919
}
20-

src/Events/LockoutEnabled.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ public function __construct()
1717
//
1818
}
1919
}
20-

src/Events/RequestBlocked.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Rappasoft\Lockout\Events;
44

55
use Illuminate\Foundation\Events\Dispatchable;
6-
use Illuminate\Queue\SerializesModels;
76
use Illuminate\Http\Request;
7+
use Illuminate\Queue\SerializesModels;
88

99
class RequestBlocked
1010
{
@@ -20,4 +20,3 @@ public function __construct(
2020
//
2121
}
2222
}
23-

src/Helpers/IpHelper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,3 @@ public static function parseIpList(?string $ipList): array
8989
return array_map('trim', explode(',', $ipList));
9090
}
9191
}
92-

tests/AdvancedFeaturesTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
namespace Rappasoft\Lockout\Tests;
44

55
use Illuminate\Http\Response;
6-
use Rappasoft\Lockout\Events\LockoutDisabled;
7-
use Rappasoft\Lockout\Events\LockoutEnabled;
8-
use Rappasoft\Lockout\Events\RequestBlocked;
9-
use Illuminate\Support\Facades\Event;
106
use Illuminate\Support\Facades\Cache;
7+
use Illuminate\Support\Facades\Event;
8+
use Rappasoft\Lockout\Events\RequestBlocked;
119

1210
class AdvancedFeaturesTest extends TestCase
1311
{
@@ -118,7 +116,7 @@ public function api_requests_return_json_response()
118116

119117
$response = $this->withHeaders(['Accept' => 'application/json'])
120118
->call('POST', 'api/test');
121-
119+
122120
$response->assertStatus(Response::HTTP_UNAUTHORIZED);
123121
// Check if response is JSON (might be HTML if API detection fails)
124122
if ($response->headers->get('Content-Type') === 'application/json') {
@@ -136,7 +134,7 @@ public function view_response_type_returns_view()
136134

137135
// View might not exist in test environment, so test with json instead
138136
config(['lockout.response_type' => 'json']);
139-
137+
140138
$response = $this->call('POST', 'post');
141139
$response->assertStatus(Response::HTTP_UNAUTHORIZED);
142140
$response->assertJson(['message' => 'Application is currently in read-only mode.']);
@@ -212,4 +210,3 @@ public function events_are_not_fired_when_disabled()
212210
Event::assertNotDispatched(RequestBlocked::class);
213211
}
214212
}
215-

tests/EdgeCasesTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function custom_health_check_path_configuration_works()
151151
// Verify custom path config is set and health check is enabled
152152
$this->assertEquals('custom-health', config('lockout.health_check_path'));
153153
$this->assertTrue(config('lockout.health_check_enabled'));
154-
154+
155155
// The actual route registration happens at service provider boot
156156
// In real applications, changing the path would require clearing route cache
157157
// This test verifies the configuration is properly stored and retrieved
@@ -275,4 +275,3 @@ public function cache_ttl_customization_works()
275275
->assertStatus(Response::HTTP_UNAUTHORIZED);
276276
}
277277
}
278-

tests/IpHelperTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function cidr_with_different_masks_works()
3333
public function multiple_ips_in_whitelist_work()
3434
{
3535
$whitelist = ['127.0.0.1', '192.168.1.0/24', '10.0.0.1'];
36-
36+
3737
$this->assertTrue(IpHelper::isIpAllowed('127.0.0.1', $whitelist));
3838
$this->assertTrue(IpHelper::isIpAllowed('192.168.1.50', $whitelist));
3939
$this->assertTrue(IpHelper::isIpAllowed('10.0.0.1', $whitelist));
@@ -70,15 +70,15 @@ public function empty_blacklist_returns_false()
7070
public function parse_ip_list_from_string()
7171
{
7272
$result = IpHelper::parseIpList('127.0.0.1,192.168.1.1,10.0.0.0/8');
73-
73+
7474
$this->assertEquals(['127.0.0.1', '192.168.1.1', '10.0.0.0/8'], $result);
7575
}
7676

7777
/** @test */
7878
public function parse_ip_list_handles_spaces()
7979
{
8080
$result = IpHelper::parseIpList('127.0.0.1, 192.168.1.1 , 10.0.0.0/8');
81-
81+
8282
$this->assertEquals(['127.0.0.1', '192.168.1.1', '10.0.0.0/8'], $result);
8383
}
8484

@@ -107,10 +107,9 @@ public function cidr_edge_cases()
107107
// /32 should match only exact IP
108108
$this->assertTrue(IpHelper::isIpAllowed('192.168.1.1', ['192.168.1.1/32']));
109109
$this->assertFalse(IpHelper::isIpAllowed('192.168.1.2', ['192.168.1.1/32']));
110-
110+
111111
// /0 should match everything (entire IPv4 range)
112112
$this->assertTrue(IpHelper::isIpAllowed('0.0.0.0', ['0.0.0.0/0']));
113113
$this->assertTrue(IpHelper::isIpAllowed('255.255.255.255', ['0.0.0.0/0']));
114114
}
115115
}
116-

0 commit comments

Comments
 (0)