Skip to content

Commit 3353104

Browse files
committed
Support Nova 5, update dependencies
1 parent bd9f6ce commit 3353104

File tree

5 files changed

+32
-9
lines changed

5 files changed

+32
-9
lines changed

.github/workflows/run-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [ 8.3, 8.2]
11+
php: [ 8.3, 8.2 ]
1212
laravel: [ 10.* ]
1313
dependency-version: [ prefer-stable ]
1414
include:
@@ -35,7 +35,7 @@ jobs:
3535
- name: Install dependencies
3636
run: |
3737
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_4_LICENSE_KEY }}"
38-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
38+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench-core:${{ matrix.testbench }}" --no-interaction --no-update
3939
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
4040
env:
4141
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
@@ -47,14 +47,14 @@ jobs:
4747
- name: Setup Node.js
4848
uses: actions/setup-node@v4
4949
with:
50-
node-version: 20
50+
node-version: 22
5151

5252
- name: Cache yarn dependencies
5353
uses: actions/cache@v4
5454
id: npm-node_modules-cache
5555
with:
5656
path: node_modules
57-
key: npm-${{ hashFiles('package.json') }}-node-20
57+
key: npm-${{ hashFiles('package.json') }}-node-22
5858

5959
- name: Compile assets
6060
run: npm install && npm run nova:install && npm run prod

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
"require": {
1212
"php": "^8.1",
1313
"ext-json": "*",
14-
"laravel/nova": "^4.20"
14+
"laravel/nova": "^4.20 || ^5.0"
1515
},
1616
"require-dev": {
1717
"interaction-design-foundation/coding-standard": "^0.3.0",
18-
"orchestra/testbench": "^9.0",
18+
"orchestra/testbench-core": "^8.22 || ^v9.7",
1919
"phpunit/phpunit": "^10.5 || ^11.0",
2020
"vimeo/psalm": "^5.22"
2121
},
@@ -59,6 +59,7 @@
5959
"cs:check": "phpcs -p -s --colors --report-full --report-summary",
6060
"cs:fix": "phpcbf -p --colors",
6161
"psalm": "vendor/bin/psalm",
62+
"sa": "@psalm",
6263
"test": "phpunit --colors=always"
6364
}
6465
}

phpcs.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="IxDF Package Standard">
3+
<!-- Include all rules from the IxDF Coding Standard -->
4+
<rule ref="IxDFCodingStandard">
5+
<exclude ref="IxDFCodingStandard.Files.BemCasedFilename.InvalidCharacters"/>
6+
<exclude ref="SlevomatCodingStandard.Classes.RequireAbstractOrFinal.ClassNeitherAbstractNorFinal"/>
7+
<exclude ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName"/>
8+
</rule>
9+
10+
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
11+
<exclude-pattern>./tests*</exclude-pattern>
12+
</rule>
13+
14+
<rule ref="Generic.Files.LineLength.TooLong">
15+
<severity>1</severity><!-- Temp hide the warn -->
16+
</rule>
17+
18+
<!-- Paths to check -->
19+
<file>src</file>
20+
<file>tests</file>
21+
</ruleset>

src/Unlayer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
class Unlayer extends Field
1717
{
1818
use SupportsDependentFields;
19+
1920
public const MODE_EMAIL = 'email';
2021
public const MODE_WEB = 'web';
2122

@@ -33,7 +34,7 @@ class Unlayer extends Field
3334

3435
/**
3536
* A function to call on filling Model attributes from Request
36-
* @var null|callable(\Laravel\Nova\Http\Requests\NovaRequest, string, \Illuminate\Database\Eloquent\Model, string):void $callback
37+
* @var (callable(\Laravel\Nova\Http\Requests\NovaRequest, string, \Illuminate\Database\Eloquent\Model, string): void)|null $callback
3738
*/
3839
public $savingCallback;
3940

@@ -59,7 +60,7 @@ final public function config(array | callable $config): static
5960
]);
6061
}
6162

62-
/** @param null|callable(\Laravel\Nova\Http\Requests\NovaRequest, string, \Illuminate\Database\Eloquent\Model, string):void $callback */
63+
/** @param (callable(\Laravel\Nova\Http\Requests\NovaRequest, string, \Illuminate\Database\Eloquent\Model, string): void)|null $callback */
6364
final public function savingCallback(?callable $callback): static
6465
{
6566
$this->savingCallback = $callback;

tests/UnlayerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function it_resolves_callback_to_html_code(): void
1515
{
1616
$field = new Unlayer('any_name');
1717

18-
$field->html(static fn (): string => '<p>Hello!</p>');
18+
$field->html(static fn(): string => '<p>Hello!</p>');
1919

2020
$this->assertSame('<p>Hello!</p>', $field->meta()['html'] ?? null);
2121
}

0 commit comments

Comments
 (0)