Skip to content

Commit 2a37d2b

Browse files
committed
Typecast some properties
1 parent 0974b32 commit 2a37d2b

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

src/Filter.php

+5-15
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,28 @@ abstract class Filter
2020
{
2121
/**
2222
* Is this a block or allow filter?
23-
*
24-
* @var bool
2523
*/
26-
protected $block_filter = null;
24+
protected ?bool $block_filter = null;
2725

2826
/**
2927
* The client instance.
30-
*
31-
* @var Client
3228
*/
33-
protected $client;
29+
protected Client $client;
3430

3531
/**
3632
* Location of the config file.
37-
*
38-
* @var string
3933
*/
40-
protected $config_path = 'browserfilter.';
34+
protected string $config_path = 'browserfilter.';
4135

4236
/**
4337
* The path to redirect the user if client is blocked.
44-
*
45-
* @var string
4638
*/
47-
protected $redirect_route;
39+
protected ?string $redirect_route = null;
4840

4941
/**
5042
* The array of rules
51-
*
52-
* @var array
5343
*/
54-
protected $rules = [];
44+
protected array $rules = [];
5545

5646
/**
5747
* Create a new browser filter middleware instance.

src/FilterServiceProvider.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ class FilterServiceProvider extends ServiceProvider
1111
{
1212
/**
1313
* Location of the configuration file in the package
14-
*
15-
* @var string
1614
*/
17-
protected $config_file;
15+
protected string $config_file;
1816

1917
public function __construct($app)
2018
{

src/Route/AllowFilter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ class AllowFilter extends RouteFilter
1010
/**
1111
* {@inheritDoc}
1212
*/
13-
protected $block_filter = false;
13+
protected ?bool $block_filter = false;
1414
}

src/Route/BlockFilter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ class BlockFilter extends RouteFilter
1010
/**
1111
* {@inheritDoc}
1212
*/
13-
protected $block_filter = true;
13+
protected ?bool $block_filter = true;
1414
}

src/Stack/Filter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Filter extends CoreFilter
1414
/**
1515
* {@inheritDoc}
1616
*/
17-
protected $block_filter = true;
17+
protected ?bool $block_filter = true;
1818

1919
/**
2020
* {@inheritDoc}

0 commit comments

Comments
 (0)