Skip to content

Commit

Permalink
Add PHP 8.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdullahsari committed Dec 13, 2023
1 parent 89aa127 commit 1baa2f5
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"homepage": "https://github.com/masmerise/livewire-toaster",
"require": {
"php": "~8.2",
"php": "~8.3",
"laravel/framework": "^10.0",
"livewire/livewire": "^3.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/AccessibleCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
/** @internal */
final readonly class AccessibleCollector implements Collector
{
private const AMOUNT_OF_WORDS = 100;
private const ONE_SECOND = 1000;
private const int AMOUNT_OF_WORDS = 100;
private const int ONE_SECOND = 1000;

public function __construct(private Collector $next) {}

Expand Down
2 changes: 1 addition & 1 deletion src/LivewireRelay.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/** @internal */
final readonly class LivewireRelay
{
public const EVENT = 'toaster:received';
public const string EVENT = 'toaster:received';

public function __invoke(Component $component, ComponentContext $ctx): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/SessionRelay.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/** @internal */
final readonly class SessionRelay
{
public const NAME = 'toasts';
public const string NAME = 'toasts';

public function __construct(private Application $app) {}

Expand Down
3 changes: 3 additions & 0 deletions src/Toaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Masmerise\Toaster;

use Illuminate\Support\Facades\Facade;
use Override;

/**
* @method static void assertDispatched(string $message)
Expand Down Expand Up @@ -48,11 +49,13 @@ public static function warning(string $message, array $replace = []): PendingToa
return self::toast()->message($message, $replace)->warning();
}

#[Override]
protected static function getFacadeAccessor(): string
{
return ToasterServiceProvider::NAME;
}

#[Override]
protected static function getMockableClass(): string
{
return Collector::class;
Expand Down
2 changes: 1 addition & 1 deletion src/ToasterHub.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/** @internal */
final class ToasterHub extends Component
{
public const NAME = 'toaster-hub';
public const string NAME = 'toaster-hub';

public function __construct(
private readonly ToasterConfig $config,
Expand Down
6 changes: 4 additions & 2 deletions src/ToasterServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
use Illuminate\View\Compilers\BladeCompiler;
use Livewire\LivewireManager;
use Livewire\LivewireServiceProvider;
use Override;

final class ToasterServiceProvider extends AggregateServiceProvider
{
public const CONFIG = 'toaster.config';
public const NAME = 'toaster';
public const string CONFIG = 'toaster.config';
public const string NAME = 'toaster';

protected $providers = [LivewireServiceProvider::class];

Expand All @@ -33,6 +34,7 @@ public function boot(): void
RedirectResponse::mixin($macros);
}

#[Override]
public function register(): void
{
$config = $this->configureService();
Expand Down

0 comments on commit 1baa2f5

Please sign in to comment.