diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index ca851eb..e2d9761 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -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 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 963046e..54a56ce 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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 }} diff --git a/composer.json b/composer.json index 3cb8434..f7e3353 100644 --- a/composer.json +++ b/composer.json @@ -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", @@ -9,8 +10,6 @@ "number", "nova-advanced-number-field" ], - "homepage": "https://github.com/simplesquid/nova-advanced-number-field", - "license": "MIT", "authors": [ { "name": "Matthew Poulter", @@ -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" @@ -47,6 +49,12 @@ "SimpleSquid\\Nova\\Fields\\AdvancedNumber\\Tests\\": "tests" } }, + "config": { + "allow-plugins": { + "ergebnis/composer-normalize": true + }, + "sort-packages": true + }, "extra": { "laravel": { "providers": [] @@ -54,9 +62,5 @@ }, "scripts": { "test": "vendor/bin/phpunit --colors=always" - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "stable" + } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index fd32240..66fe32a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,16 +1,18 @@ - - - src - - + colors="true" +> tests + + + + src + + diff --git a/src/AdvancedNumber.php b/src/AdvancedNumber.php index 6cfde9c..614157a 100644 --- a/src/AdvancedNumber.php +++ b/src/AdvancedNumber.php @@ -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; + }); } /**