diff --git a/packages/panels/src/Pages/Concerns/HasMaxWidth.php b/packages/panels/src/Pages/Concerns/HasMaxWidth.php index 58d0908afa..7551a0249d 100644 --- a/packages/panels/src/Pages/Concerns/HasMaxWidth.php +++ b/packages/panels/src/Pages/Concerns/HasMaxWidth.php @@ -6,7 +6,7 @@ trait HasMaxWidth { - protected ?string $maxWidth = null; + protected Width | string | null $maxWidth = null; public function getMaxWidth(): Width | string | null { diff --git a/packages/upgrade/bin/filament-v4 b/packages/upgrade/bin/filament-v4 index ccd0d140e6..7421ab87fb 100755 --- a/packages/upgrade/bin/filament-v4 +++ b/packages/upgrade/bin/filament-v4 @@ -82,29 +82,6 @@ render(<< HTML); -foreach ([ - ...glob('*.php'), - ...glob('**/*.php'), -] as $file) { - if (str_starts_with($file, 'vendor' . DIRECTORY_SEPARATOR)) { - continue; - } - - $fileContents = file_get_contents($file); - - if (str_contains($fileContents, 'protected ?string $maxContentWidth = ')) { - $fileContents = str_replace('protected ?string $maxContentWidth = ', 'protected \Filament\Support\Enums\Width | string | null $maxContentWidth = ', $fileContents); - - render(<< - Added Width type to \$maxContentWidth {$file}. -

- HTML); - } - - file_put_contents($file, $fileContents); -} - $appDirectory = $argv[1] ?? 'app'; render(<< function (Property $node) { $node->type = new Name('string | \BackedEnum | null'); }, + 'maxContentWidth' => function (Property $node) { + $node->type = new Name('\Filament\Support\Enums\Width | string | null'); + }, + 'maxWidth' => function (Property $node) { + $node->type = new Name('\Filament\Support\Enums\Width | string | null'); + }, 'navigationIcon' => function (Property $node) { $node->type = new Name('string | \BackedEnum | null'); },