Skip to content

Commit 7ff26d8

Browse files
authored
Merge pull request #79 from iz-ahmad/feat/laravel-13-support
feat: add support for laravel 13 and PHP 8.5
2 parents f9fb2f0 + 3242203 commit 7ff26d8

15 files changed

Lines changed: 36 additions & 18 deletions

.github/workflows/run-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
fail-fast: true
1818
matrix:
1919
os: [ubuntu-latest]
20-
php: [8.3, 8.2, 8.1]
21-
laravel: [10.*, 11.*, 12.*]
20+
php: [8.5, 8.4, 8.3, 8.2, 8.1]
21+
laravel: [10.*, 11.*, 12.*, 13.*]
2222
stability: [prefer-lowest, prefer-stable]
2323
include:
2424
- laravel: 10.*
@@ -30,11 +30,16 @@ jobs:
3030
- laravel: 12.*
3131
testbench: 10.*
3232
carbon: ^3.0
33+
- laravel: 13.*
34+
testbench: 11.*
35+
carbon: ^3.0
3336
exclude:
3437
- laravel: 11.*
3538
php: 8.1
3639
- laravel: 12.*
3740
php: 8.1
41+
- laravel: 13.*
42+
php: 8.1
3843

3944
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
4045

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.1 | ^8.2 | ^8.3",
20-
"illuminate/contracts": "^10.0 | ^11.0 | ^12.0",
19+
"php": "^8.1 | ^8.2 | ^8.3 | ^8.4 | ^8.5",
20+
"illuminate/contracts": "^10.0 | ^11.0 | ^12.0 | ^13.0",
2121
"spatie/laravel-package-tools": "^1.16.0"
2222
},
2323
"require-dev": {
2424
"laravel/pint": "^1.0",
2525
"mockery/mockery": "^1.6",
2626
"nunomaduro/collision": "^7.8 | ^8.1",
27-
"orchestra/workbench": "^8.0 | ^9.0 | ^10.0",
28-
"phpunit/phpunit": "^10.5 | ^11.0",
27+
"orchestra/workbench": "^8.0 | ^9.0 | ^10.0 | ^11.0",
28+
"phpunit/phpunit": "^10.5 | ^11.0 | ^12.0",
2929
"rector/rector": "^2.1.7"
3030
},
3131
"autoload": {

phpunit.xml.dist

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd"
55
backupGlobals="false"
66
bootstrap="vendor/autoload.php"
77
colors="true"
8-
processIsolation="false"
9-
stopOnFailure="false"
108
executionOrder="random"
11-
failOnWarning="true"
12-
failOnRisky="true"
139
failOnEmptyTestSuite="true"
14-
beStrictAboutOutputDuringTests="true"
1510
cacheDirectory=".phpunit.cache"
1611
backupStaticProperties="false"
1712
>

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// Define what rule sets will be applied
1616
$rectorConfig->sets([
17-
LevelSetList::UP_TO_PHP_81,
17+
LevelSetList::UP_TO_PHP_85,
1818
SetList::CODE_QUALITY,
1919
SetList::DEAD_CODE,
2020
SetList::EARLY_RETURN,

src/Concern/CaptureRequest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected function anonymizeIp(string $ip): string
119119
return $ip;
120120
}
121121

122-
protected function parseUserAgent($userAgent): array
122+
protected function parseUserAgent(?string $userAgent): array
123123
{
124124
$operating_system = $this->getOperatingSystem($userAgent);
125125
$browser = $this->getBrowser($userAgent);
@@ -128,7 +128,7 @@ protected function parseUserAgent($userAgent): array
128128
return ['operating_system' => $operating_system, 'browser' => $browser, 'device' => $device];
129129
}
130130

131-
protected function getOperatingSystem($userAgent): string
131+
protected function getOperatingSystem(?string $userAgent): string
132132
{
133133
$operatingSystem = 'Unknown';
134134
$osRegexes = [
@@ -167,7 +167,7 @@ protected function getOperatingSystem($userAgent): string
167167
return $operatingSystem;
168168
}
169169

170-
protected function getBrowser($userAgent): string
170+
protected function getBrowser(?string $userAgent): string
171171
{
172172
$browser = 'Unknown';
173173
$browserRegexes = [
@@ -191,7 +191,7 @@ protected function getBrowser($userAgent): string
191191
return $browser;
192192
}
193193

194-
protected function getDevice($userAgent): string
194+
protected function getDevice(?string $userAgent): string
195195
{
196196
$device = 'Unknown';
197197
$deviceRegexes = [

src/DTO/RequestDataDTO.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
namespace MeShaon\RequestAnalytics\DTO;
46

57
class RequestDataDTO

src/Exceptions/BotDetectionException.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
namespace MeShaon\RequestAnalytics\Exceptions;
46

57
/**

src/Exceptions/GeolocationException.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
namespace MeShaon\RequestAnalytics\Exceptions;
46

57
/**

src/Exceptions/GeolocationProviderException.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
namespace MeShaon\RequestAnalytics\Exceptions;
46

57
/**

src/Exceptions/MaxMindConfigurationException.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
namespace MeShaon\RequestAnalytics\Exceptions;
46

57
/**

0 commit comments

Comments
 (0)