public function __construct($type_) { if (null === ($native = Primitive::asNative($type_))) { $this->m_type = $type_; $this->m_isPrimitive = false; } else { $this->m_type = $native; $this->m_isPrimitive = true; } }
/** * Resolves (named) binding for given type. * * @param string $type_ * @param string $name_ * * @return \Components\Binding_Type_Abstract * * @throws \Components\Binding_Exception If failed to resolve binding. */ public function getBinding($type_, $name_ = null) { $hashCode = Binding_Builder::createHashCode($type_, $name_); if (isset($this->m_bindings[$hashCode])) { return $this->m_bindings[$hashCode]; } if ($native = Primitive::asNative($type_)) { $hashCode = Binding_Builder::createHashCode($native, $name_); if (isset($this->m_bindings[$hashCode])) { return $this->m_bindings[$hashCode]; } } if (false === $this->m_initialized) { throw new Binding_Exception('inject/binding/module', 'Not initialized.'); } return null; }