Skip to content

Commit cbda8c3

Browse files
committed
php-cs-fixes
1 parent d1cba9d commit cbda8c3

29 files changed

+129
-129
lines changed

config/firewall.php

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?php
22

3-
return [
3+
declare(strict_types=1);
44

5-
/*
6-
* Enable / disable firewall
7-
*
8-
*/
5+
return [
6+
// Enable / disable firewall
97

108
'enabled' => env('FIREWALL_ENABLED', false),
119

@@ -26,10 +24,7 @@
2624
'blacklist' => [],
2725
'whitelist' => [],
2826

29-
/*
30-
* Response action for blocked responses
31-
*
32-
*/
27+
// Response action for blocked responses
3328

3429
'responses' => [
3530
'blacklist' => [
@@ -78,10 +73,7 @@
7873

7974
'ip_list_cache_expire_time' => 60, // minutes - disabled by default
8075

81-
/*
82-
* Send suspicious events to log?
83-
*
84-
*/
76+
// Send suspicious events to log?
8577
8678
'enable_log' => true,
8779

@@ -112,9 +104,7 @@
112104

113105
'enable_country_search' => true,
114106

115-
/*
116-
* Should Firewall use the database?
117-
*/
107+
// Should Firewall use the database?
118108
119109
'use_database' => true,
120110

@@ -149,9 +139,7 @@
149139

150140
'geoip_database_path' => storage_path('geoip'),
151141

152-
/*
153-
* Block suspicious attacks
154-
*/
142+
// Block suspicious attacks
155143

156144
'attack_blocker' => [
157145
'enabled' => [
@@ -162,7 +150,6 @@
162150
'cache_key_prefix' => 'firewall-attack-blocker',
163151

164152
'allowed_frequency' => [
165-
166153
'ip' => [
167154
'requests' => 50,
168155
'seconds' => 1 * 60, // 1 minute
@@ -172,7 +159,6 @@
172159
'requests' => 3000,
173160
'seconds' => 2 * 60, // 2 minutes
174161
],
175-
176162
],
177163

178164
'action' => [
@@ -185,7 +171,6 @@
185171
'blacklist_unknown' => false,
186172
'blacklist_whitelisted' => false,
187173
],
188-
189174
],
190175

191176
'response' => [
@@ -195,7 +180,6 @@
195180
'redirect_to' => null,
196181
'abort' => false, // return abort() instead of Response::make() - disabled by default
197182
],
198-
199183
],
200184

201185
'notifications' => [

config/geocoder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Geocoder\Provider\Chain\Chain;
46
use Geocoder\Provider\GeoIP2\GeoIP2;
57
use GeoIp2\Database\Reader;

config/google2fa.php

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?php
22

3-
return [
3+
declare(strict_types=1);
44

5-
/*
6-
* Auth container binding
7-
*/
5+
return [
6+
// Auth container binding
87

98
'enabled' => true,
109

@@ -15,60 +14,39 @@
1514

1615
'lifetime' => 0, // 0 = eternal
1716

18-
/*
19-
* Renew lifetime at every new request.
20-
*/
17+
// Renew lifetime at every new request.
2118

2219
'keep_alive' => true,
2320

24-
/*
25-
* Auth container binding
26-
*/
21+
// Auth container binding
2722

2823
'auth' => 'auth',
2924

30-
/*
31-
* 2FA verified session var
32-
*/
25+
// 2FA verified session var
3326

3427
'session_var' => 'google2fa',
3528

36-
/*
37-
* One Time Password request input name
38-
*/
29+
// One Time Password request input name
3930
'otp_input' => 'one_time_password',
4031

41-
/*
42-
* One Time Password Window
43-
*/
32+
// One Time Password Window
4433
'window' => 1,
4534

46-
/*
47-
* Forbid user to reuse One Time Passwords.
48-
*/
35+
// Forbid user to reuse One Time Passwords.
4936
'forbid_old_passwords' => false,
5037

51-
/*
52-
* User's table column for google2fa secret
53-
*/
38+
// User's table column for google2fa secret
5439
'otp_secret_column' => 'google2fa_secret',
5540

56-
/*
57-
* One Time Password View
58-
*/
41+
// One Time Password View
5942
'view' => 'security::auth.2fa',
6043

61-
/*
62-
* One Time Password error message
63-
*/
44+
// One Time Password error message
6445
'error_messages' => [
6546
'wrong_otp' => "The 'One Time Password' typed was wrong.",
6647
'cannot_be_empty' => 'One Time Password cannot be empty.',
6748
],
6849

69-
/*
70-
* Throw exceptions or just fire events?
71-
*/
50+
// Throw exceptions or just fire events?
7251
'throw_exceptions' => true,
73-
7452
];

config/security-headers.php

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22

3-
return [
3+
declare(strict_types=1);
44

5-
'enable' => true,
5+
return [
6+
'enable' => env('SECURITY_HEADERS_ENABLE', false),
67
/*
78
* Server
89
*
@@ -81,9 +82,9 @@
8182
*/
8283

8384
'clear-site-data' => [
84-
'enable' => false,
85+
'enable' => true,
8586

86-
'all' => false,
87+
'all' => true,
8788

8889
'cache' => true,
8990

@@ -103,11 +104,11 @@
103104
*/
104105

105106
'hsts' => [
106-
'enable' => false,
107+
'enable' => true,
107108

108109
'max-age' => 15552000,
109110

110-
'include-sub-domains' => false,
111+
'include-sub-domains' => true,
111112

112113
'preload' => true,
113114
],
@@ -492,7 +493,7 @@
492493

493494
'style-src' => [
494495
'allow' => [
495-
"*",
496+
'*',
496497
],
497498

498499
'hashes' => [
@@ -502,7 +503,6 @@
502503
],
503504

504505
'nonces' => [
505-
//
506506
],
507507

508508
'schemes' => [
@@ -516,50 +516,47 @@
516516
],
517517

518518
'img-src' => [
519-
'schemes' => ['*', "self", 'http:', 'https:', 'blob:', 'data:'],
519+
'schemes' => ['*', 'self', 'http:', 'https:', 'blob:', 'data:'],
520520
],
521521
'default-src' => [
522-
//
523522
],
524523

525524
'base-uri' => [
526-
//
527525
],
528526

529527
'connect-src' => [
530-
'schemes' => ['*', "self", 'http:', 'https:', 'blob:', 'data:'],
528+
'schemes' => ['*', 'self', 'http:', 'https:', 'blob:', 'data:'],
531529
],
532530

533531
'font-src' => [
534-
'schemes' => ['*', "self", 'http:', 'https:', 'blob:', 'data:'],
532+
'schemes' => ['*', 'self', 'http:', 'https:', 'blob:', 'data:'],
535533
],
536534

537535
'form-action' => [
538-
'schemes' => ['*', "self", 'http:', 'https:', 'blob:', 'data:'],
536+
'schemes' => ['*', 'self', 'http:', 'https:', 'blob:', 'data:'],
539537
],
540538

541539
'frame-ancestors' => [
542-
'schemes' => ['*', "self", 'http:', 'https:', 'blob:', 'data:'],
540+
'schemes' => ['*', 'self', 'http:', 'https:', 'blob:', 'data:'],
543541
],
544542

545543
'frame-src' => [
546-
'schemes' => ['*', "self", 'http:', 'https:', 'blob:', 'data:'],
544+
'schemes' => ['*', 'self', 'http:', 'https:', 'blob:', 'data:'],
547545
],
548546

549547
'manifest-src' => [
550-
'schemes' => ['*', "self", 'http:', 'https:', 'blob:', 'data:'],
548+
'schemes' => ['*', 'self', 'http:', 'https:', 'blob:', 'data:'],
551549
],
552550

553551
'media-src' => [
554-
'schemes' => ['*', "self", 'http:', 'https:', 'blob:', 'data:'],
552+
'schemes' => ['*', 'self', 'http:', 'https:', 'blob:', 'data:'],
555553
],
556554

557555
'object-src' => [
558-
//
559556
],
560557

561558
'worker-src' => [
562-
'schemes' => ['*', "self", 'http:', 'https:', 'blob:'],
559+
'schemes' => ['*', 'self', 'http:', 'https:', 'blob:'],
563560
],
564561

565562
'plugin-types' => [
@@ -569,7 +566,5 @@
569566
'require-sri-for' => '',
570567

571568
'sandbox' => '',
572-
573569
],
574-
575570
];

config/security.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22

3-
return [
3+
declare(strict_types=1);
44

5+
return [
56
/*
67
|--------------------------------------------------------------------------
78
| Notify New Device
@@ -25,5 +26,4 @@
2526
*/
2627

2728
'older' => 365,
28-
2929
];

database/migrations/2018_11_29_110417_create_auth_login_history_table.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

@@ -8,9 +10,9 @@ class CreateAuthLoginHistoryTable extends Migration
810
/**
911
* Run the migrations.
1012
*/
11-
public function up()
13+
public function up(): void
1214
{
13-
Schema::create('auth_login_history', function (Blueprint $table) {
15+
Schema::create('auth_login_history', function (Blueprint $table): void {
1416
$table->string('id', 36)->primary();
1517
$table->bigInteger('user_id')->unsigned()->nullable()->index('user_id');
1618
$table->string('ip', 20)->nullable()->index('ip');
@@ -34,7 +36,7 @@ public function up()
3436
/**
3537
* Reverse the migrations.
3638
*/
37-
public function down()
39+
public function down(): void
3840
{
3941
Schema::drop('auth_login_history');
4042
}

database/migrations/2019_08_25_000634_add_2fa_to_users.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57
use Illuminate\Support\Facades\Schema;
@@ -9,19 +11,19 @@ class Add2faToUsers extends Migration
911
/**
1012
* Run the migrations.
1113
*/
12-
public function up()
14+
public function up(): void
1315
{
14-
Schema::table(config('bright.table.users', 'users'), function (Blueprint $table) {
16+
Schema::table(config('bright.table.users', 'users'), function (Blueprint $table): void {
1517
$table->string('google2fa_secret', 50)->nullable()->after('remember_token');
1618
});
1719
}
1820

1921
/**
2022
* Reverse the migrations.
2123
*/
22-
public function down()
24+
public function down(): void
2325
{
24-
Schema::table(config('bright.table.users', 'users'), function (Blueprint $table) {
26+
Schema::table(config('bright.table.users', 'users'), function (Blueprint $table): void {
2527
$table->dropColumn('google2fa_secret');
2628
});
2729
}

0 commit comments

Comments
 (0)