Skip to content

Commit 016e441

Browse files
VincentLangletondrejmirtes
authored andcommitted
Add @throws annotation
1 parent e7767d9 commit 016e441

5 files changed

+29
-1
lines changed

extension.neon

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ parameters:
2222
- stubs/Symfony/Component/Console/Command.stub
2323
- stubs/Symfony/Component/Console/Helper/HelperInterface.stub
2424
- stubs/Symfony/Component/Console/Output/OutputInterface.stub
25-
- stubs/Symfony/Component/Form/ChoiceList/Loader/ChoiceLoaderInterface.stub
2625
- stubs/Symfony/Component/DependencyInjection/ContainerBuilder.stub
2726
- stubs/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.stub
2827
- stubs/Symfony/Component/EventDispatcher/EventDispatcherInterface.stub
2928
- stubs/Symfony/Component/EventDispatcher/EventSubscriberInterface.stub
3029
- stubs/Symfony/Component/EventDispatcher/GenericEvent.stub
30+
- stubs/Symfony/Component/Form/ChoiceList/Loader/ChoiceLoaderInterface.stub
31+
- stubs/Symfony/Component/Form/Exception/ExceptionInterface.stub
32+
- stubs/Symfony/Component/Form/Exception/RuntimeException.stub
33+
- stubs/Symfony/Component/Form/Exception/TransformationFailedException.stub
3134
- stubs/Symfony/Component/Form/DataTransformerInterface.stub
3235
- stubs/Symfony/Component/Form/FormBuilderInterface.stub
3336
- stubs/Symfony/Component/Form/FormInterface.stub

stubs/Symfony/Component/Form/DataTransformerInterface.stub

+4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ interface DataTransformerInterface
1414
* @phpstan-param T|null $value The value in the original representation
1515
*
1616
* @phpstan-return R|null The value in the transformed representation
17+
*
18+
* @throws TransformationFailedException
1719
*/
1820
public function transform($value);
1921

2022
/**
2123
* @phpstan-param R|null $value The value in the transformed representation
2224
*
2325
* @phpstan-return T|null The value in the original representation
26+
*
27+
* @throws TransformationFailedException
2428
*/
2529
public function reverseTransform($value);
2630
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Form\Exception;
4+
5+
interface ExceptionInterface extends \Throwable
6+
{
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Form\Exception;
4+
5+
class RuntimeException extends \RuntimeException implements ExceptionInterface
6+
{
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Form\Exception;
4+
5+
class TransformationFailedException extends RuntimeException
6+
{
7+
}

0 commit comments

Comments
 (0)