original_string: protected function _containerHas($container, $key)
      {
          $key = $this->_normalizeKey($key);
  
          if ($container instanceof BaseContainerInterface) {
              return $container->has($key);
          }
  
          if ($container instanceof ArrayAccess) {
              // Catching exceptions thrown by `offsetExists()`
              try {
                  return $container->offsetExists($key);
              } catch (RootException $e) {
                  throw $this->_createContainerException($this->__('Could not check for key "%1$s"', [$key]), null, $e, null);
              }
          }
  
          if (is_array($container)) {
              return array_key_exists($key, $container);
          }
  
          if ($container instanceof stdClass) {
              return property_exists($container, $key);
          }
  
          throw $this->_createInvalidArgumentException($this->__('Not a valid container'), null, null, $container);
      }
code: protected function _containerHas($container, $key)
      {
          $key = $this->_normalizeKey($key);
  
          if ($container instanceof BaseContainerInterface) {
              return $container->has($key);
          }
  
          if ($container instanceof ArrayAccess) {
              // Catching exceptions thrown by `offsetExists()`
              try {
                  return $container->offsetExists($key);
              } catch (RootException $e) {
                  throw $this->_createContainerException($this->__('Could not check for key "%1$s"', [$key]), null, $e, null);
              }
          }
  
          if (is_array($container)) {
              return array_key_exists($key, $container);
          }
  
          if ($container instanceof stdClass) {
              return property_exists($container, $key);
          }
  
          throw $this->_createInvalidArgumentException($this->__('Not a valid container'), null, null, $container);
      }
code_tokens: protected function _containerHas ( $ container , $ key ) { $ key = $ this -> _normalizeKey ( $ key ) ; if ( $ container instanceof BaseContainerInterface ) { return $ container -> has ( $ key ) ; } if ( $ container instanceof ArrayAccess ) { // Catching exceptions thrown by `offsetExists()` try { return $ container -> offsetExists ( $ key ) ; } catch ( RootException $ e ) { throw $ this -> _createContainerException ( $ this -> __ ( 'Could not check for key "%1$s"' , [ $ key ] ) , null , $ e , null ) ; } } if ( is_array ( $ container ) ) { return array_key_exists ( $ key , $ container ) ; } if ( $ container instanceof stdClass ) { return property_exists ( $ container , $ key ) ; } throw $ this -> _createInvalidArgumentException ( $ this -> __ ( 'Not a valid container' ) , null , null , $ container ) ; }
docstring: Checks for a key on a container.
  
  @since [*next-version*]
  
  @param array|ArrayAccess|stdClass|BaseContainerInterface $container The container to check.
  @param string|int|float|bool|Stringable                  $key       The key to check for.
  
  @throws ContainerExceptionInterface If an error occurred while checking the container.
  @throws OutOfRangeException         If the container or the key is invalid.
  
  @return bool True if the container has an entry for the given key, false if not.
docstring_tokens: Checks for a key on a container .