merged branch dlsniper/docblock-enhancements (PR #6383)

This PR was squashed before being merged into the master branch (closes #6383).

Commits
-------

c2acc6c Fixed most of the docblocks/unused namespaces

Discussion
----------

Fixed most of the docblocks/unused namespaces

This PR fixes most/all of the docblocks in the framework.
Also, this removes the unused namespaces from the sources.
I've inspected the sources with the latest EAP of PhpStorm 6.

Thanks!

---------------------------------------------------------------------------

by dlsniper at 2012-12-16T21:03:32Z

@stof let me know if I can squash the commits.
Also, I've did considered about using the short class name but sometime that is not available for certain classes/contexts and it's better for IDEs to have the FQNS.

---------------------------------------------------------------------------

by stof at 2012-12-16T22:32:32Z

Using the short class name is a matter of coding standards.

For the squashijng, I would suggest waiting the end of the work (or even letting @fabpot squash it when merging). Seeing the changes in a new commit makes it easier to review as we can see the diff between the previous review and the current state.

---------------------------------------------------------------------------

by dlsniper at 2012-12-16T22:51:46Z

I know about the review that's why I've asked you about squashing the commits ;) I'll commit the reminder of the needed changes asap.

But on the more important part, I'll remove the long declarations where the class is already imported via ```use``` but it some cases, like https://github.com/symfony/symfony/pull/6383/files#L41R145 , I don't think it's ok not to provide IDE auto-completion just because the coding standard says so as we are using namespaces and IDEs might not be able to get it right without some small hints.

What do you think?

---------------------------------------------------------------------------

by dlsniper at 2012-12-16T23:14:46Z

Also, look on this:
![snapshot6](https://f.cloud.github.com/assets/607868/15850/23ee18f6-47d6-11e2-8285-0c3c06a1e60d.png)
As you can see, the IDE is confused about the type of the expected parameter vs returned parameter because the class isn't properly namespaced.

Like I've said, humans might do ok when reading it but the tools we use to code might not so we should help them out a bit.

---------------------------------------------------------------------------

by stof at 2012-12-17T09:54:04Z

@dlsniper This is because the phpdoc of the ``TreeBuilder::buildTree`` is wrong. It uses the short class name but the use statement is missing

---------------------------------------------------------------------------

by dlsniper at 2012-12-17T21:45:50Z

That's true but I'm not sure what's the preferred fix for this. Add the missing use statement or do the FQNS which breaks the CS like you've pointed out. Any pointers?

---------------------------------------------------------------------------

by mvrhov at 2012-12-18T09:37:51Z

I'm adding the use statements. Beware PhpStorm will report the classes that are used only in annotations as unused!

---------------------------------------------------------------------------

by stof at 2012-12-18T09:41:08Z

@dlsniper there is already a bunch of places where we have use statements added for the phpdoc for return values

---------------------------------------------------------------------------

by dlsniper at 2012-12-18T09:41:53Z

Ok, I'll fix this issue tonight then and revert the changes. Thanks for feedback.

---------------------------------------------------------------------------

by dlsniper at 2012-12-18T22:03:25Z

I believe this is done. Anything that I might have missed?
This commit is contained in:
Fabien Potencier 2012-12-19 08:09:50 +01:00
commit 6c43e2e168
159 changed files with 466 additions and 114 deletions

View File

@ -93,6 +93,8 @@ class ContainerAwareEventManager extends EventManager
*
* @param string|array $events The event(s) to listen on.
* @param object|string $listener The listener object.
*
* @throws \RuntimeException
*/
public function addEventListener($events, $listener)
{

View File

@ -42,6 +42,8 @@ abstract class AbstractDoctrineExtension extends Extension
/**
* @param array $objectManager A configured object manager.
* @param ContainerBuilder $container A ContainerBuilder instance
*
* @throws \InvalidArgumentException
*/
protected function loadMappingInformation(array $objectManager, ContainerBuilder $container)
{
@ -119,6 +121,8 @@ abstract class AbstractDoctrineExtension extends Extension
*
* @param array $mappingConfig
* @param string $mappingName
*
* @throws \InvalidArgumentException
*/
protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
{
@ -228,6 +232,8 @@ abstract class AbstractDoctrineExtension extends Extension
*
* @param array $mappingConfig
* @param string $objectManagerName
*
* @throws \InvalidArgumentException
*/
protected function assertValidMappingConfiguration(array $mappingConfig, $objectManagerName)
{

View File

@ -47,7 +47,7 @@ class DoctrineValidationPass implements CompilerPassInterface
*
* @param ContainerBuilder $container
* @param string $mapping
* @param type $extension
* @param string $extension
*/
private function updateValidatorMappingFiles(ContainerBuilder $container, $mapping, $extension)
{

View File

@ -26,7 +26,7 @@ class ORMQueryBuilderLoader implements EntityLoaderInterface
*
* This property should only be accessed through queryBuilder.
*
* @var Doctrine\ORM\QueryBuilder
* @var QueryBuilder
*/
private $queryBuilder;
@ -36,6 +36,8 @@ class ORMQueryBuilderLoader implements EntityLoaderInterface
* @param QueryBuilder|\Closure $queryBuilder
* @param EntityManager $manager
* @param string $class
*
* @throws UnexpectedTypeException
*/
public function __construct($queryBuilder, $manager = null, $class = null)
{

View File

@ -27,6 +27,8 @@ class CollectionToArrayTransformer implements DataTransformerInterface
* @param Collection $collection A collection of entities
*
* @return mixed An array of entities
*
* @throws UnexpectedTypeException
*/
public function transform($collection)
{

View File

@ -157,6 +157,8 @@ class DbalSessionHandler implements \SessionHandlerInterface
*
* @param string $id
* @param string $data
*
* @return Boolean
*/
private function createNewSession($id, $data = '')
{

View File

@ -40,6 +40,9 @@ class UniqueEntityValidator extends ConstraintValidator
/**
* @param object $entity
* @param Constraint $constraint
*
* @throws UnexpectedTypeException
* @throws ConstraintDefinitionException
*/
public function validate($entity, Constraint $constraint)
{

View File

@ -348,6 +348,8 @@ class ModelChoiceList extends ObjectChoiceList
*
* @param object $model The model for which to get the identifier
*
* @return array
*
* @throws FormException If the model does not exist
*/
private function getIdentifierValues($model)
@ -367,7 +369,7 @@ class ModelChoiceList extends ObjectChoiceList
/**
* Whether this column in an integer
*
* @param ColumnMap $column
* @param \ColumnMap $column
*
* @return Boolean
*/

View File

@ -51,6 +51,8 @@ class HttpKernelExtension extends \Twig_Extension implements EventSubscriberInte
* @param string $uri The URI to render
*
* @return string The Response content
*
* @throws \RuntimeException
*/
public function render(\Twig_Environment $twig, $uri)
{

View File

@ -26,6 +26,8 @@ class TransChoiceTokenParser extends TransTokenParser
* @param \Twig_Token $token A Twig_Token instance
*
* @return \Twig_NodeInterface A Twig_NodeInterface instance
*
* @throws \Twig_Error_Syntax
*/
public function parse(\Twig_Token $token)
{

View File

@ -26,6 +26,8 @@ class TransTokenParser extends \Twig_TokenParser
* @param \Twig_Token $token A Twig_Token instance
*
* @return \Twig_NodeInterface A Twig_NodeInterface instance
*
* @throws \Twig_Error_Syntax
*/
public function parse(\Twig_Token $token)
{

View File

@ -280,6 +280,8 @@ EOF
* Loads the ContainerBuilder from the cache.
*
* @return ContainerBuilder
*
* @throws \LogicException
*/
protected function getContainerBuilder()
{

View File

@ -150,6 +150,8 @@ class FrameworkExtension extends Extension
* @param array $config A configuration array
* @param ContainerBuilder $container A ContainerBuilder instance
* @param XmlFileLoader $loader An XmlFileLoader instance
*
* @throws \LogicException
*/
private function registerFormConfiguration($config, ContainerBuilder $container, XmlFileLoader $loader)
{
@ -187,6 +189,8 @@ class FrameworkExtension extends Extension
* @param array $config A profiler configuration array
* @param ContainerBuilder $container A ContainerBuilder instance
* @param XmlFileLoader $loader An XmlFileLoader instance
*
* @throws \LogicException
*/
private function registerProfilerConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
{

View File

@ -95,6 +95,9 @@ class HttpKernel extends BaseHttpKernel
* @param array $options An array of options
*
* @return string The Response content
*
* @throws \RuntimeException
* @throws \Exception
*/
public function render($controller, array $options = array())
{
@ -105,7 +108,7 @@ class HttpKernel extends BaseHttpKernel
'alt' => array(),
'standalone' => false,
'comment' => '',
'default' => null,
'default' => null,
), $options);
if (!is_array($options['alt'])) {
@ -237,6 +240,8 @@ class HttpKernel extends BaseHttpKernel
*
* @param string $uri A URI
* @param string $defaultContent Default content
*
* @return string
*/
public function renderHIncludeTag($uri, $defaultContent = null)
{

View File

@ -12,6 +12,10 @@
namespace Symfony\Bundle\FrameworkBundle\Templating;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* GlobalVariables is the entry point for Symfony global variables in Twig templates.
@ -30,7 +34,7 @@ class GlobalVariables
/**
* Returns the security context service.
*
* @return Symfony\Component\Security\Core\SecurityContext|void The security context
* @return SecurityContext|null The security context
*/
public function getSecurity()
{
@ -44,7 +48,7 @@ class GlobalVariables
*
* @return mixed|void
*
* @see Symfony\Component\Security\Core\Authentication\Token\TokenInterface::getUser()
* @see TokenInterface::getUser()
*/
public function getUser()
{
@ -67,7 +71,7 @@ class GlobalVariables
/**
* Returns the current request.
*
* @return Symfony\Component\HttpFoundation\Request|void The http request object
* @return Request|null The http request object
*/
public function getRequest()
{
@ -79,7 +83,7 @@ class GlobalVariables
/**
* Returns the current session.
*
* @return Symfony\Component\HttpFoundation\Session\Session|void The session
* @return Session|null The session
*/
public function getSession()
{

View File

@ -40,6 +40,8 @@ class ActionsHelper extends Helper
* @param array $attributes An array of request attributes
* @param array $options An array of options
*
* @return string
*
* @see Symfony\Bundle\FrameworkBundle\HttpKernel::render()
*/
public function render($controller, array $attributes = array(), array $options = array())

View File

@ -39,6 +39,8 @@ class RequestHelper extends Helper
* @param string $key The name of the parameter
* @param string $default A default value
*
* @return mixed
*
* @see Symfony\Component\HttpFoundation\Request::get()
*/
public function getParameter($key, $default = null)

View File

@ -40,7 +40,7 @@ class FilesystemLoader implements LoaderInterface
*
* @param TemplateReferenceInterface $template A template
*
* @return Storage|Boolean false if the template cannot be loaded, a Storage instance otherwise
* @return FileStorage|Boolean false if the template cannot be loaded, a Storage instance otherwise
*/
public function load(TemplateReferenceInterface $template)
{
@ -58,6 +58,8 @@ class FilesystemLoader implements LoaderInterface
*
* @param TemplateReferenceInterface $template The template name as an array
* @param integer $time The last modification time of the cached template (timestamp)
*
* @return Boolean
*/
public function isFresh(TemplateReferenceInterface $template, $time)
{

View File

@ -55,6 +55,8 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
* If not, override this method in your test classes.
*
* @return string The directory where phpunit.xml(.dist) is stored
*
* @throws \RuntimeException
*/
protected static function getPhpUnitXmlDir()
{
@ -113,6 +115,8 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
* When the Kernel is located, the file is required.
*
* @return string The Kernel class name
*
* @throws \RuntimeException
*/
protected static function getKernelClass()
{

View File

@ -39,6 +39,8 @@ class Translator extends BaseTranslator
* @param MessageSelector $selector The message selector for pluralization
* @param array $loaderIds An array of loader Ids
* @param array $options An array of options
*
* @throws \InvalidArgumentException
*/
public function __construct(ContainerInterface $container, MessageSelector $selector, $loaderIds = array(), array $options = array())
{

View File

@ -14,6 +14,7 @@ namespace Symfony\Bundle\FrameworkBundle\Validator;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidatorFactoryInterface;
use Symfony\Component\Validator\ConstraintValidator;
/**
* Uses a service container to create constraint validators.
@ -57,7 +58,7 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
*
* @param Constraint $constraint A constraint
*
* @return Symfony\Component\Validator\ConstraintValidator A validator for the supplied constraint
* @return ConstraintValidator A validator for the supplied constraint
*/
public function getInstance(Constraint $constraint)
{

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Security\Acl\Dbal\Schema;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\DBAL\Schema\SchemaException;
@ -48,7 +47,7 @@ EOF
}
/**
* @see Command
* @see Command::execute()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\TwigBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
use Symfony\Component\HttpKernel\Exception\FlattenException;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
@ -67,6 +66,8 @@ class ExceptionController
}
/**
* @param integer $startObLevel
*
* @return string
*/
protected function getAndCleanOutputBuffering($startObLevel)

View File

@ -71,6 +71,7 @@ class TwigEngine extends BaseEngine implements EngineInterface
*
* @throws \InvalidArgumentException if the template does not exist
* @throws \RuntimeException if the template cannot be rendered
* @throws \Twig_Error
*/
public function render($name, array $parameters = array())
{

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\WebProfilerBundle\Controller;
use Symfony\Component\HttpKernel\Exception\FlattenException;
use Symfony\Component\HttpKernel\Profiler\Profiler;
use Symfony\Component\HttpKernel\Debug\ExceptionHandler;
use Symfony\Component\HttpFoundation\Response;

View File

@ -59,6 +59,8 @@ class ProfilerController
* @param string $token The profiler token
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function panelAction(Request $request, $token)
{
@ -93,6 +95,8 @@ class ProfilerController
* @param string $token The profiler token
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function exportAction($token)
{

View File

@ -116,6 +116,8 @@ class Cookie
*
* @return Cookie A Cookie instance
*
* @throws \InvalidArgumentException
*
* @api
*/
public static function fromString($cookie, $url = null)

View File

@ -57,6 +57,9 @@ class ApcClassLoader
* @param string $prefix The APC namespace prefix to use.
* @param object $decorated A class loader object that implements the findFile() method.
*
* @throws \RuntimeException
* @throws \InvalidArgumentException
*
* @api
*/
public function __construct($prefix, $decorated)

View File

@ -69,6 +69,8 @@ class ApcUniversalClassLoader extends UniversalClassLoader
*
* @param string $prefix A prefix to create a namespace in APC
*
* @throws \RuntimeException
*
* @api
*/
public function __construct($prefix)

View File

@ -75,6 +75,8 @@ class DebugClassLoader
* @param string $class The name of the class
*
* @return Boolean|null True, if loaded
*
* @throws \RuntimeException
*/
public function loadClass($class)
{

View File

@ -51,6 +51,9 @@ class XcacheClassLoader
* @param string $prefix A prefix to create a namespace in Xcache
* @param object $classFinder An object that implements findFile() method.
*
* @throws \RuntimeException
* @throws \InvalidArgumentException
*
* @api
*/
public function __construct($prefix, $classFinder)

View File

@ -291,6 +291,8 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
* @param mixed $value The value to normalize
*
* @return mixed The normalized value
*
* @throws InvalidConfigurationException
*/
protected function normalizeValue($value)
{

View File

@ -286,6 +286,8 @@ abstract class BaseNode implements NodeInterface
* @param mixed $value The value to finalize
*
* @return mixed The finalized value
*
* @throws InvalidConfigurationException
*/
final public function finalize($value)
{

View File

@ -406,9 +406,9 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
/**
* Validate the configuration of a concrete node.
*
* @param NodeInterface $node The related node
* @param ArrayNode $node The related node
*
* @throws InvalidDefinitionException When an error is detected in the configuration
* @throws InvalidDefinitionException
*/
protected function validateConcreteNode(ArrayNode $node)
{
@ -442,9 +442,9 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
/**
* Validate the configuration of a prototype node.
*
* @param NodeInterface $node The related node
* @param PrototypedArrayNode $node The related node
*
* @throws InvalidDefinitionException When an error is detected in the configuration
* @throws InvalidDefinitionException
*/
protected function validatePrototypeNode(PrototypedArrayNode $node)
{

View File

@ -31,6 +31,8 @@ class EnumNodeDefinition extends ScalarNodeDefinition
* Instantiate a Node
*
* @return EnumNode The node
*
* @throws \RuntimeException
*/
protected function instantiateNode()
{

View File

@ -170,6 +170,8 @@ class ExprBuilder
* @param string $message
*
* @return ExprBuilder
*
* @throws \InvalidArgumentException
*/
public function thenInvalid($message)
{
@ -182,6 +184,8 @@ class ExprBuilder
* Sets a closure unsetting this key of the array at validation time.
*
* @return ExprBuilder
*
* @throws UnsetKeyException
*/
public function thenUnset()
{
@ -194,6 +198,8 @@ class ExprBuilder
* Returns the related node
*
* @return NodeDefinition
*
* @throws \RuntimeException
*/
public function end()
{

View File

@ -181,6 +181,8 @@ class NodeBuilder implements NodeParentInterface
* ->end()
* ;
*
* @param NodeDefinition $node
*
* @return NodeBuilder This node builder
*/
public function append(NodeDefinition $node)

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\Config\Definition\Builder;
use Symfony\Component\Config\Definition\NodeInterface;
use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
/**
* This class provides a fluent interface for defining a node.
@ -31,6 +32,9 @@ abstract class NodeDefinition implements NodeParentInterface
protected $nullEquivalent;
protected $trueEquivalent;
protected $falseEquivalent;
/**
* @var NodeParentInterface|NodeInterface
*/
protected $parent;
protected $attributes = array();
@ -336,7 +340,7 @@ abstract class NodeDefinition implements NodeParentInterface
*
* @return NodeInterface $node The node instance
*
* @throws Symfony\Component\Config\Definition\Exception\InvalidDefinitionException When the definition is invalid
* @throws InvalidDefinitionException When the definition is invalid
*/
abstract protected function createNode();

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Config\Definition\Builder;
use Symfony\Component\Config\Definition\NodeInterface;
/**
* This is the entry class for building a config tree.
*
@ -44,6 +46,8 @@ class TreeBuilder implements NodeParentInterface
* Builds the tree.
*
* @return NodeInterface
*
* @throws \RuntimeException
*/
public function buildTree()
{

View File

@ -183,7 +183,7 @@ class PrototypedArrayNode extends ArrayNode
*
* @param NodeInterface $node The child node to add
*
* @throws \RuntimeException Prototyped array nodes can't have concrete children.
* @throws Exception
*/
public function addChild(NodeInterface $node)
{
@ -233,6 +233,9 @@ class PrototypedArrayNode extends ArrayNode
* @param mixed $value The value to normalize
*
* @return mixed The normalized value
*
* @throws InvalidConfigurationException
* @throws DuplicateKeyException
*/
protected function normalizeValue($value)
{

View File

@ -19,10 +19,10 @@ namespace Symfony\Component\Config\Exception;
class FileLoaderLoadException extends \Exception
{
/**
* @param string $resource The resource that could not be imported
* @param string $sourceResource The original resource importing the new resource
* @param integer $code The error code
* @param Exception $previous A previous exception
* @param string $resource The resource that could not be imported
* @param string $sourceResource The original resource importing the new resource
* @param integer $code The error code
* @param \Exception $previous A previous exception
*/
public function __construct($resource, $sourceResource = null, $code = null, $previous = null)
{

View File

@ -57,6 +57,9 @@ abstract class FileLoader extends Loader
* @param string $sourceResource The original resource importing the new resource
*
* @return mixed
*
* @throws FileLoaderLoadException
* @throws FileLoaderImportCircularReferenceException
*/
public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null)
{

View File

@ -202,6 +202,8 @@ class Command
*
* @return integer The command exit code
*
* @throws \Exception
*
* @see setCode()
* @see execute()
*
@ -251,6 +253,8 @@ class Command
*
* @return Command The current instance
*
* @throws \InvalidArgumentException
*
* @see execute()
*
* @api

View File

@ -31,10 +31,12 @@ class DialogHelper extends Helper
* @param string|array $question The question to ask
* @param array $choices List of choices to pick from
* @param Boolean $default The default answer if the user enters nothing
* @param integer|false $attempts Max number of times to ask before giving up (false by default, which means infinite)
* @param Boolean|integer $attempts Max number of times to ask before giving up (false by default, which means infinite)
* @param string $errorMessage Message which will be shown if invalid value from choice list would be picked
*
* @return integer|string The selected value (the key of the choices array)
*
* @throws \InvalidArgumentException
*/
public function select(OutputInterface $output, $question, $choices, $default = null, $attempts = false, $errorMessage = 'Value "%s" is invalid')
{

View File

@ -218,6 +218,8 @@ class ProgressHelper extends Helper
*
* @param integer $step Number of steps to advance
* @param Boolean $redraw Whether to redraw or not
*
* @throws \LogicException
*/
public function advance($step = 1, $redraw = false)
{
@ -238,6 +240,8 @@ class ProgressHelper extends Helper
* Outputs the current progress string.
*
* @param Boolean $finish Forces the end result
*
* @throws \LogicException
*/
public function display($finish = false)
{

View File

@ -166,6 +166,8 @@ class FunctionNode implements NodeInterface
* @param XPathExpr $expr
*
* @return XPathExpr
*
* @throws ParseException
*/
protected function _xpath_nth_of_type($xpath, $expr)
{

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\CssSelector\Node;
use Symfony\Component\CssSelector\Exception\ParseException;
use Symfony\Component\CssSelector\XPathExpr;
/**
* PseudoNode represents a "selector:ident" node.
@ -145,6 +146,8 @@ class PseudoNode implements NodeInterface
* @param XPathExpr $xpath The XPath expression
*
* @return XPathExpr The modified expression
*
* @throws ParseException
*/
protected function xpath_first_of_type($xpath)
{

View File

@ -74,7 +74,7 @@ class ResolveInvalidReferencesPass implements CompilerPassInterface
*
* @return array
*
* @throws \RuntimeException When the config is invalid
* @throws RuntimeException When the config is invalid
*/
private function processArguments(array $arguments, $inMethodCall = false)
{

View File

@ -26,7 +26,7 @@ class ResolveParameterPlaceHoldersPass implements CompilerPassInterface
*
* @param ContainerBuilder $container
*
* @throws ParameterNotFoundException When an invalid parameter is referenced
* @throws ParameterNotFoundException
*/
public function process(ContainerBuilder $container)
{

View File

@ -184,8 +184,8 @@ class Container implements IntrospectableContainerInterface
* @param object $service The service instance
* @param string $scope The scope of the service
*
* @throws \RuntimeException When trying to set a service in an inactive scope
* @throws \InvalidArgumentException When trying to set a service in the prototype scope
* @throws RuntimeException When trying to set a service in an inactive scope
* @throws InvalidArgumentException When trying to set a service in the prototype scope
*
* @api
*/
@ -401,7 +401,7 @@ class Container implements IntrospectableContainerInterface
*
* @param ScopeInterface $scope
*
* @throws \InvalidArgumentException When the scope is invalid
* @throws InvalidArgumentException
*
* @api
*/

View File

@ -86,7 +86,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*
* @return ExtensionInterface An extension instance
*
* @throws \LogicException if the extension is not registered
* @throws LogicException if the extension is not registered
*
* @api
*/
@ -556,8 +556,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* @param string $alias The alias to create
* @param string|Alias $id The service to alias
*
* @throws \InvalidArgumentException if the id is not a string or an Alias
* @throws \InvalidArgumentException if the alias is for itself
* @throws InvalidArgumentException if the id is not a string or an Alias
* @throws InvalidArgumentException if the alias is for itself
*
* @api
*/

View File

@ -241,7 +241,7 @@ class Definition
*
* @return Definition The current instance
*
* @throws \OutOfBoundsException When the replaced argument does not exist
* @throws OutOfBoundsException When the replaced argument does not exist
*
* @api
*/
@ -275,7 +275,7 @@ class Definition
*
* @return mixed The argument value
*
* @throws \OutOfBoundsException When the argument does not exist
* @throws OutOfBoundsException When the argument does not exist
*
* @api
*/

View File

@ -159,7 +159,7 @@ class DefinitionDecorator extends Definition
*
* @return mixed The argument value
*
* @throws \OutOfBoundsException When the argument does not exist
* @throws OutOfBoundsException When the argument does not exist
*
* @api
*/

View File

@ -187,7 +187,7 @@ class PhpDumper extends Dumper
*
* @return string
*
* @throws \RuntimeException When the factory definition is incomplete
* @throws RuntimeException When the factory definition is incomplete
* @throws ServiceCircularReferenceException When a circular reference is detected
*/
private function addServiceInlinedDefinitions($id, $definition)
@ -816,6 +816,8 @@ EOF;
* @param integer $indent
*
* @return string
*
* @throws InvalidArgumentException
*/
private function exportParameters($parameters, $path = '', $indent = 12)
{
@ -987,6 +989,8 @@ EOF;
* @param Boolean $interpolate
*
* @return string
*
* @throws RuntimeException
*/
private function dumpValue($value, $interpolate = true)
{

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* ConfigurationExtensionInterface is the interface implemented by container extension classes.

View File

@ -275,6 +275,8 @@ class XmlFileLoader extends FileLoader
*
* @param \DOMDocument $dom
*
* @return Boolean
*
* @throws RuntimeException When extension references a non-existent XSD file
*/
public function validateSchema(\DOMDocument $dom)

View File

@ -376,6 +376,8 @@ class Crawler extends \SplObjectStorage
*
* @return Crawler A Crawler instance with the previous sibling nodes
*
* @throws \InvalidArgumentException
*
* @api
*/
public function previousAll()

View File

@ -60,6 +60,8 @@ class ContainerAwareEventDispatcher extends EventDispatcher
* @param integer $priority The higher this value, the earlier an event listener
* will be triggered in the chain.
* Defaults to 0.
*
* @throws \InvalidArgumentException
*/
public function addListenerService($eventName, $callback, $priority = 0)
{

View File

@ -144,8 +144,6 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
*
* @param string $key Array key to set.
* @param mixed $value Value.
*
* @return void
*/
public function offsetSet($key, $value)
{
@ -156,8 +154,6 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
* ArrayAccess for unset argument.
*
* @param string $key Array key.
*
* @return void
*/
public function offsetUnset($key)
{

View File

@ -185,8 +185,6 @@ abstract class AbstractFindAdapter extends AbstractAdapter
* @param string $dir
* @param string[] $paths
* @param Boolean $not
*
* @return void
*/
private function buildPathsFiltering(Command $command, $dir, array $paths, $not = false)
{

View File

@ -55,6 +55,8 @@ class Comparator
* Sets the comparison operator.
*
* @param string $operator A valid operator
*
* @throws \InvalidArgumentException
*/
public function setOperator($operator)
{
@ -73,6 +75,8 @@ class Comparator
* Tests against the target.
*
* @param mixed $test A test value
*
* @return Boolean
*/
public function test($test)
{

View File

@ -28,6 +28,8 @@ class CustomFilterIterator extends FilterIterator
*
* @param \Iterator $iterator The Iterator to filter
* @param array $filters An array of PHP callbacks
*
* @throws \InvalidArgumentException
*/
public function __construct(\Iterator $iterator, array $filters)
{

View File

@ -103,11 +103,6 @@ class FilePathsIterator extends \ArrayIterator
return $this->subPathname;
}
/**
* @param string $absolutePath
*
* @return null|string
*/
private function buildSubPath()
{
$absolutePath = parent::current();

View File

@ -32,6 +32,8 @@ class SortableIterator implements \IteratorAggregate
*
* @param \Traversable $iterator The Iterator to filter
* @param integer|callback $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback)
*
* @throws \InvalidArgumentException
*/
public function __construct(\Traversable $iterator, $sort)
{

View File

@ -176,6 +176,8 @@ class Command
* @param string $label
*
* @return Command The labeled command
*
* @throws \RuntimeException
*/
public function get($label)
{
@ -216,6 +218,8 @@ class Command
* Executes current command.
*
* @return array The command result
*
* @throws \RuntimeException
*/
public function execute()
{

View File

@ -59,6 +59,8 @@ class SplFileInfo extends \SplFileInfo
* Returns the contents of the file
*
* @return string the contents of the file
*
* @throws \RuntimeException
*/
public function getContents()
{

View File

@ -12,6 +12,8 @@
namespace Symfony\Component\Form\Extension\Core\DataTransformer;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
/**
* Passes a value through multiple value transformers
@ -48,8 +50,8 @@ class DataTransformerChain implements DataTransformerInterface
*
* @return mixed The transformed value
*
* @throws Symfony\Component\Form\Exception\TransformationFailedException
* @throws Symfony\Component\Form\Exception\UnexpectedTypeException
* @throws TransformationFailedException
* @throws UnexpectedTypeException
*/
public function transform($value)
{
@ -73,8 +75,8 @@ class DataTransformerChain implements DataTransformerInterface
*
* @return mixed The reverse-transformed value
*
* @throws Symfony\Component\Form\Exception\TransformationFailedException
* @throws Symfony\Component\Form\Exception\UnexpectedTypeException
* @throws TransformationFailedException
* @throws UnexpectedTypeException
*/
public function reverseTransform($value)
{

View File

@ -65,6 +65,13 @@ class BinaryFileResponse extends Response
* Sets the file to stream.
*
* @param SplFileInfo|string $file The file to stream
* @param string $contentDisposition
* @param Boolean $autoEtag
* @param Boolean $autoLastModified
*
* @return BinaryFileResponse
*
* @throws FileException
*/
public function setFile($file, $contentDisposition = null, $autoEtag = false, $autoLastModified = true)
{
@ -127,6 +134,8 @@ class BinaryFileResponse extends Response
* @param string $disposition ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT
* @param string $filename Optionally use this filename instead of the real name of the file
* @param string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename
*
* @return BinaryFileResponse
*/
public function setContentDisposition($disposition, $filename = '', $filenameFallback = '')
{

View File

@ -39,6 +39,8 @@ class Cookie
* @param Boolean $secure Whether the cookie should only be transmitted over a secure HTTPS connection from the client
* @param Boolean $httpOnly Whether the cookie will be made accessible only through the HTTP protocol
*
* @throws \InvalidArgumentException
*
* @api
*/
public function __construct($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = true)

View File

@ -99,7 +99,9 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface
*
* @return string The mime type or NULL, if none could be guessed
*
* @throws FileException If the file does not exist
* @throws \LogicException
* @throws FileNotFoundException
* @throws AccessDeniedException
*/
public function guess($path)
{

View File

@ -49,6 +49,8 @@ class JsonResponse extends Response
* @param string $callback
*
* @return JsonResponse
*
* @throws \InvalidArgumentException
*/
public function setCallback($callback = null)
{

View File

@ -96,6 +96,8 @@ class ParameterBag implements \IteratorAggregate, \Countable
*
* @return mixed
*
* @throws \InvalidArgumentException
*
* @api
*/
public function get($path, $default = null, $deep = false)

View File

@ -29,6 +29,8 @@ class RedirectResponse extends Response
* @param integer $status The status code (302 by default)
* @param array $headers The headers (Location is always set to the given url)
*
* @throws \InvalidArgumentException
*
* @see http://tools.ietf.org/html/rfc2616#section-10.3
*
* @api
@ -72,6 +74,8 @@ class RedirectResponse extends Response
* @param string $url The URL to redirect to
*
* @return RedirectResponse The current response.
*
* @throws \InvalidArgumentException
*/
public function setTargetUrl($url)
{

View File

@ -500,6 +500,8 @@ class Request
*
* @param string $key The header key
* @param string $value The header name
*
* @throws \InvalidArgumentException
*/
public static function setTrustedHeaderName($key, $value)
{
@ -1258,6 +1260,8 @@ class Request
* @param Boolean $asResource If true, a resource will be returned
*
* @return string|resource The request body content or a resource to read the body stream.
*
* @throws \LogicException
*/
public function getContent($asResource = false)
{

View File

@ -336,6 +336,8 @@ class Response
*
* @return Response
*
* @throws \UnexpectedValueException
*
* @api
*/
public function setContent($content)
@ -875,6 +877,8 @@ class Response
*
* @return Response
*
* @throws \InvalidArgumentException
*
* @api
*/
public function setCache(array $options)

View File

@ -99,6 +99,8 @@ abstract class AbstractProxy
* Sets the session ID.
*
* @param string $id
*
* @throws \LogicException
*/
public function setId($id)
{
@ -123,6 +125,8 @@ abstract class AbstractProxy
* Sets the session name.
*
* @param string $name
*
* @throws \LogicException
*/
public function setName($name)
{

View File

@ -62,6 +62,8 @@ class StreamedResponse extends Response
* Sets the PHP callback associated with this Response.
*
* @param mixed $callback A valid PHP callback
*
* @throws \LogicException
*/
public function setCallback($callback)
{

View File

@ -16,6 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\Console\Application;
use Symfony\Component\Finder\Finder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
/**
* An implementation of BundleInterface that adds a few conventions
@ -64,6 +65,8 @@ abstract class Bundle extends ContainerAware implements BundleInterface
*
* @return ExtensionInterface|null The container extension
*
* @throws \LogicException
*
* @api
*/
public function getContainerExtension()

View File

@ -71,6 +71,8 @@ class Client extends BaseClient
* Returns the script to execute when the request must be insulated.
*
* @param Request $request A Request instance
*
* @return string
*/
protected function getScript($request)
{

View File

@ -91,6 +91,8 @@ class ControllerResolver implements ControllerResolverInterface
* @param Request $request A Request instance
* @param mixed $controller A PHP callable
*
* @return array
*
* @throws \RuntimeException When value for argument given is not provided
*
* @api
@ -142,6 +144,8 @@ class ControllerResolver implements ControllerResolverInterface
* @param string $controller A Controller string
*
* @return mixed A PHP callable
*
* @throws \InvalidArgumentException
*/
protected function createController($controller)
{

View File

@ -177,6 +177,8 @@ class TraceableEventDispatcher implements EventDispatcherInterface, TraceableEve
*
* @param string $method The method name
* @param array $arguments The method arguments
*
* @return mixed
*/
public function __call($method, $arguments)
{

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\HttpKernel\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This extension sub-class provides first-class integration with the

View File

@ -59,6 +59,8 @@ class FilterControllerEvent extends KernelEvent
*
* @param callable $controller
*
* @throws \LogicException
*
* @api
*/
public function setController($controller)

View File

@ -41,6 +41,8 @@ class RouterListener implements EventSubscriberInterface
* @param UrlMatcherInterface|RequestMatcherInterface $matcher The Url or Request matcher
* @param RequestContext|null $context The RequestContext (can be null when $matcher implements RequestContextAwareInterface)
* @param LoggerInterface|null $logger The logger
*
* @throws \InvalidArgumentException
*/
public function __construct($matcher, RequestContext $context = null, LoggerInterface $logger = null)
{

View File

@ -21,9 +21,9 @@ class BadRequestHttpException extends HttpException
/**
* Constructor.
*
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($message = null, \Exception $previous = null, $code = 0)
{

View File

@ -21,9 +21,9 @@ class ConflictHttpException extends HttpException
/**
* Constructor.
*
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($message = null, \Exception $previous = null, $code = 0)
{

View File

@ -21,9 +21,9 @@ class GoneHttpException extends HttpException
/**
* Constructor.
*
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($message = null, \Exception $previous = null, $code = 0)
{

View File

@ -21,9 +21,9 @@ class LengthRequiredHttpException extends HttpException
/**
* Constructor.
*
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($message = null, \Exception $previous = null, $code = 0)
{

View File

@ -21,9 +21,9 @@ class NotAcceptableHttpException extends HttpException
/**
* Constructor.
*
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($message = null, \Exception $previous = null, $code = 0)
{

View File

@ -21,9 +21,9 @@ class PreconditionFailedHttpException extends HttpException
/**
* Constructor.
*
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($message = null, \Exception $previous = null, $code = 0)
{

View File

@ -22,9 +22,9 @@ class PreconditionRequiredHttpException extends HttpException
/**
* Constructor.
*
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($message = null, \Exception $previous = null, $code = 0)
{

View File

@ -21,10 +21,10 @@ class ServiceUnavailableHttpException extends HttpException
/**
* Constructor.
*
* @param int|string $retryAfter The number of seconds or HTTP-date after which the request may be retried
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param int|string $retryAfter The number of seconds or HTTP-date after which the request may be retried
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($retryAfter = null, $message = null, \Exception $previous = null, $code = 0)
{

View File

@ -22,10 +22,10 @@ class TooManyRequestsHttpException extends HttpException
/**
* Constructor.
*
* @param int|string $retryAfter The number of seconds or HTTP-date after which the request may be retried
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param integer|string $retryAfter The number of seconds or HTTP-date after which the request may be retried
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($retryAfter = null, $message = null, \Exception $previous = null, $code = 0)
{

View File

@ -21,10 +21,10 @@ class UnauthorizedHttpException extends HttpException
/**
* Constructor.
*
* @param string $challenge WWW-Authenticate challenge string
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param string $challenge WWW-Authenticate challenge string
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($challenge, $message = null, \Exception $previous = null, $code = 0)
{

View File

@ -21,9 +21,9 @@ class UnsupportedMediaTypeHttpException extends HttpException
/**
* Constructor.
*
* @param string $message The internal exception message
* @param Exception $previous The previous exception
* @param integer $code The internal exception code
* @param string $message The internal exception message
* @param \Exception $previous The previous exception
* @param integer $code The internal exception code
*/
public function __construct($message = null, \Exception $previous = null, $code = 0)
{

View File

@ -117,6 +117,8 @@ class Esi
* @param string $alt An alternate URI
* @param Boolean $ignoreErrors Whether to ignore errors or not
* @param string $comment A comment to add as an esi:include tag
*
* @return string
*/
public function renderIncludeTag($uri, $alt = null, $ignoreErrors = true, $comment = '')
{
@ -138,6 +140,8 @@ class Esi
*
* @param Request $request A Request instance
* @param Response $response A Response instance
*
* @return Response
*/
public function process(Request $request, Response $response)
{
@ -182,6 +186,11 @@ class Esi
* @param string $uri The main URI
* @param string $alt An alternative URI
* @param Boolean $ignoreErrors Whether to ignore errors or not
*
* @return string
*
* @throws \RuntimeException
* @throws \Exception
*/
public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors)
{
@ -212,6 +221,8 @@ class Esi
* @param array $attributes An array containing the attributes.
*
* @return string The response content for the include.
*
* @throws \RuntimeException
*/
private function handleEsiIncludeTag($attributes)
{

View File

@ -19,6 +19,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\TerminableInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpCache\Esi;
/**
* Cache provides HTTP caching.
@ -135,7 +136,7 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
/**
* Gets the Request instance associated with the master request.
*
* @return Symfony\Component\HttpFoundation\Request A Request instance
* @return Request A Request instance
*/
public function getRequest()
{
@ -145,7 +146,7 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
/**
* Gets the Kernel instance
*
* @return Symfony\Component\HttpKernel\HttpKernelInterface An HttpKernelInterface instance
* @return HttpKernelInterface An HttpKernelInterface instance
*/
public function getKernel()
{
@ -156,7 +157,7 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
/**
* Gets the Esi instance
*
* @return Symfony\Component\HttpKernel\HttpCache\Esi An Esi instance
* @return Esi An Esi instance
*/
public function getEsi()
{
@ -251,6 +252,8 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
*
* @return Response A Response instance
*
* @throws \Exception
*
* @see RFC2616 13.10
*/
protected function invalidate(Request $request, $catch = false)
@ -288,6 +291,8 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
* @param Boolean $catch whether to process exceptions
*
* @return Response A Response instance
*
* @throws \Exception
*/
protected function lookup(Request $request, $catch = false)
{
@ -549,6 +554,8 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
*
* @param Request $request A Request instance
* @param Response $response A Response instance
*
* @throws \Exception
*/
protected function store(Request $request, Response $response)
{

View File

@ -157,6 +157,8 @@ class Store implements StoreInterface
* @param Response $response A Response instance
*
* @return string The key under which the response is stored
*
* @throws \RuntimeException
*/
public function write(Request $request, Response $response)
{
@ -219,6 +221,8 @@ class Store implements StoreInterface
* Invalidates all cache entries that match the request.
*
* @param Request $request A Request instance
*
* @throws \RuntimeException
*/
public function invalidate(Request $request)
{
@ -336,6 +340,8 @@ class Store implements StoreInterface
*
* @param string $key The store key
* @param string $data The data to store
*
* @return Boolean
*/
private function save($key, $data)
{
@ -415,6 +421,8 @@ class Store implements StoreInterface
*
* @param array $headers An array of HTTP headers for the Response
* @param string $body The Response body
*
* @return Response
*/
private function restoreResponse($headers, $body = null)
{

View File

@ -179,6 +179,8 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
* @param integer $type The type of the request
*
* @return Response A Response instance
*
* @throws \Exception
*/
private function handleException(\Exception $e, $request, $type)
{

View File

@ -619,6 +619,8 @@ abstract class Kernel implements KernelInterface, TerminableInterface
* Builds the service container.
*
* @return ContainerBuilder The compiled service container
*
* @throws \RuntimeException
*/
protected function buildContainer()
{

Some files were not shown because too many files have changed in this diff Show More