original_string: public function cardNumber($value): bool
      {
          if (!is_string($value) || strlen($value) < 12) {
              return false;
          }
  
          $result = 0;
          $odd = strlen($value) % 2;
          preg_replace('/[^0-9]+/', '', $value);
  
          for ($i = 0; $i < strlen($value); ++$i) {
              $result += $odd
                  ? $value[$i]
                  : (($value[$i] * 2 > 9) ? $value[$i] * 2 - 9 : $value[$i] * 2);
  
              $odd = !$odd;
          }
  
          // Check validity.
          return ($result % 10 == 0) ? true : false;
      }
code: public function cardNumber($value): bool
      {
          if (!is_string($value) || strlen($value) < 12) {
              return false;
          }
  
          $result = 0;
          $odd = strlen($value) % 2;
          preg_replace('/[^0-9]+/', '', $value);
  
          for ($i = 0; $i < strlen($value); ++$i) {
              $result += $odd
                  ? $value[$i]
                  : (($value[$i] * 2 > 9) ? $value[$i] * 2 - 9 : $value[$i] * 2);
  
              $odd = !$odd;
          }
  
          // Check validity.
          return ($result % 10 == 0) ? true : false;
      }
code_tokens: public function cardNumber ( $ value ) : bool { if ( ! is_string ( $ value ) || strlen ( $ value ) < 12 ) { return false ; } $ result = 0 ; $ odd = strlen ( $ value ) % 2 ; preg_replace ( '/[^0-9]+/' , '' , $ value ) ; for ( $ i = 0 ; $ i < strlen ( $ value ) ; ++ $ i ) { $ result += $ odd ? $ value [ $ i ] : ( ( $ value [ $ i ] * 2 > 9 ) ? $ value [ $ i ] * 2 - 9 : $ value [ $ i ] * 2 ) ; $ odd = ! $ odd ; } // Check validity. return ( $ result % 10 == 0 ) ? true : false ; }
docstring: Check credit card passed by Luhn algorithm.
  
  @link http://en.wikipedia.org/wiki/Luhn_algorithm
  
  @param string $value
  
  @return bool
docstring_tokens: Check credit card passed by Luhn algorithm .