From 8d163ba4c9e0be4ffd60df6d29b83ac580eb5a64 Mon Sep 17 00:00:00 2001 From: Jimmy Puckett Date: Tue, 14 Mar 2023 19:07:04 -0400 Subject: [PATCH 1/4] Support L10 --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 9f058c9..bf8709f 100644 --- a/composer.json +++ b/composer.json @@ -19,19 +19,19 @@ } ], "require": { - "php": ">=8.0.2", + "php": ">=8.1", "ext-json": "*", - "illuminate/cache": "^9.19", - "illuminate/routing": "^9.19", - "illuminate/support": "^9.42", + "illuminate/cache": "^9.19|^10", + "illuminate/routing": "^9.19|^10", + "illuminate/support": "^9.42|^10", "mobiledetect/mobiledetectlib": "~2.8", "ua-parser/uap-php": "~3.9" }, "require-dev": { - "illuminate/http": "^9.19", + "illuminate/http": "^9.19|^10", "laravel/pint": "^1.2", "mockery/mockery": "^1.5.1", - "phpunit/phpunit": "^9.5.26", + "phpunit/phpunit": "^9.6.5", "psy/psysh": "^0.11", "symfony/var-dumper": "^6.2" }, From 0974b32a510e12e296d993f0855caa190493a392 Mon Sep 17 00:00:00 2001 From: Jimmy Puckett Date: Tue, 14 Mar 2023 19:07:16 -0400 Subject: [PATCH 2/4] Test in php 8.1 & 8.2 --- .github/workflows/ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28f1c99..fa0e567 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.0, 8.1] + php: [8.1, 8.2] stability: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.stability }} @@ -20,6 +20,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + # 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 + # 10 commits is an arbitrary value that is more than 1 commit + fetch-depth: 10 - name: Cache dependencies uses: actions/cache@v1 @@ -37,11 +41,11 @@ jobs: run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest - name: PHP Security Checker - uses: symfonycorp/security-checker-action@v2 + uses: symfonycorp/security-checker-action@v5 if: ${{ matrix.stability == 'prefer-stable' }} - name: Execute tests run: vendor/bin/phpunit --coverage-clover=coverage.clover --verbose - name: Upload Code Coverage - run: wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover + run: vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover From 2a37d2ba6353e8aa8321dce5af72004f6dd0554a Mon Sep 17 00:00:00 2001 From: Jimmy Puckett Date: Tue, 14 Mar 2023 19:15:42 -0400 Subject: [PATCH 3/4] Typecast some properties --- src/Filter.php | 20 +++++--------------- src/FilterServiceProvider.php | 4 +--- src/Route/AllowFilter.php | 2 +- src/Route/BlockFilter.php | 2 +- src/Stack/Filter.php | 2 +- 5 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/Filter.php b/src/Filter.php index 892242b..3951358 100644 --- a/src/Filter.php +++ b/src/Filter.php @@ -20,38 +20,28 @@ abstract class Filter { /** * Is this a block or allow filter? - * - * @var bool */ - protected $block_filter = null; + protected ?bool $block_filter = null; /** * The client instance. - * - * @var Client */ - protected $client; + protected Client $client; /** * Location of the config file. - * - * @var string */ - protected $config_path = 'browserfilter.'; + protected string $config_path = 'browserfilter.'; /** * The path to redirect the user if client is blocked. - * - * @var string */ - protected $redirect_route; + protected ?string $redirect_route = null; /** * The array of rules - * - * @var array */ - protected $rules = []; + protected array $rules = []; /** * Create a new browser filter middleware instance. diff --git a/src/FilterServiceProvider.php b/src/FilterServiceProvider.php index 08e12bb..7e90e19 100644 --- a/src/FilterServiceProvider.php +++ b/src/FilterServiceProvider.php @@ -11,10 +11,8 @@ class FilterServiceProvider extends ServiceProvider { /** * Location of the configuration file in the package - * - * @var string */ - protected $config_file; + protected string $config_file; public function __construct($app) { diff --git a/src/Route/AllowFilter.php b/src/Route/AllowFilter.php index a85b523..d6fa06b 100644 --- a/src/Route/AllowFilter.php +++ b/src/Route/AllowFilter.php @@ -10,5 +10,5 @@ class AllowFilter extends RouteFilter /** * {@inheritDoc} */ - protected $block_filter = false; + protected ?bool $block_filter = false; } diff --git a/src/Route/BlockFilter.php b/src/Route/BlockFilter.php index a283970..780870a 100644 --- a/src/Route/BlockFilter.php +++ b/src/Route/BlockFilter.php @@ -10,5 +10,5 @@ class BlockFilter extends RouteFilter /** * {@inheritDoc} */ - protected $block_filter = true; + protected ?bool $block_filter = true; } diff --git a/src/Stack/Filter.php b/src/Stack/Filter.php index 78860ca..cb10f46 100644 --- a/src/Stack/Filter.php +++ b/src/Stack/Filter.php @@ -14,7 +14,7 @@ class Filter extends CoreFilter /** * {@inheritDoc} */ - protected $block_filter = true; + protected ?bool $block_filter = true; /** * {@inheritDoc} From 2d829e654f012a315024dbceabd85cc4b2bc5909 Mon Sep 17 00:00:00 2001 From: Jimmy Puckett Date: Tue, 14 Mar 2023 19:20:36 -0400 Subject: [PATCH 4/4] Bumping version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4a36342..fd2a018 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0 +3.1.0