Skip to content

Commit

Permalink
Add missing @throws in stubs.
Browse files Browse the repository at this point in the history
  • Loading branch information
hxv authored and ondrejmirtes committed Feb 6, 2023
1 parent cbf5b9c commit 8a8d053
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extension.neon
Expand Up @@ -17,11 +17,16 @@ parameters:
- Symfony\Component\Security\Core\Authorization\Voter\Voter
- Symfony\Component\Security\Core\User\PasswordUpgraderInterface
stubFiles:
- stubs/Psr/Cache/CacheException.stub
- stubs/Psr/Cache/CacheItemInterface.stub
- stubs/Psr/Cache/InvalidArgumentException.stub
- stubs/Symfony/Bundle/FrameworkBundle/KernelBrowser.stub
- stubs/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.stub
- stubs/Symfony/Bundle/FrameworkBundle/Test/TestContainer.stub
- stubs/Symfony/Component/Console/Command.stub
- stubs/Symfony/Component/Console/Exception/ExceptionInterface.stub
- stubs/Symfony/Component/Console/Exception/InvalidArgumentException.stub
- stubs/Symfony/Component/Console/Exception/LogicException.stub
- stubs/Symfony/Component/Console/Helper/HelperInterface.stub
- stubs/Symfony/Component/Console/Output/OutputInterface.stub
- stubs/Symfony/Component/DependencyInjection/ContainerBuilder.stub
Expand Down
7 changes: 7 additions & 0 deletions stubs/Psr/Cache/CacheException.stub
@@ -0,0 +1,7 @@
<?php

namespace Psr\Cache;

interface CacheException extends \Throwable
{
}
7 changes: 7 additions & 0 deletions stubs/Psr/Cache/InvalidArgumentException.stub
@@ -0,0 +1,7 @@
<?php

namespace Psr\Cache;

interface InvalidArgumentException extends CacheException
{
}
6 changes: 6 additions & 0 deletions stubs/Symfony/Component/Console/Command.stub
Expand Up @@ -2,10 +2,16 @@

namespace Symfony\Component\Console\Command;

use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\LogicException;

class Command
{
/**
* @return \Symfony\Component\Console\Helper\HelperInterface
*
* @throws LogicException
* @throws InvalidArgumentException
*/
public function getHelper(string $name);
}
@@ -0,0 +1,7 @@
<?php

namespace Symfony\Component\Console\Exception;

interface ExceptionInterface extends \Throwable
{
}
@@ -0,0 +1,7 @@
<?php

namespace Symfony\Component\Console\Exception;

class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{
}
7 changes: 7 additions & 0 deletions stubs/Symfony/Component/Console/Exception/LogicException.stub
@@ -0,0 +1,7 @@
<?php

namespace Symfony\Component\Console\Exception;

class LogicException extends \LogicException implements ExceptionInterface
{
}
Expand Up @@ -8,6 +8,8 @@ interface ExtensionInterface
{
/**
* @param array<mixed> $configs
*
* @throws \InvalidArgumentException
*/
public function load(array $configs, ContainerBuilder $container): void;
}
Expand Up @@ -11,6 +11,8 @@ interface DecoderInterface
* @param string $format
* @param array<mixed> $context
* @return mixed
*
* @throws UnexpectedValueException
*/
public function decode($data, $format, array $context = []);

Expand Down
Expand Up @@ -2,13 +2,17 @@

namespace Symfony\Component\Serializer\Encoder;

use Symfony\Component\Serializer\Exception\UnexpectedValueException;

interface EncoderInterface
{
/**
* @param mixed $data
* @param string $format
* @param array<mixed> $context
* @return string
*
* @throws UnexpectedValueException
*/
public function encode($data, $format, array $context = []);

Expand Down
4 changes: 4 additions & 0 deletions stubs/Symfony/Contracts/Cache/CacheInterface.stub
Expand Up @@ -2,6 +2,8 @@

namespace Symfony\Contracts\Cache;

use Psr\Cache\InvalidArgumentException;

interface CacheInterface
{
/**
Expand All @@ -10,6 +12,8 @@ interface CacheInterface
* @param \Symfony\Contracts\Cache\CallbackInterface<T>|callable(\Symfony\Contracts\Cache\ItemInterface, bool): T $callback
* @param array<mixed> $metadata
* @return T
*
* @throws InvalidArgumentException
*/
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null);
}

0 comments on commit 8a8d053

Please sign in to comment.