Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c21cb2f

Browse files
VincentLangletondrejmirtes
authored andcommitted
Add DataTransformer stub
1 parent 1e62ed3 commit c21cb2f

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

‎extension.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ parameters:
1515
- stubs/Symfony/Component/EventDispatcher/EventDispatcherInterface.stub
1616
- stubs/Symfony/Component/EventDispatcher/EventSubscriberInterface.stub
1717
- stubs/Symfony/Component/EventDispatcher/GenericEvent.stub
18+
- stubs/Symfony/Component/Form/DataTransformerInterface.stub
1819
- stubs/Symfony/Component/Form/FormBuilderInterface.stub
1920
- stubs/Symfony/Component/Form/FormInterface.stub
2021
- stubs/Symfony/Component/Form/FormTypeExtensionInterface.stub
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Symfony\Component\Form;
4+
5+
use Symfony\Component\Form\Exception\TransformationFailedException;
6+
7+
/**
8+
* @phpstan-template T
9+
* @phpstan-template R
10+
*/
11+
interface DataTransformerInterface
12+
{
13+
/**
14+
* @phpstan-param T|null $value The value in the original representation
15+
*
16+
* @phpstan-return R|null The value in the transformed representation
17+
*/
18+
public function transform($value);
19+
20+
/**
21+
* @phpstan-param R|null $value The value in the transformed representation
22+
*
23+
* @phpstan-return T|null The value in the original representation
24+
*/
25+
public function reverseTransform($value);
26+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /