If a choice field (Radio, Select, etc.) is the last field in a repeater, any field after the endRepeater() call will cause PHPStan to throw the following error:
Call to method addRadio() on an unknown class Log1x\AcfComposer\Builder\Builder.
🪪 class.notFound
For example, this causes the above error:
$fields
->addRepeater('repeater')
->addImage('image')
->addSelect('select', [
'choices' => [
1,
2,
]
])
->endRepeater()
->addText('text');
But this does not:
$fields
->addRepeater('repeater')
->addSelect('select', [
'choices' => [
1,
2,
]
])
->addImage('image')
->endRepeater()
->addText('text');
This can be fixed by adding use Log1x\AcfComposer\Builder; to src/Builder/ChoiceFieldBuilder.php - this is already on the similar src/Builder/FieldBuilder.php class.
I'll be making a PR shortlly to add the use statement