Skip to content

Commit

Permalink
Merge pull request #33 from abordage/small-fix
Browse files Browse the repository at this point in the history
Small fix
  • Loading branch information
abordage authored Jan 11, 2025
2 parents c286e4d + a168cc6 commit ff20694
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ phpstan.neon
phpunit.xml
testbench.yaml
/package-lock.json
/auth.json
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A Laravel Nova card that displays any html content, e.g. lists, notifications, s
</a>

<a href="https://nova.laravel.com/docs/4.0/" title="Laravel Nova Version">
<img alt="Laravel Nova Version" src="https://img.shields.io/badge/laravel%20nova-4.0-1DA5E7">
<img alt="Laravel Nova Version" src="https://img.shields.io/badge/laravel%20nova-5.0-1DA5E7">
</a>

<a href="https://www.php.net/" title="PHP version">
Expand All @@ -35,9 +35,9 @@ A Laravel Nova card that displays any html content, e.g. lists, notifications, s
</p>

## Requirements
- PHP 7.4 - 8.3
- PHP 7.4 - 8.4
- Laravel 8.x - 11.x
- Nova 4
- Nova 4.x - 5.x

## Installation

Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@
"homepage": "https://github.com/abordage/nova-html-card",
"require": {
"php": ">=7.4",
"laravel/nova": "^4.0|^5.0"
"laravel/nova": "^4.0 || ^5.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"larastan/larastan": "^1.0 || ^2.0",
"nunomaduro/collision": "^5.0 || ^6.0 || ^7.0 || ^8.0",
"nunomaduro/larastan": "^1.0 || ^2.0",
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"phpunit/phpunit": "^9.6 || ^10.0"
},
"repositories": {
"nova": {
"type": "composer",
"url": "https://nova.laravel.com"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
Expand Down Expand Up @@ -59,11 +65,5 @@
"test:all": "Run all code analysis and tests",
"test:phpcsf": "Run PHP-CS-Fixer test",
"test:phpstan": "Run PHPStan"
},
"repositories": {
"nova": {
"type": "composer",
"url": "https://nova.laravel.com"
}
}
}
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
includes:
- phpstan-baseline.neon
- ./vendor/nunomaduro/larastan/extension.neon
- ./vendor/larastan/larastan/extension.neon

parameters:

Expand Down
2 changes: 1 addition & 1 deletion src/HtmlCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function jsonSerialize(): array
return array_merge([
'title' => $this->title,
'content' => $this->content,
'height' => '$this->height',
'height' => $this->height,
'center' => $this->center,
], parent::jsonSerialize());
}
Expand Down
5 changes: 3 additions & 2 deletions src/HtmlRangedCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public function __construct()
parent::__construct('abordage-html-ranged-card');
}

public function calculate(NovaRequest $request)
public function calculate(NovaRequest $request): string
{
/** @var string $value */
$value = $request->range ?? $this->selectedRangeKey;

return $this->content($value);
Expand All @@ -43,7 +44,7 @@ public function jsonSerialize(): array
return array_merge([
'title' => $this->title,
'content' => $this->content,
'height' => '$this->height',
'height' => $this->height,
'center' => $this->center,
], parent::jsonSerialize());
}
Expand Down

0 comments on commit ff20694

Please sign in to comment.