Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
400 stars 53 forks source link

`wp acorn acf:upgrade` command replacing all `1`s with `public function enqueue($block)` #194

Closed thunderdw closed 4 months ago

thunderdw commented 4 months ago

When using the wp acorn acf:upgrade command, all instances of the number 1 in the file are being replaced with public function enqueue($block). This seems to have started with 7e594a7 - I tried with the commit before and it worked fine.

Example file before running wp acorn acf:upgrade on version 3.0.0:

<?php

namespace App\Fields;

use Log1x\AcfComposer\Field;
use StoutLogic\AcfBuilder\FieldsBuilder;

/**
 * Fields for the homepage hero.
 */
class HomepageHero extends Field
{
    /**
     * The field group.
     */
    public function fields(): array
    {
        $homepageHero = new FieldsBuilder('homepage_hero');

        $homepageHero->setLocation('page_type', '==', 'front_page');

        $homepageHero
            ->addText('hero_title', [
                'required' => 1,
            ])
            ->addTextarea('hero_content')
            ->addLink('hero_button');

        return $homepageHero->build();
    }
}

and after running wp acorn acf:upgrade:

<?php

namespace App\Fields;

use Logpublic function enqueue($block)x\AcfComposer\Field;
use Logpublic function enqueue($block)x\AcfComposer\Builder;

/**
 * Fields for the homepage hero.
 */
class HomepageHero extends Field
{
    /**
     * The field group.
     */
    public function fields(): array
    {
        $homepageHero = Builder::make('homepage_hero');

        $homepageHero->setLocation('page_type', '==', 'front_page');

        $homepageHero
            ->addText('hero_title', [
                'required' => public function enqueue($block),
            ])
            ->addTextarea('hero_content')
            ->addLink('hero_button');

        return $homepageHero->build();
    }
}
Log1x commented 4 months ago

bad typo. sorry about that. 3.0.1 is pushed