Skip to content

Commit

Permalink
Upgrade to Laravel 11 (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Kaufmann <[email protected]>
  • Loading branch information
mdpoulter and okaufmann authored Oct 15, 2024
1 parent 7f674d6 commit cb1b128
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: 🔥 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.3
coverage: none
tools: cs2pr, pint

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.1, 8.2 ]
laravel: [ "^9.0", "^10.0" ]
php: [ 8.2, 8.3 ]
laravel: [ "^10.0", "^11.0" ]
stability: [ prefer-lowest, prefer-stable ]
include:
- laravel: "^9.0"
testbench: "^7.0"
- laravel: "^10.0"
testbench: "^8.0"
- laravel: "^11.0"
testbench: "^9.0"

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

Expand Down
42 changes: 23 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "simplesquid/nova-advanced-number-field",
"description": "A Laravel Nova field which adds additional functionality to the default Number field.",
"license": "MIT",
"keywords": [
"simplesquid",
"laravel",
Expand All @@ -9,8 +10,6 @@
"number",
"nova-advanced-number-field"
],
"homepage": "https://github.com/simplesquid/nova-advanced-number-field",
"license": "MIT",
"authors": [
{
"name": "Matthew Poulter",
Expand All @@ -19,24 +18,27 @@
"role": "Developer"
}
],
"repositories": [
{
"type": "composer",
"url": "https://nova.laravel.com"
}
],
"homepage": "https://github.com/simplesquid/nova-advanced-number-field",
"require": {
"php": "^8.0",
"illuminate/support": "^9.0|^10.0",
"php": "^8.1",
"illuminate/support": "^10.0 || ^11.0",
"laravel/nova": "^4.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.44",
"laravel/pint": "^1.2",
"nunomaduro/collision": "^6.1|^7.0",
"orchestra/testbench": "^7.0|^8.0",
"phpunit/phpunit": "^9.5.10",
"symfony/var-dumper": "^6.0"
"nunomaduro/collision": "^7.0 || ^8.0",
"orchestra/testbench": "^8.0 || ^9.0",
"phpunit/phpunit": "^10.1",
"symfony/var-dumper": "^6.0 || ^7.0"
},
"repositories": [
{
"type": "composer",
"url": "https://nova.laravel.com"
}
],
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"SimpleSquid\\Nova\\Fields\\AdvancedNumber\\": "src"
Expand All @@ -47,16 +49,18 @@
"SimpleSquid\\Nova\\Fields\\AdvancedNumber\\Tests\\": "tests"
}
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true
},
"sort-packages": true
},
"extra": {
"laravel": {
"providers": []
}
},
"scripts": {
"test": "vendor/bin/phpunit --colors=always"
},
"config": {
"sort-packages": true
},
"minimum-stability": "stable"
}
}
16 changes: 9 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
colors="true"
>
<testsuites>
<testsuite name="Simple Squid Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage/>
<source>
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
10 changes: 5 additions & 5 deletions src/AdvancedNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ class AdvancedNumber extends Number
* @param (callable(mixed, mixed, ?string):(mixed))|null $resolveCallback
* @return void
*/
public function __construct($name, $attribute = null, callable $resolveCallback = null)
public function __construct($name, $attribute = null, ?callable $resolveCallback = null)
{
parent::__construct($name, $attribute, $resolveCallback);

$this->decimals($this->decimals)
->textAlign('right')
->displayUsing(function ($value) {
return ! is_null($value) ? $this->prefix.number_format($value, $this->decimals, $this->dec_point, $this->thousands_sep).$this->suffix : null;
});
->textAlign('right')
->displayUsing(function ($value) {
return ! is_null($value) ? $this->prefix.number_format($value, $this->decimals, $this->dec_point, $this->thousands_sep).$this->suffix : null;
});
}

/**
Expand Down

0 comments on commit cb1b128

Please sign in to comment.