original_string: protected static function familyTree(Collection $categories) : array
  	{
  		$ids = isset($ids) && count($ids) > 0 ? $ids : [];
  
          foreach ($categories as $category) {
              $ids[] = $category->id;
              if ($category->childrenRecursive->count() > 0) {
                  $ids[] = static::familyTree($category->childrenRecursive);
              }
          }
  
          return $ids;
  	}
code: protected static function familyTree(Collection $categories) : array
  	{
  		$ids = isset($ids) && count($ids) > 0 ? $ids : [];
  
          foreach ($categories as $category) {
              $ids[] = $category->id;
              if ($category->childrenRecursive->count() > 0) {
                  $ids[] = static::familyTree($category->childrenRecursive);
              }
          }
  
          return $ids;
  	}
code_tokens: protected static function familyTree ( Collection $ categories ) : array { $ ids = isset ( $ ids ) && count ( $ ids ) > 0 ? $ ids : [ ] ; foreach ( $ categories as $ category ) { $ ids [ ] = $ category -> id ; if ( $ category -> childrenRecursive -> count ( ) > 0 ) { $ ids [ ] = static :: familyTree ( $ category -> childrenRecursive ) ; } } return $ ids ; }
docstring: Returns the family tree ids for the given categories.
  
  @param  Collection $categories
  @return array
docstring_tokens: Returns the family tree ids for the given categories .