[HttpFoundation][NamespacedAttributeBag] Refactoring of resolveKey() method

This commit is contained in:
Aleksey Podskrebyshev 2013-05-10 16:58:21 +04:00
parent 31138f4474
commit a644516c5c

View File

@ -149,8 +149,8 @@ class NamespacedAttributeBag extends AttributeBag
*/ */
protected function resolveKey($name) protected function resolveKey($name)
{ {
if (strpos($name, $this->namespaceCharacter) !== false) { if (false !== $pos = strrpos($name, $this->namespaceCharacter)) {
$name = substr($name, strrpos($name, $this->namespaceCharacter)+1, strlen($name)); $name = substr($name, $pos+1);
} }
return $name; return $name;