Skip to content

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

+1
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
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)