0
prolog [04-Nov-2020 18:09:10 UTC] PHP Parse error: syntax error, unexpected 'return' (T_RETURN) in /Signifyd/Connect/Helper/Payment/Default.php on line 274 [04-Nov-2020 18:09:10 UTC] PHP Warning: Unexpected character in input: ' in /Signifyd/Connect/Helper/Payment/Default.php on line 273

I updated the rest of the function but I still don't see anything wonky. +++

I don't see anything wrong here, line 274 and 273 are the if and the return lines of the public function:

/**
 * @param $cvvResponseCode
 * @return null|string
 */
public function filterCvvResponseCode($cvvResponseCode)
{
    if (empty($cvvResponseCode)) {
        return null;
    }

    // http://www.emsecommerce.net/cvv_cvv2_response_codes.htm
    $validCvvResponseCodes = array('M', 'N', 'P', 'S', 'U');
    $cvvResponseCode = trim(strtoupper($cvvResponseCode));

    for ($i = 0; $i < strlen($cvvResponseCode); $i++) {
        if (!in_array(substr($cvvResponseCode, $i, 1), $validCvvResponseCodes)) {
            return null;
        }
    }

    return $cvvResponseCode;
}

/**

I'm running php 5.6 which i know is old but i don't think it has anything to do with my php version.

badsyntax
  • 1
  • 1
  • 2
    [Nothing wrong here](https://3v4l.org/0nrdQ). There must be something else. – Jeto Nov 06 '20 at 22:15
  • It's complaining about an unexpected return on line 274 and an unexpected `'` on line 273. The code you posted has no `'` in it anywhere, are you sure *this* function is the culprit? – rickdenhaan Nov 06 '20 at 22:42
  • @Jeto I updated the rest of the function. – badsyntax Nov 06 '20 at 23:22
  • @rickdenhaan I updated the rest of the code for that method. – badsyntax Nov 06 '20 at 23:22
  • What strikes me as odd is that the second warning should include the character it wasn't expecting. `Unexpected character in input: ' in /Signifyd` should be something like `Unexpected character in input: 'x' in /Signifyd` where "x" is the character. Perhaps there's some non-printable unicode character in one of your array values? If you remove that line and re-type it (don't copy/paste it), does that solve the issue? – rickdenhaan Nov 07 '20 at 14:18

0 Answers0