minor #18975 `@throws` annotations should go after `@return` (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

`@throws` annotations should go after `@return`

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

bf3a2c0 `@throws` annotations should go after `@return`
This commit is contained in:
Nicolas Grekas 2016-06-06 13:06:50 +02:00
commit 10882528a8
30 changed files with 79 additions and 104 deletions

View File

@ -67,9 +67,9 @@ class Scope
* @param string $key
* @param mixed $value
*
* @throws \LogicException
*
* @return Scope Current scope
*
* @throws \LogicException
*/
public function set($key, $value)
{

View File

@ -182,9 +182,9 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
/**
* @param string $file
*
* @throws \InvalidArgumentException
*
* @return bool
*
* @throws \InvalidArgumentException
*/
protected function canBeExtracted($file)
{

View File

@ -95,9 +95,9 @@ class AssetsExtension extends \Twig_Extension
*
* @param string $url The URL that has to be absolute
*
* @throws \RuntimeException
*
* @return string The absolute URL
*
* @throws \RuntimeException
*/
private function ensureUrlIsAbsolute($url)
{

View File

@ -56,9 +56,9 @@ class Parser implements ParserInterface
*
* @param Token[] $tokens
*
* @throws SyntaxErrorException
*
* @return array
*
* @throws SyntaxErrorException
*/
public static function parseSeries(array $tokens)
{
@ -131,9 +131,9 @@ class Parser implements ParserInterface
*
* @param TokenStream $stream
*
* @throws SyntaxErrorException
*
* @return Node\SelectorNode
*
* @throws SyntaxErrorException
*/
private function parserSelectorNode(TokenStream $stream)
{
@ -171,9 +171,9 @@ class Parser implements ParserInterface
* @param TokenStream $stream
* @param bool $insideNegation
*
* @throws SyntaxErrorException
*
* @return array
*
* @throws SyntaxErrorException
*/
private function parseSimpleSelector(TokenStream $stream, $insideNegation = false)
{
@ -328,9 +328,9 @@ class Parser implements ParserInterface
* @param Node\NodeInterface $selector
* @param TokenStream $stream
*
* @throws SyntaxErrorException
*
* @return Node\AttributeNode
*
* @throws SyntaxErrorException
*/
private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream)
{

View File

@ -83,9 +83,9 @@ class TokenStream
/**
* Returns next token.
*
* @throws InternalErrorException If there is no more token
*
* @return Token
*
* @throws InternalErrorException If there is no more token
*/
public function getNext()
{
@ -131,9 +131,9 @@ class TokenStream
/**
* Returns nex identifier token.
*
* @throws SyntaxErrorException If next token is not an identifier
*
* @return string The identifier token value
*
* @throws SyntaxErrorException If next token is not an identifier
*/
public function getNextIdentifier()
{
@ -149,9 +149,9 @@ class TokenStream
/**
* Returns nex identifier or star delimiter token.
*
* @throws SyntaxErrorException If next token is not an identifier or a star delimiter
*
* @return null|string The identifier token value or null if star found
*
* @throws SyntaxErrorException If next token is not an identifier or a star delimiter
*/
public function getNextIdentifierOrStar()
{

View File

@ -266,9 +266,9 @@ class Translator implements TranslatorInterface
* @param string $attribute
* @param string $value
*
* @throws ExpressionErrorException
*
* @return XPathExpr
*
* @throws ExpressionErrorException
*/
public function addAttributeMatching(XPathExpr $xpath, $operator, $attribute, $value)
{

View File

@ -61,9 +61,9 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
*
* @param string $key Key.
*
* @throws \InvalidArgumentException If key is not found.
*
* @return mixed Contents of array key.
*
* @throws \InvalidArgumentException If key is not found.
*/
public function getArgument($key)
{
@ -130,9 +130,9 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
*
* @param string $key Array key.
*
* @throws \InvalidArgumentException If key does not exist in $this->args.
*
* @return mixed
*
* @throws \InvalidArgumentException If key does not exist in $this->args.
*/
public function offsetGet($key)
{

View File

@ -123,9 +123,9 @@ class Expression implements ValueInterface
}
/**
* @throws \LogicException
*
* @return Glob
*
* @throws \LogicException
*/
public function getGlob()
{

View File

@ -128,9 +128,9 @@ class Finder implements \IteratorAggregate, \Countable
*
* @param string $name
*
* @throws \InvalidArgumentException
*
* @return Finder The current Finder instance
*
* @throws \InvalidArgumentException
*/
public function setAdapter($name)
{

View File

@ -1072,9 +1072,9 @@ class Form implements \IteratorAggregate, FormInterface
*
* @param mixed $value The value to transform
*
* @throws TransformationFailedException If the value cannot be transformed to "normalized" format
*
* @return mixed
*
* @throws TransformationFailedException If the value cannot be transformed to "normalized" format
*/
private function modelToNorm($value)
{
@ -1098,9 +1098,9 @@ class Form implements \IteratorAggregate, FormInterface
*
* @param string $value The value to reverse transform
*
* @throws TransformationFailedException If the value cannot be transformed to "model" format
*
* @return mixed
*
* @throws TransformationFailedException If the value cannot be transformed to "model" format
*/
private function normToModel($value)
{
@ -1126,9 +1126,9 @@ class Form implements \IteratorAggregate, FormInterface
*
* @param mixed $value The value to transform
*
* @throws TransformationFailedException If the value cannot be transformed to "view" format
*
* @return mixed
*
* @throws TransformationFailedException If the value cannot be transformed to "view" format
*/
private function normToView($value)
{
@ -1161,9 +1161,9 @@ class Form implements \IteratorAggregate, FormInterface
*
* @param string $value The value to reverse transform
*
* @throws TransformationFailedException If the value cannot be transformed to "normalized" format
*
* @return mixed
*
* @throws TransformationFailedException If the value cannot be transformed to "normalized" format
*/
private function viewToNorm($value)
{

View File

@ -181,9 +181,9 @@ class ResponseHeaderBag extends HeaderBag
*
* @param string $format
*
* @throws \InvalidArgumentException When the $format is invalid
*
* @return array
*
* @throws \InvalidArgumentException When the $format is invalid
*/
public function getCookies($format = self::COOKIES_FLAT)
{

View File

@ -24,9 +24,9 @@ interface SessionStorageInterface
/**
* Starts the session.
*
* @throws \RuntimeException If something goes wrong starting the session.
*
* @return bool True if started.
*
* @throws \RuntimeException If something goes wrong starting the session.
*/
public function start();

View File

@ -153,9 +153,9 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
/**
* Gets the Surrogate instance.
*
* @throws \LogicException
*
* @return SurrogateInterface A Surrogate instance
*
* @throws \LogicException
*/
public function getSurrogate()
{
@ -169,10 +169,10 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
/**
* Gets the Esi instance.
*
* @throws \LogicException
*
* @return Esi An Esi instance
*
* @throws \LogicException
*
* @deprecated since version 2.6, to be removed in 3.0. Use getSurrogate() instead
*/
public function getEsi()

View File

@ -477,10 +477,10 @@ class Process
* In comparison with the getOutput method which always return the whole
* output, this one returns the new output since the last call.
*
* @return string The process output since the last call
*
* @throws LogicException in case the output has been disabled
* @throws LogicException In case the process is not started
*
* @return string The process output since the last call
*/
public function getIncrementalOutput()
{
@ -536,10 +536,10 @@ class Process
* whole error output, this one returns the new error output since the last
* call.
*
* @return string The process error output since the last call
*
* @throws LogicException in case the output has been disabled
* @throws LogicException In case the process is not started
*
* @return string The process error output since the last call
*/
public function getIncrementalErrorOutput()
{

View File

@ -554,9 +554,9 @@ QUERY;
*
* @param SecurityIdentityInterface $sid
*
* @throws \InvalidArgumentException
*
* @return string
*
* @throws \InvalidArgumentException
*/
protected function getInsertSecurityIdentitySql(SecurityIdentityInterface $sid)
{
@ -626,9 +626,9 @@ QUERY;
*
* @param SecurityIdentityInterface $sid
*
* @throws \InvalidArgumentException
*
* @return string
*
* @throws \InvalidArgumentException
*/
protected function getSelectSecurityIdentityIdSql(SecurityIdentityInterface $sid)
{
@ -655,9 +655,9 @@ QUERY;
*
* @param SecurityIdentityInterface $sid
*
* @throws \InvalidArgumentException
*
* @return string
*
* @throws \InvalidArgumentException
*/
protected function getDeleteSecurityIdentityIdSql(SecurityIdentityInterface $sid)
{
@ -673,9 +673,9 @@ QUERY;
* @param int $pk
* @param array $changes
*
* @throws \InvalidArgumentException
*
* @return string
*
* @throws \InvalidArgumentException
*/
protected function getUpdateObjectIdentitySql($pk, array $changes)
{
@ -723,9 +723,9 @@ QUERY;
* @param int $pk
* @param array $sets
*
* @throws \InvalidArgumentException
*
* @return string
*
* @throws \InvalidArgumentException
*/
protected function getUpdateAccessControlEntrySql($pk, array $sets)
{

View File

@ -52,9 +52,9 @@ final class ObjectIdentity implements ObjectIdentityInterface
*
* @param object $domainObject
*
* @throws InvalidDomainObjectException
*
* @return ObjectIdentity
*
* @throws InvalidDomainObjectException
*/
public static function fromDomainObject($domainObject)
{

View File

@ -97,9 +97,9 @@ interface AclInterface extends \Serializable
* @param array $securityIdentities
* @param bool $administrativeMode
*
* @throws NoAceFoundException when no ACE was applicable for this request
*
* @return bool
*
* @throws NoAceFoundException when no ACE was applicable for this request
*/
public function isGranted(array $masks, array $securityIdentities, $administrativeMode = false);

View File

@ -25,10 +25,10 @@ interface MutableAclProviderInterface extends AclProviderInterface
*
* @param ObjectIdentityInterface $oid
*
* @return MutableAclInterface
*
* @throws AclAlreadyExistsException when there already is an ACL for the given
* object identity
*
* @return MutableAclInterface
*/
public function createAcl(ObjectIdentityInterface $oid);

View File

@ -96,10 +96,10 @@ class MaskBuilder extends AbstractMaskBuilder
*
* @param int $mask
*
* @return string
*
* @throws \InvalidArgumentException
* @throws \RuntimeException
*
* @return string
*/
public static function getCode($mask)
{

View File

@ -460,9 +460,9 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
* @param \DOMNode $node
* @param mixed $val
*
* @throws UnexpectedValueException
*
* @return bool
*
* @throws UnexpectedValueException
*/
private function selectNodeType(\DOMNode $node, $val)
{

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\Serializer\Normalizer;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
/**
* Defines the most basic interface a class must implement to be denormalizable.
*
@ -36,8 +34,6 @@ interface DenormalizableInterface
* based on different input formats
* @param array $context options for denormalizing
*
* @throws ExceptionInterface
*
* @return object
*/
public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = array());

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\Serializer\Normalizer;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
/**
* Defines the interface of denormalizers.
*
@ -28,8 +26,6 @@ interface DenormalizerInterface
* @param string $format format the given data was extracted from
* @param array $context options available to the denormalizer
*
* @throws ExceptionInterface
*
* @return object
*/
public function denormalize($data, $class, $format = null, array $context = array());

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\Serializer\Normalizer;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
/**
* Defines the most basic interface a class must implement to be normalizable.
*
@ -35,8 +33,6 @@ interface NormalizableInterface
* based on different output formats.
* @param array $context Options for normalizing this object
*
* @throws ExceptionInterface
*
* @return array|scalar
*/
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array());

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\Serializer\Normalizer;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
/**
* Defines the interface of normalizers.
*
@ -27,8 +25,6 @@ interface NormalizerInterface
* @param string $format format the normalization result will be encoded as
* @param array $context Context options for the normalizer
*
* @throws ExceptionInterface
*
* @return array|scalar
*/
public function normalize($object, $format = null, array $context = array());

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\Serializer;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
/**
* Defines the interface of the Serializer.
*
@ -27,8 +25,6 @@ interface SerializerInterface
* @param string $format format name
* @param array $context options normalizers/encoders have access to
*
* @throws ExceptionInterface
*
* @return string
*/
public function serialize($data, $format, array $context = array());
@ -41,8 +37,6 @@ interface SerializerInterface
* @param string $format
* @param array $context
*
* @throws ExceptionInterface
*
* @return object
*/
public function deserialize($data, $type, $format, array $context = array());

View File

@ -87,8 +87,6 @@ class StopwatchEvent
/**
* Stops the last started event period.
*
* @throws \LogicException When start wasn't called before stopping
*
* @return StopwatchEvent The event
*
* @throws \LogicException When stop() is called without a matching call to start()

View File

@ -54,9 +54,9 @@ abstract class AbstractFileExtractor
/**
* @param string $file
*
* @throws \InvalidArgumentException
*
* @return bool
*
* @throws \InvalidArgumentException
*/
protected function isFile($file)
{

View File

@ -112,10 +112,9 @@ class XliffFileLoader implements LoaderInterface
*
* @param string $file
*
* @throws \RuntimeException
*
* @return \SimpleXMLElement
*
* @throws \RuntimeException
* @throws InvalidResourceException
*/
private function parseFile($file)

View File

@ -23,9 +23,9 @@ interface TranslatorBagInterface
*
* @param string|null $locale The locale or null to use the default
*
* @throws \InvalidArgumentException If the locale contains invalid characters
*
* @return MessageCatalogueInterface
*
* @throws \InvalidArgumentException If the locale contains invalid characters
*/
public function getCatalogue($locale = null);
}

View File

@ -26,9 +26,9 @@ interface TranslatorInterface
* @param string|null $domain The domain for the message or null to use the default
* @param string|null $locale The locale or null to use the default
*
* @throws \InvalidArgumentException If the locale contains invalid characters
*
* @return string The translated string
*
* @throws \InvalidArgumentException If the locale contains invalid characters
*/
public function trans($id, array $parameters = array(), $domain = null, $locale = null);
@ -41,9 +41,9 @@ interface TranslatorInterface
* @param string|null $domain The domain for the message or null to use the default
* @param string|null $locale The locale or null to use the default
*
* @throws \InvalidArgumentException If the locale contains invalid characters
*
* @return string The translated string
*
* @throws \InvalidArgumentException If the locale contains invalid characters
*/
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null);