original_string: public static function fromString(string $input): self
      {
          $input = preg_replace('/[^\d]/', '', $input);
  
          if (!is_numeric($input)) {
              throw new \InvalidArgumentException("Expects \$input to be a number, \"{$input}\" given.");
          }
  
          // Get the last digit.
          $checkDigit = (int) $input[strlen($input) - 1];
  
          // Remove the last digit.
          $number = substr($input, 0, strlen($input) - 1);
  
          return new self($number, $checkDigit);
      }
code: public static function fromString(string $input): self
      {
          $input = preg_replace('/[^\d]/', '', $input);
  
          if (!is_numeric($input)) {
              throw new \InvalidArgumentException("Expects \$input to be a number, \"{$input}\" given.");
          }
  
          // Get the last digit.
          $checkDigit = (int) $input[strlen($input) - 1];
  
          // Remove the last digit.
          $number = substr($input, 0, strlen($input) - 1);
  
          return new self($number, $checkDigit);
      }
code_tokens: public static function fromString ( string $ input ) : self { $ input = preg_replace ( '/[^\d]/' , '' , $ input ) ; if ( ! is_numeric ( $ input ) ) { throw new \ InvalidArgumentException ( "Expects \$input to be a number, \"{$input}\" given." ) ; } // Get the last digit. $ checkDigit = ( int ) $ input [ strlen ( $ input ) - 1 ] ; // Remove the last digit. $ number = substr ( $ input , 0 , strlen ( $ input ) - 1 ) ; return new self ( $ number , $ checkDigit ) ; }
docstring: Create a new number from an input that contains the check digit
  already.
  
  @param string $input The input that contains the check digit already.
  
  @return self
docstring_tokens: Create a new number from an input that contains the check digit already .