original_string: private function count_children_from_parent_recursively(array $postparents, int $postid) : int {
          if (!isset($postparents[$postid])) {
              // Post not found at all.
              return 0;
          }
  
          $count = 0;
          foreach ($postparents as $pid => $parentid) {
              if ($postid == $parentid) {
                  $count += $this->count_children_from_parent_recursively($postparents, $pid) + 1;
              }
          }
  
          return $count;
      }
code: private function count_children_from_parent_recursively(array $postparents, int $postid) : int {
          if (!isset($postparents[$postid])) {
              // Post not found at all.
              return 0;
          }
  
          $count = 0;
          foreach ($postparents as $pid => $parentid) {
              if ($postid == $parentid) {
                  $count += $this->count_children_from_parent_recursively($postparents, $pid) + 1;
              }
          }
  
          return $count;
      }
code_tokens: private function count_children_from_parent_recursively ( array $ postparents , int $ postid ) : int { if ( ! isset ( $ postparents [ $ postid ] ) ) { // Post not found at all. return 0 ; } $ count = 0 ; foreach ( $ postparents as $ pid => $ parentid ) { if ( $ postid == $ parentid ) { $ count += $ this -> count_children_from_parent_recursively ( $ postparents , $ pid ) + 1 ; } } return $ count ; }
docstring: Count the children whose parent matches the current record recursively.
  
  @param   array   $postparents The full mapping of posts.
  @param   int     $postid The ID to check for
  @return  int     $count
docstring_tokens: Count the children whose parent matches the current record recursively .