original_string: protected function _containerHasPath($container, $path)
      {
          $originalPath = $path;
          $path         = $this->_normalizeArray($path);
          $pathLength   = count($path);
  
          if (!$pathLength) {
              throw $this->_createInvalidArgumentException($this->__('Not a valid path'), null, null, $originalPath);
          }
  
          $lastSegment = $path[$pathLength - 1];
          $service     = $container;
  
          foreach ($path as $segment) {
              $hasSegment = $this->_containerHas($service, $segment);
              if (!$hasSegment) {
                  return false;
              } elseif ($segment !== $lastSegment) {
                  $service = $this->_containerGet($service, $segment);
              }
          }
  
          return true;
      }
code: protected function _containerHasPath($container, $path)
      {
          $originalPath = $path;
          $path         = $this->_normalizeArray($path);
          $pathLength   = count($path);
  
          if (!$pathLength) {
              throw $this->_createInvalidArgumentException($this->__('Not a valid path'), null, null, $originalPath);
          }
  
          $lastSegment = $path[$pathLength - 1];
          $service     = $container;
  
          foreach ($path as $segment) {
              $hasSegment = $this->_containerHas($service, $segment);
              if (!$hasSegment) {
                  return false;
              } elseif ($segment !== $lastSegment) {
                  $service = $this->_containerGet($service, $segment);
              }
          }
  
          return true;
      }
code_tokens: protected function _containerHasPath ( $ container , $ path ) { $ originalPath = $ path ; $ path = $ this -> _normalizeArray ( $ path ) ; $ pathLength = count ( $ path ) ; if ( ! $ pathLength ) { throw $ this -> _createInvalidArgumentException ( $ this -> __ ( 'Not a valid path' ) , null , null , $ originalPath ) ; } $ lastSegment = $ path [ $ pathLength - 1 ] ; $ service = $ container ; foreach ( $ path as $ segment ) { $ hasSegment = $ this -> _containerHas ( $ service , $ segment ) ; if ( ! $ hasSegment ) { return false ; } elseif ( $ segment !== $ lastSegment ) { $ service = $ this -> _containerGet ( $ service , $ segment ) ; } } return true ; }
docstring: Check that path exists on a chain of nested containers.
  
  @since [*next-version*]
  
  @param array|ArrayAccess|stdClass|BaseContainerInterface $container The container to read from.
  @param array|Traversable|stdClass                        $path      The key of the value to retrieve.
  
  @throws ContainerExceptionInterface If an error occurred while reading from the container.
  @throws OutOfRangeException         If the container or the key is invalid.
  @throws NotFoundExceptionInterface  If the key was not found in the container.
  
  @return bool True if the container has an entry for the given key, false if not.
docstring_tokens: Check that path exists on a chain of nested containers .