This commit is contained in:
philipp lang 2024-02-16 14:32:16 +01:00
parent 445590e060
commit 974c73af71
13 changed files with 37 additions and 2 deletions

View File

@ -66,6 +66,9 @@ class CheckboxField extends Field
return [];
}
/**
* @inheritdoc
*/
public function afterRegistration(Form $form, Participant $participant, array $input): void
{
}

View File

@ -73,6 +73,9 @@ class CheckboxesField extends Field
return app(EnumPresenter::class);
}
/**
* @inheritdoc
*/
public function afterRegistration(Form $form, Participant $participant, array $input): void
{
}

View File

@ -83,6 +83,9 @@ class DateField extends Field
return app(DatePresenter::class);
}
/**
* @inheritdoc
*/
public function afterRegistration(Form $form, Participant $participant, array $input): void
{
}

View File

@ -65,6 +65,9 @@ class DropdownField extends Field
return [];
}
/**
* @inheritdoc
*/
public function afterRegistration(Form $form, Participant $participant, array $input): void
{
}

View File

@ -20,6 +20,9 @@ abstract class Field extends Data
public string $name;
public ?NamiType $namiType = null;
/**
* @param array<array-key, mixed> $input
*/
abstract public function afterRegistration(Form $form, Participant $participant, array $input): void;
abstract public static function name(): string;

View File

@ -87,6 +87,9 @@ class GroupField extends Field
return app(GroupPresenter::class);
}
/**
* @inheritdoc
*/
public function afterRegistration(Form $form, Participant $participant, array $input): void
{
}

View File

@ -20,6 +20,9 @@ class NamiField extends Field
return [];
}
/**
* @return array<string, mixed>
*/
public static function default(): array
{
return [];

View File

@ -66,6 +66,9 @@ class RadioField extends Field
return [];
}
/**
* @inheritdoc
*/
public function afterRegistration(Form $form, Participant $participant, array $input): void
{
}

View File

@ -59,6 +59,9 @@ class TextField extends Field
return [];
}
/**
* @inheritdoc
*/
public function afterRegistration(Form $form, Participant $participant, array $input): void
{
}

View File

@ -60,6 +60,9 @@ class TextareaField extends Field
return [];
}
/**
* @inheritdoc
*/
public function afterRegistration(Form $form, Participant $participant, array $input): void
{
}

View File

@ -6,7 +6,7 @@ class EnumPresenter extends Presenter
{
/**
* @param array<int, string> $value
* @param ?array<int, string> $value
*/
public function present($value): string
{

View File

@ -4,8 +4,11 @@ namespace App\Form\Presenters;
abstract class Presenter
{
/* @var mixed */
/** @var mixed */
public $value;
/**
* @param mixed $value
*/
abstract public function present($value): string;
}

View File

@ -3,6 +3,7 @@
namespace Tests\Feature\Form;
use App\Form\Fields\Field;
use App\Form\Enums\NamiType;
use Worksome\RequestFactories\RequestFactory;
/**
@ -16,6 +17,7 @@ use Worksome\RequestFactories\RequestFactory;
* @method self maxToday(bool $maxToday)
* @method self parentGroup(int $groupId)
* @method self parentField(string $fieldKey)
* @method self namiType(?NamiType $type)
*/
class FormtemplateFieldRequest extends RequestFactory
{