Skip to content

Commit

Permalink
[DependencyInjection] renamed NonExistentParameterException and NonEx…
Browse files Browse the repository at this point in the history
…istentServiceException to ParameterNotFoundException and ServiceNotFoundException
  • Loading branch information
fabpot committed May 17, 2011
1 parent 6e6d9b8 commit b370a09
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Symfony\Component\DependencyInjection\Definition;

use Symfony\Component\DependencyInjection\Exception\NonExistentServiceException;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down Expand Up @@ -47,7 +47,7 @@ private function processReferences(array $arguments)
$destId = (string) $argument;

if (!$this->container->has($destId)) {
throw new NonExistentServiceException($destId, $this->sourceId);
throw new ServiceNotFoundException($destId, $this->sourceId);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Compiler/ResolveParameterPlaceHoldersPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Symfony\Component\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\NonExistentParameterException;
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;

/**
* Resolves all parameter placeholders "%somevalue%" to their real values.
Expand Down Expand Up @@ -45,7 +45,7 @@ public function process(ContainerBuilder $container)
$definition->setMethodCalls($calls);

$definition->setProperties($this->resolveValue($definition->getProperties()));
} catch (NonExistentParameterException $e) {
} catch (ParameterNotFoundException $e) {
$e->setSourceId($id);

throw $e;
Expand All @@ -62,7 +62,7 @@ public function process(ContainerBuilder $container)
foreach ($parameterBag->all() as $key => $value) {
try {
$parameterBag->set($key, $this->resolveValue($value));
} catch (NonExistentParameterException $e) {
} catch (ParameterNotFoundException $e) {
$e->setSourceKey($key);

throw $e;
Expand Down
4 changes: 2 additions & 2 deletions Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Component\DependencyInjection;

use Symfony\Component\DependencyInjection\Exception\NonExistentServiceException;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\DependencyInjection\Exception\CircularReferenceException;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
Expand Down Expand Up @@ -238,7 +238,7 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
}

if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
throw new NonExistentServiceException($id);
throw new ServiceNotFoundException($id);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class NonExistentParameterException extends InvalidArgumentException
class ParameterNotFoundException extends InvalidArgumentException
{
private $key;
private $sourceId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class NonExistentServiceException extends InvalidArgumentException
class ServiceNotFoundException extends InvalidArgumentException
{
private $id;
private $sourceId;
Expand Down
10 changes: 5 additions & 5 deletions ParameterBag/ParameterBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Component\DependencyInjection\ParameterBag;

use Symfony\Component\DependencyInjection\Exception\NonExistentParameterException;
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;

/**
*
Expand Down Expand Up @@ -69,14 +69,14 @@ public function all()
*
* @return mixed The parameter value
*
* @throws NonExistentParameterException if the parameter is not defined
* @throws ParameterNotFoundException if the parameter is not defined
*/
public function get($name)
{
$name = strtolower($name);

if (!array_key_exists($name, $this->parameters)) {
throw new NonExistentParameterException($name);
throw new ParameterNotFoundException($name);
}

return $this->parameters[$name];
Expand Down Expand Up @@ -113,7 +113,7 @@ public function resolve()
foreach ($this->parameters as $key => $value) {
try {
$this->parameters[$key] = $this->resolveValue($value);
} catch (NonExistentParameterException $e) {
} catch (ParameterNotFoundException $e) {
$e->setSourceKey($key);

throw $e;
Expand All @@ -126,7 +126,7 @@ public function resolve()
*
* @param mixed $value A value
*
* @throws NonExistentParameterException if a placeholder references a parameter that does not exist
* @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
*/
public function resolveValue($value)
{
Expand Down
6 changes: 3 additions & 3 deletions ParameterBag/ParameterBagInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Component\DependencyInjection\ParameterBag;

use Symfony\Component\DependencyInjection\Exception\NonExistentParameterException;
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;

/**
* ParameterBagInterface.
Expand Down Expand Up @@ -46,7 +46,7 @@ function all();
*
* @return mixed The parameter value
*
* @throws NonExistentParameterException if the parameter is not defined
* @throws ParameterNotFoundException if the parameter is not defined
*/
function get($name);

Expand Down Expand Up @@ -77,7 +77,7 @@ function resolve();
*
* @param mixed $value A value
*
* @throws NonExistentParameterException if a placeholder references a parameter that does not exist
* @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
*/
function resolveValue($value);
}

0 comments on commit b370a09

Please sign in to comment.