Skip to content

Commit

Permalink
Generate stubs for WooCommerce 7.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Jun 13, 2023
1 parent 55edb87 commit 1e9180b
Show file tree
Hide file tree
Showing 3 changed files with 648 additions and 61 deletions.
2 changes: 1 addition & 1 deletion source/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ext-json": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"woocommerce/woocommerce": "7.7.2"
"woocommerce/woocommerce": "7.8.0"
},
"minimum-stability": "stable",
"extra": {
Expand Down
220 changes: 193 additions & 27 deletions woocommerce-packages-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -6994,6 +6994,14 @@ class AttributeFilter extends \Automattic\WooCommerce\Blocks\BlockTypes\Abstract
protected function enqueue_data(array $attributes = [])
{
}
/**
* Get the frontend script handle for this block type.
*
* @param string $key Data to get, or default to everything.
*/
protected function get_block_type_script($key = null)
{
}
}
/**
* CatalogSorting class.
Expand Down Expand Up @@ -8579,6 +8587,30 @@ class MiniCartTitleBlock extends \Automattic\WooCommerce\Blocks\BlockTypes\Abstr
*/
protected $block_name = 'mini-cart-title-block';
}
/**
* MiniCartTitleItemsCounterBlock class.
*/
class MiniCartTitleItemsCounterBlock extends \Automattic\WooCommerce\Blocks\BlockTypes\AbstractInnerBlock
{
/**
* Block name.
*
* @var string
*/
protected $block_name = 'mini-cart-title-items-counter-block';
}
/**
* MiniCartTitleLabelBlock class.
*/
class MiniCartTitleLabelBlock extends \Automattic\WooCommerce\Blocks\BlockTypes\AbstractInnerBlock
{
/**
* Block name.
*
* @var string
*/
protected $block_name = 'mini-cart-title-label-block';
}
/**
* PriceFilter class.
*/
Expand Down Expand Up @@ -8992,9 +9024,10 @@ private function render_anchor($product, $on_sale_badge, $product_image, $attrib
* Render Image.
*
* @param \WC_Product $product Product object.
* @param array $attributes Parsed attributes.
* @return string
*/
private function render_image($product)
private function render_image($product, $attributes)
{
}
/**
Expand Down Expand Up @@ -9308,6 +9341,17 @@ private function get_on_sale_products_query()
private function get_custom_orderby_query($orderby)
{
}
/**
* Apply the query only to a subset of products
*
* @param array $query The query.
* @param array $ids Array of selected product ids.
*
* @return array
*/
private function filter_query_to_only_include_ids($query, $ids)
{
}
/**
* Return the `tax_query` for the requested attributes
*
Expand Down Expand Up @@ -9553,6 +9597,15 @@ class ProductRating extends \Automattic\WooCommerce\Blocks\BlockTypes\AbstractBl
protected function get_block_type_supports()
{
}
/**
* Get the block's attributes.
*
* @param array $attributes Block attributes. Default empty array.
* @return array Block attributes merged with defaults.
*/
private function parse_attributes($attributes)
{
}
/**
* Overwrite parent method to prevent script registration.
*
Expand All @@ -9568,17 +9621,6 @@ protected function register_block_type_assets()
protected function get_block_type_uses_context()
{
}
/**
* Filter the output from wc_get_rating_html.
*
* @param string $html Star rating markup. Default empty string.
* @param float $rating Rating being shown.
* @param int $count Total number of ratings.
* @return string
*/
public function filter_rating_html($html, $rating, $count)
{
}
/**
* Include and render the block.
*
Expand Down Expand Up @@ -9808,15 +9850,6 @@ class ProductStockIndicator extends \Automattic\WooCommerce\Blocks\BlockTypes\Ab
* @var string
*/
protected $api_version = '2';
/**
* Get block supports. Shared with the frontend.
* IMPORTANT: If you change anything here, make sure to update the JS file too.
*
* @return array
*/
protected function get_block_type_supports()
{
}
/**
* Register script and style assets for the block type before it is registered.
*
Expand Down Expand Up @@ -10027,6 +10060,14 @@ class RatingFilter extends \Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlo
*/
protected $block_name = 'rating-filter';
const RATING_QUERY_VAR = 'rating_filter';
/**
* Get the frontend script handle for this block type.
*
* @param string $key Data to get, or default to everything.
*/
protected function get_block_type_script($key = null)
{
}
}
/**
* RelatedProducts class.
Expand Down Expand Up @@ -10104,9 +10145,10 @@ private function is_related_products_block($block)
* Get related products ids.
* The logic is copied from the core function woocommerce_related_products. https://github.com/woocommerce/woocommerce/blob/ca49caabcba84ce9f60a03c6d3534ec14b350b80/plugins/woocommerce/includes/wc-template-functions.php/#L2039-L2074
*
* @param number $product_per_page Products per page.
* @return array Products ids.
*/
private function get_related_products_ids()
private function get_related_products_ids($product_per_page = 5)
{
}
}
Expand Down Expand Up @@ -10297,6 +10339,14 @@ protected function enqueue_data(array $stock_statuses = [])
public static function get_stock_status_query_var_values()
{
}
/**
* Get the frontend script handle for this block type.
*
* @param string $key Data to get, or default to everything.
*/
protected function get_block_type_script($key = null)
{
}
}
/**
* StoreNotices class.
Expand Down Expand Up @@ -12338,6 +12388,12 @@ class ShippingController
* @var AssetDataRegistry
*/
protected $asset_data_registry;
/**
* Whether local pickup is enabled.
*
* @var bool
*/
private $local_pickup_enabled;
/**
* Constructor.
*
Expand Down Expand Up @@ -14479,6 +14535,16 @@ private function process_payment(\WP_REST_Request $request, \Automattic\WooComme
private function get_request_payment_method_id(\WP_REST_Request $request)
{
}
/**
* Gets the chosen payment method title from the request.
*
* @throws RouteException On error.
* @param \WP_REST_Request $request Request object.
* @return string
*/
private function get_request_payment_method_title(\WP_REST_Request $request)
{
}
/**
* Gets the chosen payment method from the request.
*
Expand Down Expand Up @@ -15018,6 +15084,66 @@ protected function get_route_response(\WP_REST_Request $request)
{
}
}
/**
* ProductsBySlug class.
*/
class ProductsBySlug extends \Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute
{
/**
* The route identifier.
*
* @var string
*/
const IDENTIFIER = 'products-by-slug';
/**
* The routes schema.
*
* @var string
*/
const SCHEMA_TYPE = 'product';
/**
* Get the path of this REST route.
*
* @return string
*/
public function get_path()
{
}
/**
* Get method arguments for this REST route.
*
* @return array An array of endpoints.
*/
public function get_args()
{
}
/**
* Get a single item.
*
* @throws RouteException On error.
* @param \WP_REST_Request $request Request object.
* @return \WP_REST_Response
*/
protected function get_route_response(\WP_REST_Request $request)
{
}
/**
* Get a product by slug.
*
* @param string $slug The slug of the product.
*/
public function get_product_by_slug($slug)
{
}
/**
* Get a product variation by slug.
*
* @param string $slug The slug of the product variation.
*/
private function get_product_variation_by_slug($slug)
{
}
}
}
namespace Automattic\WooCommerce\StoreApi {
/**
Expand Down Expand Up @@ -17209,6 +17335,14 @@ private static function from_base_64_url(string $string)
*/
class LocalPickupUtils
{
/**
* Checks if WC Blocks local pickup is enabled.
*
* @return bool True if local pickup is enabled.
*/
public static function is_local_pickup_enabled()
{
}
/**
* Gets a list of payment method ids that support the 'local-pickup' feature.
*
Expand Down Expand Up @@ -17607,13 +17741,34 @@ private function generate_stock_status_count_query($status, $product_query_sql,
{
}
/**
* Get attribute counts for the current products.
* Get terms list for a given taxonomy.
*
* @param \WP_REST_Request $request The request object.
* @param array $attributes Attributes to count, either names or ids.
* @return array termId=>count pairs.
* @param string $taxonomy Taxonomy name.
*
* @return array
*/
public function get_terms_list(string $taxonomy)
{
}
/**
* Get the empty terms list for a given taxonomy.
*
* @param string $taxonomy Taxonomy name.
*
* @return array
*/
public function get_empty_terms_list(string $taxonomy)
{
}
/**
* Get attribute and meta counts.
*
* @param WP_REST_Request $request Request data.
* @param string $filtered_attribute The attribute to count.
*
* @return array
*/
public function get_attribute_counts($request, $attributes = [])
public function get_attribute_counts($request, $filtered_attribute)
{
}
/**
Expand Down Expand Up @@ -18645,6 +18800,17 @@ public static function template_has_title($template)
public static function template_has_legacy_template_block($template)
{
}
/**
* Gets the templates saved in the database.
*
* @param array $slugs An array of slugs to retrieve templates for.
* @param string $template_type wp_template or wp_template_part.
*
* @return int[]|\WP_Post[] An array of found templates.
*/
public static function get_block_templates_from_db($slugs = array(), $template_type = 'wp_template')
{
}
}
/**
* BlocksWpQuery query.
Expand Down
Loading

0 comments on commit 1e9180b

Please sign in to comment.