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 cbf5b9c

Browse files
hxvondrejmirtes
authored andcommitted
Add @throws annotations in DenormalizerInterface::denormalize() and NormalizerInterface::normalize().
1 parent 2107dee commit cbf5b9c

11 files changed

+102
-0
lines changed

‎extension.neon‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ parameters:
5858
- stubs/Symfony/Component/Serializer/Encoder/ContextAwareDecoderInterface.stub
5959
- stubs/Symfony/Component/Serializer/Encoder/DecoderInterface.stub
6060
- stubs/Symfony/Component/Serializer/Encoder/EncoderInterface.stub
61+
- stubs/Symfony/Component/Serializer/Exception/BadMethodCallException.stub
62+
- stubs/Symfony/Component/Serializer/Exception/CircularReferenceException.stub
63+
- stubs/Symfony/Component/Serializer/Exception/ExceptionInterface.stub
64+
- stubs/Symfony/Component/Serializer/Exception/ExtraAttributesException.stub
65+
- stubs/Symfony/Component/Serializer/Exception/InvalidArgumentException.stub
66+
- stubs/Symfony/Component/Serializer/Exception/LogicException.stub
67+
- stubs/Symfony/Component/Serializer/Exception/RuntimeException.stub
68+
- stubs/Symfony/Component/Serializer/Exception/UnexpectedValueException.stub
6169
- stubs/Symfony/Component/Serializer/Normalizer/ContextAwareDenormalizerInterface.stub
6270
- stubs/Symfony/Component/Serializer/Normalizer/ContextAwareNormalizerInterface.stub
6371
- stubs/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.stub
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Serializer\Exception;
4+
5+
class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface
6+
{
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Serializer\Exception;
4+
5+
class CircularReferenceException extends RuntimeException
6+
{
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Serializer\Exception;
4+
5+
interface ExceptionInterface extends \Throwable
6+
{
7+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Symfony\Component\Serializer\Exception;
4+
5+
class ExtraAttributesException extends RuntimeException
6+
{
7+
/**
8+
* @param string[] $extraAttributes
9+
*/
10+
public function __construct(array $extraAttributes, \Throwable $previous = null)
11+
{
12+
}
13+
14+
/**
15+
* @return string[]
16+
*/
17+
public function getExtraAttributes()
18+
{
19+
}
20+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Serializer\Exception;
4+
5+
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
6+
{
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Serializer\Exception;
4+
5+
class LogicException extends \LogicException implements ExceptionInterface
6+
{
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Serializer\Exception;
4+
5+
class RuntimeException extends \RuntimeException implements ExceptionInterface
6+
{
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Serializer\Exception;
4+
5+
class UnexpectedValueException extends \UnexpectedValueException implements ExceptionInterface
6+
{
7+
}

‎stubs/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.stub‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
namespace Symfony\Component\Serializer\Normalizer;
44

5+
use Symfony\Component\Serializer\Exception\BadMethodCallException;
6+
use Symfony\Component\Serializer\Exception\ExceptionInterface;
7+
use Symfony\Component\Serializer\Exception\ExtraAttributesException;
8+
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
9+
use Symfony\Component\Serializer\Exception\LogicException;
10+
use Symfony\Component\Serializer\Exception\RuntimeException;
11+
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
12+
513
interface DenormalizerInterface
614
{
715
/**
@@ -10,6 +18,14 @@ interface DenormalizerInterface
1018
* @param string|null $format
1119
* @param array<mixed> $context
1220
* @return mixed
21+
*
22+
* @throws BadMethodCallException
23+
* @throws InvalidArgumentException
24+
* @throws UnexpectedValueException
25+
* @throws ExtraAttributesException
26+
* @throws LogicException
27+
* @throws RuntimeException
28+
* @throws ExceptionInterface
1329
*/
1430
public function denormalize($data, $type, $format = null, array $context = []);
1531

0 commit comments

Comments
(0)

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