Skip to content

Commit

Permalink
Fixed the phpdoc in the DependencyInjection component
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Sep 7, 2012
1 parent 462f93a commit 05f7f78
Show file tree
Hide file tree
Showing 22 changed files with 95 additions and 78 deletions.
Expand Up @@ -116,7 +116,7 @@ private function processArguments(array $arguments)
*
* @param string $id A full id or alias for a service definition.
*
* @return Definition The definition related to the supplied id
* @return Definition|null The definition related to the supplied id
*/
private function getDefinition($id)
{
Expand Down
Expand Up @@ -51,7 +51,7 @@ public function process(ContainerBuilder $container)
*
* @param array $edges An array of Nodes
*
* @throws \RuntimeException When a circular reference is found.
* @throws ServiceCircularReferenceException When a circular reference is found.
*/
private function checkOutEdges(array $edges)
{
Expand Down
Expand Up @@ -116,7 +116,7 @@ private function validateReferences(array $arguments)
* @param Reference $reference
* @param Definition $definition
*
* @throws \RuntimeException when there is an issue with the Reference scope
* @throws ScopeWideningInjectionException|ScopeCrossingInjectionException when there is an issue with the Reference scope
*/
private function validateScope(Reference $reference, Definition $definition = null)
{
Expand Down
Expand Up @@ -70,6 +70,8 @@ public function process(ContainerBuilder $container)
*
* @param ContainerBuilder $container The ContainerBuilder
* @param array $arguments An array of arguments
*
* @return array
*/
private function inlineArguments(ContainerBuilder $container, array $arguments)
{
Expand Down
Expand Up @@ -34,8 +34,6 @@ public function setRepeatedPass(RepeatedPass $repeatedPass)
* Processes the ContainerBuilder to remove unused definitions.
*
* @param ContainerBuilder $container
*
* @return void
*/
public function process(ContainerBuilder $container)
{
Expand Down
Expand Up @@ -27,6 +27,8 @@ class RepeatedPass implements CompilerPassInterface
* Constructor.
*
* @param array $passes An array of RepeatablePassInterface objects
*
* @throws \InvalidArgumentException when the passes don't implement RepeatablePassInterface
*/
public function __construct(array $passes)
{
Expand All @@ -48,7 +50,7 @@ public function __construct(array $passes)
*/
public function process(ContainerBuilder $container)
{
$compiler = $container->getCompiler();
$container->getCompiler();
$this->repeat = false;
foreach ($this->passes as $pass) {
$pass->process($container);
Expand Down
Expand Up @@ -97,6 +97,8 @@ private function updateReferences($container, $currentId, $newId)
* @param array $arguments An array of Arguments
* @param string $currentId The alias identifier
* @param string $newId The identifier the alias points to
*
* @return array
*/
private function updateArgumentReferences(array $arguments, $currentId, $newId)
{
Expand Down
Expand Up @@ -57,6 +57,8 @@ public function process(ContainerBuilder $container)
* @param DefinitionDecorator $definition
*
* @return Definition
*
* @throws \RuntimeException When the definition is invalid
*/
private function resolveDefinition($id, DefinitionDecorator $definition)
{
Expand Down
Expand Up @@ -70,6 +70,10 @@ public function process(ContainerBuilder $container)
*
* @param array $arguments An array of Reference objects
* @param Boolean $inMethodCall
*
* @return array
*
* @throws \RuntimeException When the config is invalid
*/
private function processArguments(array $arguments, $inMethodCall = false)
{
Expand Down
Expand Up @@ -27,6 +27,8 @@ class ResolveParameterPlaceHoldersPass implements CompilerPassInterface
* Processes the ContainerBuilder to resolve parameter placeholders.
*
* @param ContainerBuilder $container
*
* @throws ParameterNotFoundException When an invalid parameter is referenced
*/
public function process(ContainerBuilder $container)
{
Expand Down
Expand Up @@ -35,6 +35,8 @@ public function __construct()
* Checks if the graph has a specific node.
*
* @param string $id Id to check
*
* @return Boolean
*/
public function hasNode($id)
{
Expand Down
15 changes: 9 additions & 6 deletions src/Symfony/Component/DependencyInjection/Container.php
Expand Up @@ -135,7 +135,7 @@ public function getParameterBag()
*
* @return mixed The parameter value
*
* @throws \InvalidArgumentException if the parameter is not defined
* @throws \InvalidArgumentException if the parameter is not defined
*
* @api
*/
Expand Down Expand Up @@ -178,6 +178,9 @@ public function setParameter($name, $value)
* @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
*
* @api
*/
public function set($id, $service, $scope = self::SCOPE_CONTAINER)
Expand Down Expand Up @@ -226,7 +229,8 @@ public function has($id)
*
* @return object The associated service
*
* @throws \InvalidArgumentException if the service is not defined
* @throws ServiceCircularReferenceException When a circular reference is detected
* @throws ServiceNotFoundException When the service is not defined
*
* @see Reference
*
Expand Down Expand Up @@ -287,7 +291,8 @@ public function getServiceIds()
*
* @param string $name
*
* @return void
* @throws \RuntimeException When the parent scope is inactive
* @throws \InvalidArgumentException When the scope does not exist
*
* @api
*/
Expand Down Expand Up @@ -333,8 +338,6 @@ public function enterScope($name)
*
* @param string $name The name of the scope to leave
*
* @return void
*
* @throws \InvalidArgumentException if the scope is not active
*
* @api
Expand Down Expand Up @@ -374,7 +377,7 @@ public function leaveScope($name)
*
* @param ScopeInterface $scope
*
* @return void
* @throws \InvalidArgumentException When the scope is invalid
*
* @api
*/
Expand Down
25 changes: 18 additions & 7 deletions src/Symfony/Component/DependencyInjection/ContainerBuilder.php
Expand Up @@ -58,6 +58,8 @@ public function registerExtension(ExtensionInterface $extension)
*
* @return ExtensionInterface An extension instance
*
* @throws \LogicException if the extension is not registered
*
* @api
*/
public function getExtension($name)
Expand Down Expand Up @@ -150,6 +152,8 @@ public function addObjectResource($object)
*
* @return ContainerBuilder The current instance
*
* @throws \LogicException if the container is frozen
*
* @api
*/
public function loadFromExtension($extension, array $values = array())
Expand Down Expand Up @@ -247,7 +251,7 @@ public function getScopeChildren()
* @param object $service The service instance
* @param string $scope The scope
*
* @throws BadMethodCallException
* @throws \BadMethodCallException if the container is frozen
*
* @api
*/
Expand Down Expand Up @@ -480,8 +484,11 @@ public function setAliases(array $aliases)
/**
* Sets an alias for an existing service.
*
* @param string $alias The alias to create
* @param mixed $id The service to alias
* @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
*
* @api
*/
Expand Down Expand Up @@ -533,7 +540,7 @@ public function hasAlias($id)
/**
* Gets all defined aliases.
*
* @return array An array of aliases
* @return Alias[] An array of aliases
*
* @api
*/
Expand Down Expand Up @@ -612,7 +619,7 @@ public function setDefinitions(array $definitions)
/**
* Gets all service definitions.
*
* @return array An array of Definition instances
* @return Definition[] An array of Definition instances
*
* @api
*/
Expand All @@ -627,7 +634,9 @@ public function getDefinitions()
* @param string $id The service identifier
* @param Definition $definition A Definition instance
*
* @throws BadMethodCallException
* @return Definition the service definition
*
* @throws \BadMethodCallException if the container is frozen
*
* @api
*/
Expand Down Expand Up @@ -708,8 +717,10 @@ public function findDefinition($id)
* @param Definition $definition A service definition instance
* @param string $id The service identifier
*
* @return object The service described by the service definition
* @return object The service described by the service definition
*
* @throws \RuntimeException When the scope is inactive
* @throws \RuntimeException When the factory definition is incomplete
* @throws \InvalidArgumentException When configure callable is not callable
*/
private function createService(Definition $definition, $id)
Expand Down
14 changes: 6 additions & 8 deletions src/Symfony/Component/DependencyInjection/ContainerInterface.php
Expand Up @@ -11,6 +11,9 @@

namespace Symfony\Component\DependencyInjection;

use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;

/**
* ContainerInterface is the interface implemented by service container classes.
*
Expand Down Expand Up @@ -46,7 +49,8 @@ public function set($id, $service, $scope = self::SCOPE_CONTAINER);
*
* @return object The associated service
*
* @throws \InvalidArgumentException if the service is not defined
* @throws ServiceCircularReferenceException When a circular reference is detected
* @throws ServiceNotFoundException When the service is not defined
*
* @see Reference
*
Expand All @@ -72,7 +76,7 @@ public function has($id);
*
* @return mixed The parameter value
*
* @throws \InvalidArgumentException if the parameter is not defined
* @throws \InvalidArgumentException if the parameter is not defined
*
* @api
*/
Expand Down Expand Up @@ -104,8 +108,6 @@ public function setParameter($name, $value);
*
* @param string $name
*
* @return void
*
* @api
*/
public function enterScope($name);
Expand All @@ -115,8 +117,6 @@ public function enterScope($name);
*
* @param string $name
*
* @return void
*
* @api
*/
public function leaveScope($name);
Expand All @@ -126,8 +126,6 @@ public function leaveScope($name);
*
* @param ScopeInterface $scope
*
* @return void
*
* @api
*/
public function addScope(ScopeInterface $scope);
Expand Down
8 changes: 6 additions & 2 deletions src/Symfony/Component/DependencyInjection/Definition.php
Expand Up @@ -240,6 +240,8 @@ public function addArgument($argument)
*
* @return Definition The current instance
*
* @throws \OutOfBoundsException When the replaced argument does not exist
*
* @api
*/
public function replaceArgument($index, $argument)
Expand Down Expand Up @@ -272,6 +274,8 @@ public function getArguments()
*
* @return mixed The argument value
*
* @throws \OutOfBoundsException When the argument does not exist
*
* @api
*/
public function getArgument($index)
Expand Down Expand Up @@ -611,7 +615,7 @@ public function isAbstract()
/**
* Sets a configurator to call after the service is fully initialized.
*
* @param mixed $callable A PHP callable
* @param callable $callable A PHP callable
*
* @return Definition The current instance
*
Expand All @@ -627,7 +631,7 @@ public function setConfigurator($callable)
/**
* Gets the configurator to call after the service is fully initialized.
*
* @return mixed The PHP callable to call
* @return callable The PHP callable to call
*
* @api
*/
Expand Down
Expand Up @@ -26,7 +26,7 @@ class DefinitionDecorator extends Definition
/**
* Constructor.
*
* @param Definition $parent The Definition instance to decorate.
* @param string $parent The id of Definition instance to decorate.
*
* @api
*/
Expand All @@ -41,7 +41,7 @@ public function __construct($parent)
/**
* Returns the Definition being decorated.
*
* @return Definition
* @return string
*
* @api
*/
Expand Down Expand Up @@ -156,6 +156,8 @@ public function setPublic($boolean)
*
* @return mixed The argument value
*
* @throws \OutOfBoundsException When the argument does not exist
*
* @api
*/
public function getArgument($index)
Expand Down
Expand Up @@ -184,6 +184,9 @@ private function addServiceInclude($id, $definition)
* @param Definition $definition
*
* @return string
*
* @throws \RuntimeException When the factory definition is incomplete
* @throws ServiceCircularReferenceException When a circular reference is detected
*/
private function addServiceInlinedDefinitions($id, $definition)
{
Expand Down

0 comments on commit 05f7f78

Please sign in to comment.