Unexpected output: Affected paths: relative - resubmit patch.
⚙ D216 MINC-168 Rename "OrderHelper::getCreditCartType" into "OrderHelper::getCreditCardType" method
Page MenuHomeIn-Portal Phabricator

MINC-168 Rename "OrderHelper::getCreditCartType" into "OrderHelper::getCreditCardType" method
ClosedPublic

Authored by erik on Mar 29 2016, 4:45 AM.

Details

Test Plan

Part 1

  • in Admin Console
    1. go to E-commerceOrders section
    2. click on Incomplete tab
    3. click on Add button on toolbar
    4. click on Billing tab
    5. on Billing tab fill only Credit Card Number field with 4716582257254288 value and press Save button
    6. confirm, that after page refresh Card Type field is automatically detected as Visa

Part 2

  • in IDE:
    1. change OrdersEventHandler::OnBeforeItemUpdate method to call $order_helper->getCreditCartType instead of $order_helper->getCreditCardType
  • in Admin Console
    1. set empty value for Card Type field on Billing tab
    2. press Save button on Billing tab
    3. confirm, that after page refresh Card Type field is automatically detected as Visa
    4. confirm, that after page refresh notice about deprecated method usage appeared in Debugger output

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 358
Build 358: arc lint + arc unit

Event Timeline

erik updated this revision to Diff 510.Mar 29 2016, 4:45 AM
erik retitled this revision from to MINC-168 Rename "OrderHelper::getCreditCartType" into "OrderHelper::getCreditCardType" method.
erik updated this object.
erik edited the test plan for this revision. (Show Details)
erik added a reviewer: alex.
erik added 1 JIRA issue(s): MINC-168.
alex requested changes to this revision.Mar 29 2016, 5:58 AM
alex edited edge metadata.
alex added inline comments.
modules/in-commerce/units/helpers/order_helper.php
171–180

Please change DocBlock to look like this:

/**
 * Detects credit card type by it's number.
 *
 * @param string $number Credit card number.
 *
 * @return     integer
 * @deprecated
 */

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.

183

Please add @ before trigger_error function call.


In task plan it's specifically said that notice should be silenced.

185

Please change E_USER_NOTICE to E_USER_DEPRECATED.


In task plan it's specifically said that deprecation notice should be triggered.

191–198

Please 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.

This revision now requires changes to proceed.Mar 29 2016, 5:58 AM
erik updated this revision to Diff 511.Mar 30 2016, 4:48 AM
erik edited edge metadata.

Added silencing, changed doc blocks.

alex added inline comments.Mar 30 2016, 5:53 AM
modules/in-commerce/units/helpers/order_helper.php
201

I've updated coding standard to allow case, when silencing deprecation error. Updated standard however isn't yet available in this In-Portal version.

alex accepted this revision.Nov 19 2016, 8:25 AM
alex updated this object.
alex edited the test plan for this revision. (Show Details)
alex edited edge metadata.
alex edited edge metadata.
alex added inline comments.
This revision is now accepted and ready to land.Nov 19 2016, 8:26 AM
This revision was automatically updated to reflect the committed changes.