Changeset View
Changeset View
Standalone View
Standalone View
modules/in-commerce/units/helpers/order_helper.php
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Line(s) | |||||
if ( !$template ) { | if ( !$template ) { | ||||
$template = 'in-commerce/index'; | $template = 'in-commerce/index'; | ||||
} | } | ||||
return $template; | return $template; | ||||
} | } | ||||
/** | /** | ||||
* Detects credit card type by it's number | * Detects credit card type by it's number | ||||
* | * | ||||
* @param string $number | * @param string $number Number. | ||||
* @return int | * | ||||
* @return integer | |||||
* | |||||
* @access public | * @access public | ||||
* @deprecated | |||||
*/ | */ | ||||
alex: Please change DocBlock to look like this:
```
lang=php
/**
* Detects credit card type by it's… | |||||
public function getCreditCartType($number) | public function getCreditCartType($number) | ||||
{ | { | ||||
trigger_error( | |||||
alexUnsubmitted Not Done ReplyPlease add @ before trigger_error function call. In task plan it's specifically said that notice should be silenced. alex: Please add `@` before `trigger_error` function call.
---
In task plan it's specifically said… | |||||
'Usage of deprecated method OrderHelper::getCreditCartType. Use OrderHelper::getCreditCardType.', | |||||
E_USER_NOTICE | |||||
alexUnsubmitted Not Done ReplyPlease change E_USER_NOTICE to E_USER_DEPRECATED. In task plan it's specifically said that deprecation notice should be triggered. alex: Please change `E_USER_NOTICE` to `E_USER_DEPRECATED`.
---
In task plan it's specifically said… | |||||
); | |||||
return $this->getCreditCardType($number); | |||||
} | |||||
/** | |||||
* Detects credit card type by it's number | |||||
* | |||||
* @param string $number Number. | |||||
* | |||||
* @return integer | |||||
* @access public | |||||
*/ | |||||
alexUnsubmitted Not Done ReplyPlease change DocBlock to look like this: /** * Detects credit card type by it's number. * * @param string $number Credit card number. * * @return integer */ Fixed indentation CS issue with nearby tags in DocBlock. alex: Please change DocBlock to look like this:
```
lang=php
/**
* Detects credit card type by it's… | |||||
public function getCreditCardType($number) | |||||
{ | |||||
// Get rid of any non-digits | // Get rid of any non-digits | ||||
Not Done ReplyI've updated coding standard to allow case, when silencing deprecation error. Updated standard however isn't yet available in this In-Portal version. alex: I've updated coding standard to allow case, when silencing deprecation error. Updated standard… | |||||
Not Done Replyalex: https://github.com/aik099/CodingStandard/commit/c7ef78c8ad44b8d00275b223a94d7781a1eeb808 | |||||
$number = preg_replace('/[^\d]/', '', $number); | $number = preg_replace('/[^\d]/', '', $number); | ||||
$mapping = Array ( | $mapping = Array ( | ||||
'/^4.{15}$|^4.{12}$/' => 1, // Visa | '/^4.{15}$|^4.{12}$/' => 1, // Visa | ||||
'/^5[1-5].{14}$/' => 2, // MasterCard | '/^5[1-5].{14}$/' => 2, // MasterCard | ||||
'/^3[47].{13}$/' => 3, // American Express | '/^3[47].{13}$/' => 3, // American Express | ||||
'/^6011.{12}$/' => 4, // Discover | '/^6011.{12}$/' => 4, // Discover | ||||
'/^30[0-5].{11}$|^3[68].{12}$/' => 5, // Diners Club | '/^30[0-5].{11}$|^3[68].{12}$/' => 5, // Diners Club | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
Please change DocBlock to look like this:
Fixed indentation CS issue with nearby tags in DocBlock.
P.S.
I've fixed "arc" on your machine because it wasn't reporting this CS issue prior to differential revision submission.