Handle feedback

This commit is contained in:
Justin Shreve 2016-11-14 09:08:46 -08:00
parent 370166a6b0
commit 944e5d658b
3 changed files with 10 additions and 10 deletions

View File

@ -18,10 +18,11 @@ if ( ! defined( 'ABSPATH' ) ) {
abstract class WC_Legacy_Payment_Token extends WC_Data {
/**
* Read a tokem by ID (deprecated).
* Read a token by ID.
* @deprecated 2.7.0 - Init a token class with an ID.
*/
public function read( $token_id ) {
_deprecated_function( 'WC_Payment_Token::read', '2.7', 'Init a token class with an ID.' );
//wc_soft_deprecated_function( 'WC_Payment_Token::read', '2.7', '2.8', 'Init a token class with an ID.' );
$this->set_id( $token_id );
$data_store = WC_Data_Store::load( 'payment-token' );
$data_store->read( $this );
@ -29,9 +30,10 @@ abstract class WC_Legacy_Payment_Token extends WC_Data {
/**
* Update a token (deprecated).
* @deprecated 2.7.0 - Use ::save instead.
*/
public function update() {
_deprecated_function( 'WC_Payment_Token::update', '2.7', 'Use ::save instead.' );
//wc_soft_deprecated_function( 'WC_Payment_Token::update', '2.7', '2.8', 'Use ::save instead.' );
$data_store = WC_Data_Store::load( 'payment-token' );
try {
$data_store->update( $this );
@ -41,10 +43,11 @@ abstract class WC_Legacy_Payment_Token extends WC_Data {
}
/**
* Create a token (deprecated).
* Create a token.
* @deprecated 2.7.0 - Use ::save instead.
*/
public function create() {
_deprecated_function( 'WC_Payment_Token::create', '2.7', 'Use ::save instead.' );
//wc_soft_deprecated_function( 'WC_Payment_Token::create', '2.7', '2.8', 'Use ::save instead.' );
$data_store = WC_Data_Store::load( 'payment-token' );
try {
$data_store->create( $this );

View File

@ -53,7 +53,7 @@ if ( ! defined( 'ABSPATH' ) ) {
public function __construct( $token = '' ) {
// Set token type (cc, echeck)
if ( ! empty( $this->type ) ) {
$this->data['type'] = $this->type;
$this->set_type( $this->type );
}
if ( is_numeric( $token ) ) {
@ -169,7 +169,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* @param string Payment Token Type (CC, eCheck)
*/
public function set_type( $type ) {
return $this->get_prop( 'type', $type );
return $this->set_prop( 'type', $type );
}
/**

View File

@ -167,9 +167,6 @@ class WC_Tests_Payment_Token extends WC_Unit_Test_Case {
/**
* Test legacy token functions.
*
* @expectedDeprecated WC_Payment_Token::read
* @expectedDeprecated WC_Payment_Token::update
* @expectedDeprecated WC_Payment_Token::create
* @since 2.7.0
*/
public function test_wc_payment_token_legacy() {