original_string: private function validateIsbn10(): bool
      {
          $value = \str_replace(['-', ' '], '', $this->value);
          if (!\preg_match($this->patterns['isbn10-basic'], $value)) {
              $this->setError(self::VALIDATOR_ERROR_ISBN_INCORRECT_FORMAT);
              return false;
          }
  
          $sum = 0;
          for ($i = 0; $i < 9; $i++) {
              $sum += (10 - $i) * $value{$i};
          }
  
          $checksum = 11 - ($sum % 11);
          if ($checksum == 11) {
              $checksum = '0';
          } elseif ($checksum == 10) {
              $checksum = 'X';
          }
          $isValid = \substr($value, -1) == $checksum ? true : false;
          if (!$isValid) {
              $this->setError(self::VALIDATOR_ERROR_ISBN_INVALID_NUMBER);
          }
          return $isValid;
      }
code: private function validateIsbn10(): bool
      {
          $value = \str_replace(['-', ' '], '', $this->value);
          if (!\preg_match($this->patterns['isbn10-basic'], $value)) {
              $this->setError(self::VALIDATOR_ERROR_ISBN_INCORRECT_FORMAT);
              return false;
          }
  
          $sum = 0;
          for ($i = 0; $i < 9; $i++) {
              $sum += (10 - $i) * $value{$i};
          }
  
          $checksum = 11 - ($sum % 11);
          if ($checksum == 11) {
              $checksum = '0';
          } elseif ($checksum == 10) {
              $checksum = 'X';
          }
          $isValid = \substr($value, -1) == $checksum ? true : false;
          if (!$isValid) {
              $this->setError(self::VALIDATOR_ERROR_ISBN_INVALID_NUMBER);
          }
          return $isValid;
      }
code_tokens: private function validateIsbn10 ( ) : bool { $ value = \ str_replace ( [ '-' , ' ' ] , '' , $ this -> value ) ; if ( ! \ preg_match ( $ this -> patterns [ 'isbn10-basic' ] , $ value ) ) { $ this -> setError ( self :: VALIDATOR_ERROR_ISBN_INCORRECT_FORMAT ) ; return false ; } $ sum = 0 ; for ( $ i = 0 ; $ i < 9 ; $ i ++ ) { $ sum += ( 10 - $ i ) * $ value { $ i } ; } $ checksum = 11 - ( $ sum % 11 ) ; if ( $ checksum == 11 ) { $ checksum = '0' ; } elseif ( $ checksum == 10 ) { $ checksum = 'X' ; } $ isValid = \ substr ( $ value , - 1 ) == $ checksum ? true : false ; if ( ! $ isValid ) { $ this -> setError ( self :: VALIDATOR_ERROR_ISBN_INVALID_NUMBER ) ; } return $ isValid ; }
docstring: Validates ISBN-10 number
  
  @return bool
docstring_tokens: Validates ISBN - 10 number