@throws annotations should go after @return

This commit is contained in:
Nicolas Grekas 2016-06-06 11:38:47 +02:00
parent cb850fef26
commit bf3a2c0abd
30 changed files with 79 additions and 104 deletions

View File

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

View File

@ -182,9 +182,9 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
/** /**
* @param string $file * @param string $file
* *
* @throws \InvalidArgumentException
*
* @return bool * @return bool
*
* @throws \InvalidArgumentException
*/ */
protected function canBeExtracted($file) 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 * @param string $url The URL that has to be absolute
* *
* @throws \RuntimeException
*
* @return string The absolute URL * @return string The absolute URL
*
* @throws \RuntimeException
*/ */
private function ensureUrlIsAbsolute($url) private function ensureUrlIsAbsolute($url)
{ {

View File

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

View File

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

View File

@ -266,9 +266,9 @@ class Translator implements TranslatorInterface
* @param string $attribute * @param string $attribute
* @param string $value * @param string $value
* *
* @throws ExpressionErrorException
*
* @return XPathExpr * @return XPathExpr
*
* @throws ExpressionErrorException
*/ */
public function addAttributeMatching(XPathExpr $xpath, $operator, $attribute, $value) 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. * @param string $key Key.
* *
* @throws \InvalidArgumentException If key is not found.
*
* @return mixed Contents of array key. * @return mixed Contents of array key.
*
* @throws \InvalidArgumentException If key is not found.
*/ */
public function getArgument($key) public function getArgument($key)
{ {
@ -130,9 +130,9 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
* *
* @param string $key Array key. * @param string $key Array key.
* *
* @throws \InvalidArgumentException If key does not exist in $this->args.
*
* @return mixed * @return mixed
*
* @throws \InvalidArgumentException If key does not exist in $this->args.
*/ */
public function offsetGet($key) public function offsetGet($key)
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -23,9 +23,9 @@ interface TranslatorBagInterface
* *
* @param string|null $locale The locale 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 MessageCatalogueInterface * @return MessageCatalogueInterface
*
* @throws \InvalidArgumentException If the locale contains invalid characters
*/ */
public function getCatalogue($locale = null); 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 $domain The domain for the message or null to use the default
* @param string|null $locale The locale 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 * @return string The translated string
*
* @throws \InvalidArgumentException If the locale contains invalid characters
*/ */
public function trans($id, array $parameters = array(), $domain = null, $locale = null); 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 $domain The domain for the message or null to use the default
* @param string|null $locale The locale 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 * @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); public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null);