From a012465422a1d341c30c98afef008e3a443ec95d Mon Sep 17 00:00:00 2001 From: Kathryn Reeve Date: Wed, 27 Mar 2013 17:01:08 +0000 Subject: [PATCH] change of error name methodology --- src/ServiceManager.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ServiceManager.php b/src/ServiceManager.php index 771fd885..8be58d09 100644 --- a/src/ServiceManager.php +++ b/src/ServiceManager.php @@ -148,7 +148,7 @@ public function setShareByDefault($shareByDefault) if ($this->allowOverride === false) { throw new Exception\RuntimeException(sprintf( '%s: cannot alter default shared service setting; container is marked immutable (allow_override is false)', - str_replace(__CLASS__, get_called_class(), __METHOD__) + get_called_class() . '::' . __FUNCTION__ )); } $this->shareByDefault = (bool) $shareByDefault; @@ -362,7 +362,7 @@ public function setService($name, $service) if ($this->allowOverride === false) { throw new Exception\InvalidServiceNameException(sprintf( '%s: A service by the name "%s" or alias already exists and cannot be overridden, please use an alternate name.', - str_replace(__CLASS__, get_called_class(), __METHOD__), + get_called_class() . '::' . __FUNCTION__, $name )); } @@ -391,7 +391,7 @@ public function setShared($name, $isShared) ) { throw new Exception\ServiceNotFoundException(sprintf( '%s: A service by the name "%s" was not found and could not be marked as shared', - str_replace(__CLASS__, get_called_class(), __METHOD__), + get_called_class() . '::' . __FUNCTION__, $name )); } @@ -455,7 +455,7 @@ public function get($name, $usePeeringServiceManagers = true) throw new Exception\ServiceNotFoundException(sprintf( '%s was unable to fetch or create an instance for %s', - str_replace(__CLASS__, get_called_class(), __METHOD__), + get_called_class() . '::' . __FUNCTION__, $name )); } @@ -838,7 +838,7 @@ protected function createFromInvokable($canonicalName, $requestedName) if (!class_exists($invokable)) { throw new Exception\ServiceNotFoundException(sprintf( '%s: failed retrieving "%s%s" via invokable class "%s"; class does not exist', - str_replace(__CLASS__, get_called_class(), __METHOD__), + get_called_class() . '::' . __FUNCTION__, $canonicalName, ($requestedName ? '(alias: ' . $requestedName . ')' : ''), $invokable