Issues (31)

src/ChildBuilderAttributeInterface.php (1 issue)

1
<?php
2
3
namespace Bdf\Form\Attribute;
4
5
use Bdf\Form\Attribute\Processor\CodeGenerator\AttributesProcessorGenerator;
6
use Bdf\Form\Child\ChildBuilderInterface;
7
8
/**
9
 * Base attribute type for configure ChildBuilder
10
 * The attribute should be declared on the element property
11
 *
12
 * @see ChildBuilderInterface
13
 *
14
 * @template E as \Bdf\Form\ElementBuilderInterface
15
 */
16
interface ChildBuilderAttributeInterface
17
{
18
    /**
19
     * Configure the child builder
20
     *
21
     * @param AttributeForm $form The current form instance
22
     * @param ChildBuilderInterface<E> $builder The builder to configure
23
     */
24
    public function applyOnChildBuilder(AttributeForm $form, ChildBuilderInterface $builder): void;
25
26
    /**
27
     * Generate the code corresponding to the attribute
28
     * The generated code must perform same action as `applyOnChildBuilder()`
29
     *
30
     * @param non-empty-string $name The variable name without $
0 ignored issues
show
Documentation Bug introduced by
The doc comment non-empty-string at position 0 could not be parsed: Unknown type name 'non-empty-string' at position 0 in non-empty-string.
Loading history...
31
     * @param AttributesProcessorGenerator $generator Code generator for the "configureBuilder" method
32
     * @param AttributeForm $form The current form instance
33
     *
34
     * @return void
35
     */
36
    public function generateCodeForChildBuilder(string $name, AttributesProcessorGenerator $generator, AttributeForm $form): void;
37
}
38