original_string: public function findTreeItem($id, MapperTreeItemInterface $item)
      {
          if ($id === $item->getId()) {
              return $item;
          }
          foreach ($item->getChildren() as $child) {
              if (null !== $treeItem = $this->findTreeItem($id, $child)) {
                  return $treeItem;
              }
          }
  
          return null;
      }
code: public function findTreeItem($id, MapperTreeItemInterface $item)
      {
          if ($id === $item->getId()) {
              return $item;
          }
          foreach ($item->getChildren() as $child) {
              if (null !== $treeItem = $this->findTreeItem($id, $child)) {
                  return $treeItem;
              }
          }
  
          return null;
      }
code_tokens: public function findTreeItem ( $ id , MapperTreeItemInterface $ item ) { if ( $ id === $ item -> getId ( ) ) { return $ item ; } foreach ( $ item -> getChildren ( ) as $ child ) { if ( null !== $ treeItem = $ this -> findTreeItem ( $ id , $ child ) ) { return $ treeItem ; } } return null ; }
docstring: Find tree item by id.
  
  @param string $id
  @param MapperTreeItemInterface $item
  
  @return null|MapperTreeItemInterface
docstring_tokens: Find tree item by id .