PHPCS passing for class-wc-payment-token-data-store-interface.php

This commit is contained in:
Gerhard Potgieter 2018-03-06 11:49:02 +02:00
parent 00193f5ee4
commit e933b8cfd0
1 changed files with 19 additions and 10 deletions

View File

@ -1,4 +1,11 @@
<?php <?php
/**
* Payment Token Data Store Interface
*
* @version 3.0.0
* @package WooCommerce/Interface
*/
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
exit; exit;
} }
@ -9,15 +16,14 @@ if ( ! defined( 'ABSPATH' ) ) {
* Functions that must be defined by payment token store classes. * Functions that must be defined by payment token store classes.
* *
* @version 3.0.0 * @version 3.0.0
* @category Interface
* @author WooThemes
*/ */
interface WC_Payment_Token_Data_Store_Interface { interface WC_Payment_Token_Data_Store_Interface {
/** /**
* Returns an array of objects (stdObject) matching specific token criteria. * Returns an array of objects (stdObject) matching specific token criteria.
* Accepts token_id, user_id, gateway_id, and type. * Accepts token_id, user_id, gateway_id, and type.
* Each object should contain the fields token_id, gateway_id, token, user_id, type, is_default. * Each object should contain the fields token_id, gateway_id, token, user_id, type, is_default.
* @param array $args *
* @param array $args Arguments.
* @return array * @return array
*/ */
public function get_tokens( $args ); public function get_tokens( $args );
@ -25,7 +31,8 @@ interface WC_Payment_Token_Data_Store_Interface {
/** /**
* Returns an stdObject of a token for a user's default token. * Returns an stdObject of a token for a user's default token.
* Should contain the fields token_id, gateway_id, token, user_id, type, is_default. * Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
* @param int $user_id *
* @param int $user_id User ID.
* @return object * @return object
*/ */
public function get_users_default_token( $user_id ); public function get_users_default_token( $user_id );
@ -33,14 +40,16 @@ interface WC_Payment_Token_Data_Store_Interface {
/** /**
* Returns an stdObject of a token. * Returns an stdObject of a token.
* Should contain the fields token_id, gateway_id, token, user_id, type, is_default. * Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
* @param int $token_id *
* @param int $token_id Token ID.
* @return object * @return object
*/ */
public function get_token_by_id( $token_id ); public function get_token_by_id( $token_id );
/** /**
* Returns metadata for a specific payment token. * Returns metadata for a specific payment token.
* @param int $token_id *
* @param int $token_id Token ID.
* @return array * @return array
*/ */
public function get_metadata( $token_id ); public function get_metadata( $token_id );
@ -48,8 +57,7 @@ interface WC_Payment_Token_Data_Store_Interface {
/** /**
* Get a token's type by ID. * Get a token's type by ID.
* *
* @since 3.0.0 * @param int $token_id Token ID.
* @param int $token_id
* @return string * @return string
*/ */
public function get_token_type_by_id( $token_id ); public function get_token_type_by_id( $token_id );
@ -58,8 +66,9 @@ interface WC_Payment_Token_Data_Store_Interface {
* Update's a tokens default status in the database. Used for quickly * Update's a tokens default status in the database. Used for quickly
* looping through tokens and setting their statuses instead of creating a bunch * looping through tokens and setting their statuses instead of creating a bunch
* of objects. * of objects.
* @param int $token_id *
* @param bool $status * @param int $token_id Token ID.
* @param bool $status If should update status.
* @return string * @return string
*/ */
public function set_default_status( $token_id, $status = true ); public function set_default_status( $token_id, $status = true );