Skip to content

Commit

Permalink
Merge branch '4.x' of https://github.com/filamentphp/filament into 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Feb 2, 2025
2 parents 3c64b21 + a6a126e commit d0d020c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/panels/src/Pages/Concerns/HasMaxWidth.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

trait HasMaxWidth
{
protected ?string $maxWidth = null;
protected Width | string | null $maxWidth = null;

public function getMaxWidth(): Width | string | null
{
Expand Down
23 changes: 0 additions & 23 deletions packages/upgrade/bin/filament-v4
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,6 @@ render(<<<HTML
</p>
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(<<<HTML
<p>
Added <strong>Width</strong> type to <strong>\$maxContentWidth</strong> <strong>{$file}</strong>.
</p>
HTML);
}

file_put_contents($file, $fileContents);
}

$appDirectory = $argv[1] ?? 'app';

render(<<<HTML
Expand Down
6 changes: 6 additions & 0 deletions packages/upgrade/src/Rector/SimplePropertyChangesRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public function getChanges(): array
'activeNavigationIcon' => 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');
},
Expand Down

0 comments on commit d0d020c

Please sign in to comment.