Skip to content

Commit b0736df

Browse files
authored
Merge pull request #41 from spinen/feature/supportL10
Feature/support l10
2 parents 382ae25 + 2a37d2b commit b0736df

File tree

7 files changed

+22
-30
lines changed

7 files changed

+22
-30
lines changed

.github/workflows/ci.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ jobs:
1212
strategy:
1313
fail-fast: true
1414
matrix:
15-
php: [8.0, 8.1]
15+
php: [8.1, 8.2]
1616
stability: [prefer-lowest, prefer-stable]
1717

1818
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
1919

2020
steps:
2121
- name: Checkout code
2222
uses: actions/checkout@v2
23+
with:
24+
# Fetch 10 commits or Scrutinizer will throw ("Failed to retrieve commit parents. If you use a shallow git checkout, please checkout at least a depth of one."), see: RepositoryIntrospector at scrutinizer-ci/ocular GitHub repository
25+
# 10 commits is an arbitrary value that is more than 1 commit
26+
fetch-depth: 10
2327

2428
- name: Cache dependencies
2529
uses: actions/cache@v1
@@ -37,11 +41,11 @@ jobs:
3741
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
3842

3943
- name: PHP Security Checker
40-
uses: symfonycorp/security-checker-action@v2
44+
uses: symfonycorp/security-checker-action@v5
4145
if: ${{ matrix.stability == 'prefer-stable' }}
4246

4347
- name: Execute tests
4448
run: vendor/bin/phpunit --coverage-clover=coverage.clover --verbose
4549

4650
- name: Upload Code Coverage
47-
run: wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover
51+
run: vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover

composer.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
}
2020
],
2121
"require": {
22-
"php": ">=8.0.2",
22+
"php": ">=8.1",
2323
"ext-json": "*",
24-
"illuminate/cache": "^9.19",
25-
"illuminate/routing": "^9.19",
26-
"illuminate/support": "^9.42",
24+
"illuminate/cache": "^9.19|^10",
25+
"illuminate/routing": "^9.19|^10",
26+
"illuminate/support": "^9.42|^10",
2727
"mobiledetect/mobiledetectlib": "~2.8",
2828
"ua-parser/uap-php": "~3.9"
2929
},
3030
"require-dev": {
31-
"illuminate/http": "^9.19",
31+
"illuminate/http": "^9.19|^10",
3232
"laravel/pint": "^1.2",
3333
"mockery/mockery": "^1.5.1",
34-
"phpunit/phpunit": "^9.5.26",
34+
"phpunit/phpunit": "^9.6.5",
3535
"psy/psysh": "^0.11",
3636
"symfony/var-dumper": "^6.2"
3737
},

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)