Skip to content

Commit

Permalink
Add @throws annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored and ondrejmirtes committed Aug 28, 2022
1 parent e7767d9 commit 016e441
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ parameters:
- stubs/Symfony/Component/Console/Command.stub
- stubs/Symfony/Component/Console/Helper/HelperInterface.stub
- stubs/Symfony/Component/Console/Output/OutputInterface.stub
- stubs/Symfony/Component/Form/ChoiceList/Loader/ChoiceLoaderInterface.stub
- stubs/Symfony/Component/DependencyInjection/ContainerBuilder.stub
- stubs/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.stub
- stubs/Symfony/Component/EventDispatcher/EventDispatcherInterface.stub
- stubs/Symfony/Component/EventDispatcher/EventSubscriberInterface.stub
- stubs/Symfony/Component/EventDispatcher/GenericEvent.stub
- stubs/Symfony/Component/Form/ChoiceList/Loader/ChoiceLoaderInterface.stub
- stubs/Symfony/Component/Form/Exception/ExceptionInterface.stub
- stubs/Symfony/Component/Form/Exception/RuntimeException.stub
- stubs/Symfony/Component/Form/Exception/TransformationFailedException.stub
- stubs/Symfony/Component/Form/DataTransformerInterface.stub
- stubs/Symfony/Component/Form/FormBuilderInterface.stub
- stubs/Symfony/Component/Form/FormInterface.stub
Expand Down
4 changes: 4 additions & 0 deletions stubs/Symfony/Component/Form/DataTransformerInterface.stub
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ interface DataTransformerInterface
* @phpstan-param T|null $value The value in the original representation
*
* @phpstan-return R|null The value in the transformed representation
*
* @throws TransformationFailedException
*/
public function transform($value);

/**
* @phpstan-param R|null $value The value in the transformed representation
*
* @phpstan-return T|null The value in the original representation
*
* @throws TransformationFailedException
*/
public function reverseTransform($value);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Symfony\Component\Form\Exception;

interface ExceptionInterface extends \Throwable
{
}
7 changes: 7 additions & 0 deletions stubs/Symfony/Component/Form/Exception/RuntimeException.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Symfony\Component\Form\Exception;

class RuntimeException extends \RuntimeException implements ExceptionInterface
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Symfony\Component\Form\Exception;

class TransformationFailedException extends RuntimeException
{
}

0 comments on commit 016e441

Please sign in to comment.