original_string: public static function getISBN10CheckDigit($isbn)
      {
          $sum = 0;
          for ($x = 0; $x < strlen($isbn); $x++) {
              $sum += intval(substr($isbn, $x, 1)) * (1 + $x);
          }
          $checkdigit = $sum % 11;
          return $checkdigit == 10 ? 'X' : $checkdigit;
      }
code: public static function getISBN10CheckDigit($isbn)
      {
          $sum = 0;
          for ($x = 0; $x < strlen($isbn); $x++) {
              $sum += intval(substr($isbn, $x, 1)) * (1 + $x);
          }
          $checkdigit = $sum % 11;
          return $checkdigit == 10 ? 'X' : $checkdigit;
      }
code_tokens: public static function getISBN10CheckDigit ( $ isbn ) { $ sum = 0 ; for ( $ x = 0 ; $ x < strlen ( $ isbn ) ; $ x ++ ) { $ sum += intval ( substr ( $ isbn , $ x , 1 ) ) * ( 1 + $ x ) ; } $ checkdigit = $ sum % 11 ; return $ checkdigit == 10 ? 'X' : $ checkdigit ; }
docstring: Given the first 9 digits of an ISBN-10, generate the check digit.
  
  @param string $isbn The first 9 digits of an ISBN-10.
  
  @return string      The check digit.
docstring_tokens: Given the first 9 digits of an ISBN - 10 generate the check digit .