Add @since tag.

This commit is contained in:
Akeda Bagus 2019-07-15 15:42:36 +07:00
parent 59a5c6d754
commit f51265e58d
No known key found for this signature in database
GPG Key ID: B21A9FC4B7761412
5 changed files with 61 additions and 0 deletions

View File

@ -1101,6 +1101,8 @@ class WC_Helper {
/**
* Checks whether current site has product subscription of a given ID.
*
* @since 3.7.0
*
* @param int $product_id The product id.
*
* @return bool Returns true if product subscription exists, false otherwise.

View File

@ -70,6 +70,8 @@ class WC_REST_Authentication {
/**
* Check if this is a request to WCCOM Site REST API.
*
* @since 3.7.0
*
* @return bool
*/
protected function is_request_to_wccom_site_rest_api() {
@ -86,6 +88,8 @@ class WC_REST_Authentication {
/**
* Verify WooCommerce.com request from a given body and signature request.
*
* @since 3.7.0
*
* @param string $body Request body.
* @param string $signature Request signature found in
* X-Woo-Signature header.

View File

@ -4,6 +4,7 @@
*
* @class WC_WCCOM_Site_Installer
* @package WooCommerce/WCCOM_Site
* @since 3.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -60,6 +61,8 @@ class WC_WCCOM_Site_Installer {
/**
* Get the product install state.
*
* @since 3.7.0
*
* @param string $key Key in state data. If empty key is passed array of
* state will be returned.
*
@ -77,6 +80,8 @@ class WC_WCCOM_Site_Installer {
/**
* Update the product install state.
*
* @since 3.7.0
*
* @param string $key Key in state data.
* @param mixed $value Value.
*/
@ -90,6 +95,8 @@ class WC_WCCOM_Site_Installer {
/**
* Reset product install state.
*
* @since 3.7.0
*
* @param array $products List of product IDs.
*/
public static function reset_state( $products = array() ) {
@ -100,6 +107,8 @@ class WC_WCCOM_Site_Installer {
/**
* Schedule installing given list of products.
*
* @since 3.7.0
*
* @param array $products Array of products where key is product ID and
* element is install args.
*
@ -133,6 +142,8 @@ class WC_WCCOM_Site_Installer {
*
* Run via `woocommerce_wccom_install_products` hook.
*
* @since 3.7.0
*
* @param array $products Array of products where key is product ID and
* element is install args.
*/
@ -156,6 +167,8 @@ class WC_WCCOM_Site_Installer {
/**
* Finish installation by updating the state.
*
* @since 3.7.0
*/
private static function finish_installation() {
$state = self::get_state();
@ -180,6 +193,8 @@ class WC_WCCOM_Site_Installer {
/**
* Install a single product given its ID.
*
* @since 3.7.0
*
* @param int $product_id Product ID.
* @param array $install_args Install args.
* @param \WP_Upgrader $upgrader Core class to handle installation.
@ -193,6 +208,8 @@ class WC_WCCOM_Site_Installer {
/**
* Perform product installation step.
*
* @since 3.7.0
*
* @param int $product_id Product ID.
* @param array $install_args Install args.
* @param string $step Installation step.
@ -249,6 +266,8 @@ class WC_WCCOM_Site_Installer {
/**
* Get product info from its ID.
*
* @since 3.7.0
*
* @param int $product_id Product ID.
*
* @return bool|\WP_Error
@ -301,6 +320,8 @@ class WC_WCCOM_Site_Installer {
/**
* Download product by its ID and returns the path of the zip package.
*
* @since 3.7.0
*
* @param int $product_id Product ID.
* @param \WP_Upgrader $upgrader Core class to handle installation.
*
@ -317,6 +338,8 @@ class WC_WCCOM_Site_Installer {
/**
* Unpack downloaded product.
*
* @since 3.7.0
*
* @param int $product_id Product ID.
* @param \WP_Upgrader $upgrader Core class to handle installation.
*
@ -334,6 +357,8 @@ class WC_WCCOM_Site_Installer {
/**
* Move product to plugins directory.
*
* @since 3.7.0
*
* @param int $product_id Product ID.
* @param \WP_Upgrader $upgrader Core class to handle installation.
*
@ -365,6 +390,8 @@ class WC_WCCOM_Site_Installer {
/**
* Activate product given its product ID.
*
* @since 3.7.0
*
* @param int $product_id Product ID.
*
* @return \WP_Error|null
@ -384,6 +411,8 @@ class WC_WCCOM_Site_Installer {
/**
* Activate plugin given its product ID.
*
* @since 3.7.0
*
* @param int $product_id Product ID.
*
* @return \WP_Error|null
@ -422,6 +451,8 @@ class WC_WCCOM_Site_Installer {
/**
* Activate theme given its product ID.
*
* @since 3.7.0
*
* @param int $product_id Product ID.
*
* @return \WP_Error|null
@ -460,6 +491,8 @@ class WC_WCCOM_Site_Installer {
/**
* Get installed directory of WP.org product.
*
* @since 3.7.0
*
* @param int $product_id Product ID.
*
* @return bool|string
@ -484,6 +517,8 @@ class WC_WCCOM_Site_Installer {
/**
* Get WP.org plugin's main file.
*
* @since 3.7.0
*
* @param string $dir Directory name of the plugin.
*
* @return bool|string

View File

@ -4,6 +4,7 @@
*
* @class WC_WCCOM_Site_Installer
* @package WooCommerce/WCCOM_Site
* @since 3.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -18,6 +19,8 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_WCCOM_Site {
/**
* Load the WCCOM site class.
*
* @since 3.7.0
*/
public static function load() {
self::includes();
@ -28,6 +31,8 @@ class WC_WCCOM_Site {
/**
* Include support files.
*
* @since 3.7.0
*/
protected static function includes() {
require_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper.php';
@ -35,8 +40,11 @@ class WC_WCCOM_Site {
}
/**
*
* Register wccom-site REST namespace.
*
* @since 3.7.0
*
* @param array $namespaces List of registered namespaces.
*
* @return array Registered namespaces.

View File

@ -34,6 +34,8 @@ class WC_REST_WCCOM_Site_Installer_V1_Controller extends WC_REST_Controller {
/**
* Register the routes for product reviews.
*
* @since 3.7.0
*/
public function register_routes() {
register_rest_route(
@ -62,6 +64,8 @@ class WC_REST_WCCOM_Site_Installer_V1_Controller extends WC_REST_Controller {
/**
* Check permissions.
*
* @since 3.7.0
*
* @param WP_REST_Request $request Full details about the request.
*
* @return bool|WP_Error
@ -77,6 +81,8 @@ class WC_REST_WCCOM_Site_Installer_V1_Controller extends WC_REST_Controller {
/**
* Get installation state.
*
* @since 3.7.0
*
* @param WP_REST_Request $request Full details about the request.
*
* @return bool|WP_Error
@ -88,6 +94,8 @@ class WC_REST_WCCOM_Site_Installer_V1_Controller extends WC_REST_Controller {
/**
* Install WooCommerce.com products.
*
* @since 3.7.0
*
* @param WP_REST_Request $request Full details about the request.
*
* @return bool|WP_Error
@ -114,6 +122,8 @@ class WC_REST_WCCOM_Site_Installer_V1_Controller extends WC_REST_Controller {
/**
* Reset installation state.
*
* @since 3.7.0
*
* @param WP_REST_Request $request Full details about the request.
*
* @return bool|WP_Error
@ -128,6 +138,8 @@ class WC_REST_WCCOM_Site_Installer_V1_Controller extends WC_REST_Controller {
/**
* Validate products from request body.
*
* @since 3.7.0
*
* @param array $products Array of products where key is product ID and
* element is install args.
*