Skip to content

Commit dbfe8df

Browse files
authored
Merge pull request #16 from mikebronner/feat/14-add-php-8-5-support
feat(php): Add PHP 8.5 support
2 parents b5b536a + 3e5da15 commit dbfe8df

12 files changed

Lines changed: 62 additions & 24 deletions

.github/workflows/tests.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,34 @@ on:
99
jobs:
1010
tests:
1111
runs-on: ubuntu-latest
12+
1213
strategy:
1314
fail-fast: false
1415
matrix:
15-
php: ['8.2', '8.3', '8.4']
16-
laravel: ['10.*', '11.*']
16+
php: ['8.2', '8.3', '8.4', '8.5']
17+
laravel: ['^11.0', '^12.0']
18+
exclude:
19+
- php: '8.5'
20+
laravel: '11.*'
21+
- php: '8.2'
22+
laravel: '13.*'
23+
1724
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
25+
1826
steps:
1927
- uses: actions/checkout@v4
28+
2029
- name: Setup PHP
2130
uses: shivammathur/setup-php@v2
2231
with:
2332
php-version: ${{ matrix.php }}
24-
extensions: mbstring, xml
33+
extensions: mbstring, json
2534
coverage: none
35+
2636
- name: Install dependencies
2737
run: |
28-
composer require "illuminate/support:${{ matrix.laravel }}" --no-interaction --no-update
29-
composer update --prefer-dist --no-interaction
38+
composer require "illuminate/support:${{ matrix.laravel }}" --no-update
39+
composer update --prefer-dist --no-interaction --no-progress
40+
3041
- name: Run tests
3142
run: vendor/bin/pest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor
22
composer.lock
3+
.phpunit.result.cache

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ We thank the following sponsors for their generosity, please take a moment to ch
2020

2121
## Requirements
2222

23-
- PHP 7.2+
24-
- Laravel 7.x
25-
- Socialite 4.2+
23+
- PHP 8.2, 8.3, 8.4, 8.5
24+
- Laravel 10.x, 11.x, 12.x
25+
- Socialite 5.3+
2626

2727
<a name="Installation"></a>
2828

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"illuminate/auth": "^10.0|^11.0|^12.0",
1515
"illuminate/database": "^10.0|^11.0|^12.0",
1616
"illuminate/support": "^10.0|^11.0|^12.0",
17-
"laravel/socialite": "^5.3",
18-
"genealabs/laravel-overridable-model": "^10.0|^11.0|^12.0"
17+
"laravel/socialite": "^5.3"
1918
},
2019
"require-dev": {
2120
"orchestra/testbench": "^8.0|^9.0|^10.0",
22-
"pestphp/pest": "^2.0|^3.0"
21+
"phpunit/phpunit": "^10.0|^11.0",
22+
"pestphp/pest": "^2.0|^3.0|^4.0"
2323
},
2424
"autoload": {
2525
"psr-4": {
@@ -44,7 +44,7 @@
4444
"config": {
4545
"allow-plugins": {
4646
"pestphp/pest-plugin": true,
47-
"symfony/thanks": false
47+
"symfony/thanks": true
4848
}
4949
},
5050
"scripts": {

phpunit.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
colors="true"
66
>
77
<testsuites>
8-
<testsuite name="Tests">
9-
<directory>tests</directory>
8+
<testsuite name="Unit">
9+
<directory>tests/Unit</directory>
1010
</testsuite>
1111
</testsuites>
1212
</phpunit>

src/SocialCredentials.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22

33
namespace GeneaLabs\LaravelSocialiter;
44

5-
use GeneaLabs\LaravelOverridableModel\Traits\Overridable;
65
use Illuminate\Database\Eloquent\Model;
76
use Illuminate\Database\Eloquent\Relations\BelongsTo;
87

98
class SocialCredentials extends Model
109
{
11-
use Overridable;
1210

13-
protected $dates = [
14-
"expires_at",
15-
];
1611
protected $fillable = [
1712
"access_token",
1813
"avatar",
@@ -26,6 +21,13 @@ class SocialCredentials extends Model
2621
"user_id",
2722
];
2823

24+
protected function casts(): array
25+
{
26+
return [
27+
"expires_at" => "datetime",
28+
];
29+
}
30+
2931
public function user() : BelongsTo
3032
{
3133
$userClass = config("auth.providers.users.model");

src/Socialiter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ protected function createUser(AbstractUser $socialiteUser): Model
114114

115115
protected function createCredentials(AbstractUser $socialiteUser): SocialCredentials
116116
{
117-
$credentialsModel = SocialCredentials::model();
118-
$socialiteCredentials = (new $credentialsModel)
117+
$socialiteCredentials = (new SocialCredentials)
119118
->with("user")
120119
->firstOrNew([
121120
"provider_id" => $socialiteUser->getId(),

tests/Pest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
use GeneaLabs\LaravelSocialiter\Tests\TestCase;
44

5-
uses(TestCase::class)->in(__DIR__);
5+
uses(TestCase::class)->in("Unit");

0 commit comments

Comments
 (0)