Skip to content

Commit 8a8d053

Browse files
hxvondrejmirtes
authored andcommitted
Add missing @throws in stubs.
1 parent cbf5b9c commit 8a8d053

11 files changed

+58
-0
lines changed

extension.neon

+5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ parameters:
1717
- Symfony\Component\Security\Core\Authorization\Voter\Voter
1818
- Symfony\Component\Security\Core\User\PasswordUpgraderInterface
1919
stubFiles:
20+
- stubs/Psr/Cache/CacheException.stub
2021
- stubs/Psr/Cache/CacheItemInterface.stub
22+
- stubs/Psr/Cache/InvalidArgumentException.stub
2123
- stubs/Symfony/Bundle/FrameworkBundle/KernelBrowser.stub
2224
- stubs/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.stub
2325
- stubs/Symfony/Bundle/FrameworkBundle/Test/TestContainer.stub
2426
- stubs/Symfony/Component/Console/Command.stub
27+
- stubs/Symfony/Component/Console/Exception/ExceptionInterface.stub
28+
- stubs/Symfony/Component/Console/Exception/InvalidArgumentException.stub
29+
- stubs/Symfony/Component/Console/Exception/LogicException.stub
2530
- stubs/Symfony/Component/Console/Helper/HelperInterface.stub
2631
- stubs/Symfony/Component/Console/Output/OutputInterface.stub
2732
- stubs/Symfony/Component/DependencyInjection/ContainerBuilder.stub

stubs/Psr/Cache/CacheException.stub

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Psr\Cache;
4+
5+
interface CacheException extends \Throwable
6+
{
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Psr\Cache;
4+
5+
interface InvalidArgumentException extends CacheException
6+
{
7+
}

stubs/Symfony/Component/Console/Command.stub

+6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
namespace Symfony\Component\Console\Command;
44

5+
use Symfony\Component\Console\Exception\InvalidArgumentException;
6+
use Symfony\Component\Console\Exception\LogicException;
7+
58
class Command
69
{
710
/**
811
* @return \Symfony\Component\Console\Helper\HelperInterface
12+
*
13+
* @throws LogicException
14+
* @throws InvalidArgumentException
915
*/
1016
public function getHelper(string $name);
1117
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Console\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\Console\Exception;
4+
5+
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
6+
{
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\Console\Exception;
4+
5+
class LogicException extends \LogicException implements ExceptionInterface
6+
{
7+
}

stubs/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.stub

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ interface ExtensionInterface
88
{
99
/**
1010
* @param array<mixed> $configs
11+
*
12+
* @throws \InvalidArgumentException
1113
*/
1214
public function load(array $configs, ContainerBuilder $container): void;
1315
}

stubs/Symfony/Component/Serializer/Encoder/DecoderInterface.stub

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ interface DecoderInterface
1111
* @param string $format
1212
* @param array<mixed> $context
1313
* @return mixed
14+
*
15+
* @throws UnexpectedValueException
1416
*/
1517
public function decode($data, $format, array $context = []);
1618

stubs/Symfony/Component/Serializer/Encoder/EncoderInterface.stub

+4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
namespace Symfony\Component\Serializer\Encoder;
44

5+
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
6+
57
interface EncoderInterface
68
{
79
/**
810
* @param mixed $data
911
* @param string $format
1012
* @param array<mixed> $context
1113
* @return string
14+
*
15+
* @throws UnexpectedValueException
1216
*/
1317
public function encode($data, $format, array $context = []);
1418

stubs/Symfony/Contracts/Cache/CacheInterface.stub

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Symfony\Contracts\Cache;
44

5+
use Psr\Cache\InvalidArgumentException;
6+
57
interface CacheInterface
68
{
79
/**
@@ -10,6 +12,8 @@ interface CacheInterface
1012
* @param \Symfony\Contracts\Cache\CallbackInterface<T>|callable(\Symfony\Contracts\Cache\ItemInterface, bool): T $callback
1113
* @param array<mixed> $metadata
1214
* @return T
15+
*
16+
* @throws InvalidArgumentException
1317
*/
1418
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null);
1519
}

0 commit comments

Comments
 (0)