Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Add block construct replacements to acf:upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Feb 27, 2024
1 parent b15fc8a commit 742aae4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Console/UpgradeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ public function handle()

$this->replacements = [
'use StoutLogic\\AcfBuilder\\FieldsBuilder;' => 'use Log1x\\AcfComposer\\Builder;',
'use Roots\\Acorn\\Application;' => 'use Log1x\\AcfComposer\\AcfComposer;',
'new FieldsBuilder(' => 'Builder::make(',
'public function enqueue($block)' => 'public function assets($block)',
'public function enqueue($block = [])' => 'public function assets($block)',
'public function enqueue()' => 'public function assets($block)',
'public function __construct(Application $app)' => 'public function __construct(AcfComposer $composer)',
'/->addFields\(\$this->get\((.*?)\)\)/' => fn ($match) => "->addPartial({$match[1]})",
];

Expand Down

0 comments on commit 742aae4

Please sign in to comment.