Skip to content

Commit

Permalink
Merge pull request #36 from nextapps-be/feature/laravel-v11-support
Browse files Browse the repository at this point in the history
Add support for Laravel v11
  • Loading branch information
gdebrauwer authored Mar 15, 2024
2 parents cbf10dd + 6ce2a2e commit c260d80
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 35 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ jobs:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3]
laravel: [10.*]
laravel: [10.*, 11.*]
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- php: 8.1
laravel: 11.*

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

Expand Down Expand Up @@ -44,7 +47,7 @@ jobs:
- name: Install dependencies
run: |
composer require "illuminate/database:${{ matrix.laravel }}" "illuminate/notifications:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ phpunit.xml
.env
.phpunit.result.cache
.php-cs-fixer.cache
.phpunit.cache
6 changes: 3 additions & 3 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use AdamWojs\PhpCsFixerPhpdocForceFQCN\Fixer\Phpdoc\ForceFQCNFixer;
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use AdamWojs\PhpCsFixerPhpdocForceFQCN\Fixer\Phpdoc\ForceFQCNFixer;

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

return (new Config())
->registerCustomFixers([
new ForceFQCNFixer(),
new ForceFQCNFixer()
])
->setRules($rules)
->setFinder($finder);
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
],
"require": {
"php": "^8.1|^8.2|^8.3",
"illuminate/database": "^7.0|^8.0|^9.0|^10.0",
"illuminate/notifications": "^7.0|^8.0|^9.0|^10.0",
"illuminate/support": "^7.0|^8.0|^9.0|^10.0"
"illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/notifications": "^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0"
},
"require-dev": {
"adamwojs/php-cs-fixer-phpdoc-force-fqcn": "^2.0",
"friendsofphp/php-cs-fixer": "^3.0",
"orchestra/testbench": "^5.0|^6.0|^7.0|^8.0",
"phpunit/phpunit": "^9.1",
"orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.1|^10.0",
"squizlabs/php_codesniffer": "^3.6"
},
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions config/verification-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
| - \NextApps\VerificationCode\Notifications\VerificationCodeCreatedInterface
|
*/
'notification' => \NextApps\VerificationCode\Notifications\VerificationCodeCreated::class,
'notification' => NextApps\VerificationCode\Notifications\VerificationCodeCreated::class,

/*
|--------------------------------------------------------------------------
Expand All @@ -72,7 +72,7 @@
| - \NextApps\VerificationCode\Models\VerificationCode
|
*/
'model' => \NextApps\VerificationCode\Models\VerificationCode::class,
'model' => NextApps\VerificationCode\Models\VerificationCode::class,

/*
|--------------------------------------------------------------------------
Expand Down
28 changes: 7 additions & 21 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<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">
<testsuites>
<testsuite name="Next Apps Test Suite">
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<source>
<include>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</include>
</source>
<php>
<env name="APP_KEY" value="base64:yk+bUVuZa1p86Dqjk9OjVK2R1pm6XHxC6xEKFq8utH0="/>
<env name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>
4 changes: 2 additions & 2 deletions tests/Models/VerificationCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function it_sets_expiration_date_based_on_config()
$dbVerificationCode = VerificationCode::first();

$this->assertNotNull($dbVerificationCode->expires_at);
$this->assertEquals(0, $dbVerificationCode->expires_at->diffInMinutes(now()->addHours(6)));
$this->assertEquals(0, (int) $dbVerificationCode->expires_at->diffInMinutes(now()->addHours(6)));
}

/** @test */
Expand Down Expand Up @@ -79,7 +79,7 @@ public function it_sets_expiration_date_if_not_set_on_create()
]);

$this->assertNotNull($verificationCode->expires_at);
$this->assertEquals(0, $verificationCode->expires_at->diffInMinutes(now()->addHours(4)));
$this->assertEquals(0, (int) $verificationCode->expires_at->diffInMinutes(now()->addHours(4)));
}

/** @test */
Expand Down

0 comments on commit c260d80

Please sign in to comment.