Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ jobs:

- name: Install Infection
run: |
wget https://github.com/infection/infection/releases/download/0.32.6/infection.phar
wget https://github.com/infection/infection/releases/download/0.32.6/infection.phar.asc
wget https://github.com/infection/infection/releases/download/0.34.0/infection.phar
wget https://github.com/infection/infection/releases/download/0.34.0/infection.phar.asc
chmod +x infection.phar
gpg --recv-keys C6D76C329EBADE2FB9C458CFC5095986493B4AA0
gpg --with-fingerprint --verify infection.phar.asc infection.phar
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
processIsolation="false"
stopOnFailure="false"
stderr="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/13.0/phpunit.xsd"
cacheDirectory=".phpunit.cache"
>
<php>
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregate/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ public function csrf(string $name = '_token'): ChildBuilderInterface
* @psalm-suppress MoreSpecificReturnType
* @psalm-suppress LessSpecificReturnStatement
*/
#[Override]
public function email(string $name): ChildBuilderInterface
{
return $this->add($name, EmailElement::class);
Expand All @@ -314,6 +315,7 @@ public function email(string $name): ChildBuilderInterface
* @psalm-suppress MoreSpecificReturnType
* @psalm-suppress LessSpecificReturnStatement
*/
#[Override]
public function url(string $name): ChildBuilderInterface
{
return $this->add($name, UrlElement::class);
Expand Down
44 changes: 44 additions & 0 deletions src/Aggregate/FormBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Bdf\Form\Leaf\Date\DateTimeElementBuilder;
use Bdf\Form\Leaf\EnumElementBuilder;
use Bdf\Form\Leaf\FloatElementBuilder;
use Bdf\Form\Leaf\Helper\EmailElement;
use Bdf\Form\Leaf\Helper\UrlElement;
use Bdf\Form\Leaf\IntegerElementBuilder;
use Bdf\Form\Leaf\StringElementBuilder;
use Bdf\Form\Phone\PhoneChildBuilder;
Expand Down Expand Up @@ -221,6 +223,48 @@ public function struct(string $name, string $structClass): ChildBuilderInterface
*/
public function csrf(string $name = '_token'): ChildBuilderInterface;

/**
* Add a new email element
* Note: The email element is a simple string but with the email constraint
*
* <code>
* $builder->email('contact')
* ->message('Invalid contact email')
* ;
* </code>
*
* @param non-empty-string $name The name of the input
*
* @return ChildBuilder|\Bdf\Form\Leaf\Helper\EmailElementBuilder
* @psalm-return ChildBuilderInterface<\Bdf\Form\Leaf\Helper\EmailElementBuilder>
*
* @psalm-suppress MoreSpecificReturnType
* @psalm-suppress LessSpecificReturnStatement
*
* @since 2.0
*/
public function email(string $name): ChildBuilderInterface;

/**
* Add a new url element
* Note: The url element is a simple string but with the url constraint
*
* <code>
* $builder->url('home')->protocols('https');
* </code>
*
* @param non-empty-string $name The name of the input
*
* @return ChildBuilder|\Bdf\Form\Leaf\Helper\UrlElementBuilder
* @psalm-return ChildBuilderInterface<\Bdf\Form\Leaf\Helper\UrlElementBuilder>
*
* @psalm-suppress MoreSpecificReturnType
* @psalm-suppress LessSpecificReturnStatement
*
* @since 2.0
*/
public function url(string $name): ChildBuilderInterface;

/**
* Add an embedded form
*
Expand Down
Loading