Skip to content

Commit c260d80

Browse files
authored
Merge pull request #36 from nextapps-be/feature/laravel-v11-support
Add support for Laravel v11
2 parents cbf10dd + 6ce2a2e commit c260d80

File tree

7 files changed

+25
-35
lines changed

7 files changed

+25
-35
lines changed

.github/workflows/run-tests.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
php: [8.1, 8.2, 8.3]
14-
laravel: [10.*]
14+
laravel: [10.*, 11.*]
1515
dependency-version: [prefer-lowest, prefer-stable]
16+
exclude:
17+
- php: 8.1
18+
laravel: 11.*
1619

1720
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }}
1821

@@ -44,7 +47,7 @@ jobs:
4447
4548
- name: Install dependencies
4649
run: |
47-
composer require "illuminate/database:${{ matrix.laravel }}" "illuminate/notifications:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" --no-interaction --no-update
50+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
4851
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
4952
5053
- name: Execute tests

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ phpunit.xml
77
.env
88
.phpunit.result.cache
99
.php-cs-fixer.cache
10+
.phpunit.cache

.php-cs-fixer.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use AdamWojs\PhpCsFixerPhpdocForceFQCN\Fixer\Phpdoc\ForceFQCNFixer;
43
use PhpCsFixer\Config;
54
use PhpCsFixer\Finder;
5+
use AdamWojs\PhpCsFixerPhpdocForceFQCN\Fixer\Phpdoc\ForceFQCNFixer;
66

77
$rules = [
88
'@PSR2' => true,
@@ -32,7 +32,7 @@
3232
// Converts implicit variables into explicit ones in double-quoted strings or heredoc syntax.
3333
'explicit_string_variable' => true,
3434
// Transforms imported FQCN parameters and return types in function arguments to short version.
35-
'fully_qualified_strict_types' => true,
35+
'fully_qualified_strict_types' => false,
3636
// Add missing space between function's argument and its typehint.
3737
'function_typehint_space' => true,
3838
// Pre- or post-increment and decrement operators should be used if possible.
@@ -195,7 +195,7 @@
195195

196196
return (new Config())
197197
->registerCustomFixers([
198-
new ForceFQCNFixer(),
198+
new ForceFQCNFixer()
199199
])
200200
->setRules($rules)
201201
->setFinder($finder);

composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
],
3030
"require": {
3131
"php": "^8.1|^8.2|^8.3",
32-
"illuminate/database": "^7.0|^8.0|^9.0|^10.0",
33-
"illuminate/notifications": "^7.0|^8.0|^9.0|^10.0",
34-
"illuminate/support": "^7.0|^8.0|^9.0|^10.0"
32+
"illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0",
33+
"illuminate/notifications": "^7.0|^8.0|^9.0|^10.0|^11.0",
34+
"illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0"
3535
},
3636
"require-dev": {
3737
"adamwojs/php-cs-fixer-phpdoc-force-fqcn": "^2.0",
3838
"friendsofphp/php-cs-fixer": "^3.0",
39-
"orchestra/testbench": "^5.0|^6.0|^7.0|^8.0",
40-
"phpunit/phpunit": "^9.1",
39+
"orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0",
40+
"phpunit/phpunit": "^9.1|^10.0",
4141
"squizlabs/php_codesniffer": "^3.6"
4242
},
4343
"autoload": {

config/verification-code.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
| - \NextApps\VerificationCode\Notifications\VerificationCodeCreatedInterface
6060
|
6161
*/
62-
'notification' => \NextApps\VerificationCode\Notifications\VerificationCodeCreated::class,
62+
'notification' => NextApps\VerificationCode\Notifications\VerificationCodeCreated::class,
6363

6464
/*
6565
|--------------------------------------------------------------------------
@@ -72,7 +72,7 @@
7272
| - \NextApps\VerificationCode\Models\VerificationCode
7373
|
7474
*/
75-
'model' => \NextApps\VerificationCode\Models\VerificationCode::class,
75+
'model' => NextApps\VerificationCode\Models\VerificationCode::class,
7676

7777
/*
7878
|--------------------------------------------------------------------------

phpunit.xml.dist

+7-21
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
verbose="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" cacheResult="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
123
<testsuites>
13-
<testsuite name="Next Apps Test Suite">
4+
<testsuite name="Test Suite">
145
<directory>tests</directory>
156
</testsuite>
167
</testsuites>
17-
<filter>
18-
<whitelist>
8+
<source>
9+
<include>
1910
<directory suffix=".php">src/</directory>
20-
</whitelist>
21-
</filter>
22-
<logging>
23-
<log type="tap" target="build/report.tap"/>
24-
<log type="junit" target="build/report.junit.xml"/>
25-
<log type="coverage-text" target="build/coverage.txt"/>
26-
<log type="coverage-clover" target="build/logs/clover.xml"/>
27-
</logging>
11+
</include>
12+
</source>
2813
<php>
14+
<env name="APP_KEY" value="base64:yk+bUVuZa1p86Dqjk9OjVK2R1pm6XHxC6xEKFq8utH0="/>
2915
<env name="DB_CONNECTION" value="testing"/>
3016
</php>
3117
</phpunit>

tests/Models/VerificationCodeTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function it_sets_expiration_date_based_on_config()
3030
$dbVerificationCode = VerificationCode::first();
3131

3232
$this->assertNotNull($dbVerificationCode->expires_at);
33-
$this->assertEquals(0, $dbVerificationCode->expires_at->diffInMinutes(now()->addHours(6)));
33+
$this->assertEquals(0, (int) $dbVerificationCode->expires_at->diffInMinutes(now()->addHours(6)));
3434
}
3535

3636
/** @test */
@@ -79,7 +79,7 @@ public function it_sets_expiration_date_if_not_set_on_create()
7979
]);
8080

8181
$this->assertNotNull($verificationCode->expires_at);
82-
$this->assertEquals(0, $verificationCode->expires_at->diffInMinutes(now()->addHours(4)));
82+
$this->assertEquals(0, (int) $verificationCode->expires_at->diffInMinutes(now()->addHours(4)));
8383
}
8484

8585
/** @test */

0 commit comments

Comments
 (0)