Remove "package" tag from files inside "src" and "tests/php" (https://github.com/woocommerce/woocommerce-blocks/pull/2972)

* Don't require package tag or file comment inside src

* Removed package from file headers

* Fixed coding standards

* fix doc blocks for REST API

* update root classes

* update phpdoc blocks for Assets and Block classes

* Domain classes

* update phpdocs for payment classes

* update phpdocs for registry classes

* update utils classes phpdocs

* missed saving one file

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
This commit is contained in:
Claudio Sanches 2020-09-07 15:01:07 -03:00 committed by GitHub
parent 69ba8161b6
commit 71c2b5ba21
120 changed files with 165 additions and 894 deletions

View File

@ -36,6 +36,15 @@
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment.MissingPackageTag">
<exclude-pattern>src/</exclude-pattern>
<exclude-pattern>tests/php</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>src/</exclude-pattern>
<exclude-pattern>tests/php</exclude-pattern>
</rule>
<rule ref="Generic.Commenting">
<exclude-pattern>tests/</exclude-pattern>
</rule>

View File

@ -1,19 +1,14 @@
<?php
/**
* Initializes block assets.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;
/**
* Assets class.
* Initializes block assets.
*
* @internal
*/
class Assets {

View File

@ -1,10 +1,4 @@
<?php
/**
* Contains asset api methods
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Assets;
use Automattic\WooCommerce\Blocks\Domain\Package;
@ -12,6 +6,8 @@ use Automattic\WooCommerce\Blocks\Domain\Package;
/**
* The Api class provides an interface to various asset registration helpers.
*
* Contains asset api methods
*
* @since 2.5.0
*/
class Api {

View File

@ -1,12 +1,4 @@
<?php
/**
* Holds data registered for output on the current view session when
* `wc-settings` is enqueued (directly or via dependency)
*
* @package WooCommerce/Blocks
* @since 2.5.0
*/
namespace Automattic\WooCommerce\Blocks\Assets;
use Exception;
@ -16,6 +8,9 @@ use InvalidArgumentException;
* Class instance for registering data used on the current view session by
* assets.
*
* Holds data registered for output on the current view session when
* `wc-settings` is enqueued( directly or via dependency )
*
* @since 2.5.0
*/
class AssetDataRegistry {

View File

@ -1,11 +1,4 @@
<?php
/**
* Backwards Compatibility file for plugins using wcSettings in prior versions
*
* @package WooCommerce/Blocks
* @since 2.5.0
*/
namespace Automattic\WooCommerce\Blocks\Assets;
/**
@ -13,6 +6,7 @@ namespace Automattic\WooCommerce\Blocks\Assets;
*
* Note: This will be removed at some point.
*
* @internal
* @since 2.5.0
*/
class BackCompatAssetDataRegistry extends AssetDataRegistry {

View File

@ -1,14 +1,6 @@
<?php
/**
* Abstract block class.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* AbstractBlock class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Abstract dynamic block class.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* AbstractDynamicBlock class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Class for product grid functionality
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Utils\BlocksWpQuery;
/**

View File

@ -1,14 +1,6 @@
<?php
/**
* Active filters block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Assets;
/**

View File

@ -1,14 +1,6 @@
<?php
/**
* All products block.
*
* @package WooCommerce\Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* AllProducts class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Reviews by Product block.
*
* @package WooCommerce\Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Assets;
/**

View File

@ -1,16 +1,10 @@
<?php
/**
* Atomic blocks.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* AtomicBlock class.
*
* @internal
*/
class AtomicBlock extends AbstractBlock {
/**

View File

@ -1,14 +1,6 @@
<?php
/**
* Attribute filter block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Assets;
/**

View File

@ -1,20 +1,14 @@
<?php
/**
* Cart block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
defined( 'ABSPATH' ) || exit;
/**
* Cart class.
*
* @internal
*/
class Cart extends AbstractBlock {
/**

View File

@ -1,20 +1,14 @@
<?php
/**
* Checkout block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
defined( 'ABSPATH' ) || exit;
/**
* Checkout class.
*
* @internal
*/
class Checkout extends AbstractBlock {

View File

@ -1,14 +1,6 @@
<?php
/**
* Featured category block.
*
* @package WooCommerce\Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* FeaturedCategory class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Featured products block.
*
* @package WooCommerce\Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* FeaturedProduct class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Hand-picked Products block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* HandpickedProducts class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Price filter block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Assets;
/**

View File

@ -1,14 +1,6 @@
<?php
/**
* Product best sellers block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* ProductBestSellers class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Product categories block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* ProductCategories class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Product category block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* ProductCategory class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* New products block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* ProductNew class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* On-sale products block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* ProductOnSale class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Product search block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* ProductSearch class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Product tag block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* ProductTag class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Top rated products block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* ProductTopRated class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Products by attribute block.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
/**
* ProductsByAttribute class.
*/

View File

@ -1,14 +1,6 @@
<?php
/**
* Reviews by Product block.
*
* @package WooCommerce\Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Assets;
/**

View File

@ -1,14 +1,6 @@
<?php
/**
* Reviews by Product block.
*
* @package WooCommerce\Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Assets;
/**

View File

@ -1,14 +1,6 @@
<?php
/**
* Single Product block.
*
* @package WooCommerce\Blocks
*/
namespace Automattic\WooCommerce\Blocks\BlockTypes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Assets;
/**

View File

@ -1,10 +1,4 @@
<?php
/**
* Contains the Bootstrap class
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Domain;
use Automattic\WooCommerce\Blocks\Assets as BlockAssets;

View File

@ -1,15 +1,11 @@
<?php
/**
* Returns information about the package and handles init.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Domain;
/**
* Main package class.
*
* Returns information about the package and handles init.
*
* @since 2.5.0
*/
class Package {

View File

@ -1,10 +1,4 @@
<?php
/**
* Sets up all logic related to the Checkout Draft Orders service
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Domain\Services;
use Automattic\WooCommerce\Blocks\Domain\Package;
@ -13,6 +7,10 @@ use WC_Order;
/**
* Service class for adding DraftOrder functionality to WooCommerce core.
*
* Sets up all logic related to the Checkout Draft Orders service
*
* @internal
*/
class DraftOrders {

View File

@ -1,16 +1,11 @@
<?php
/**
* Handles installation of Blocks plugin dependencies.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks;
defined( 'ABSPATH' ) || exit;
/**
* Installer class.
* Handles installation of Blocks plugin dependencies.
*
* @internal
*/
class Installer {
/**

View File

@ -1,18 +1,13 @@
<?php
/**
* Initializes blocks in WordPress.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Package;
/**
* Library class.
* Initializes blocks in WordPress.
*
* @internal
*/
class Library {

View File

@ -1,5 +1,13 @@
<?php
namespace Automattic\WooCommerce\Blocks;
use Automattic\WooCommerce\Blocks\Domain\Package as NewPackage;
use Automattic\WooCommerce\Blocks\Domain\Bootstrap;
use Automattic\WooCommerce\Blocks\Registry\Container;
/**
* Main package class.
*
* Returns information about the package and handles init.
*
* In the context of this plugin, it handles init and is called from the main
@ -8,20 +16,6 @@
* In the context of WooCommere core, it handles init and is called from
* WooCommerce's package loader. The main plugin file is _not_ loaded.
*
* @package Automattic/WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks;
use Automattic\WooCommerce\Blocks\Domain\Package as NewPackage;
use Automattic\WooCommerce\Blocks\Domain\Bootstrap;
use Automattic\WooCommerce\Blocks\Registry\Container;
defined( 'ABSPATH' ) || exit;
/**
* Main package class.
*
* @since 2.5.0
*/
class Package {

View File

@ -1,14 +1,6 @@
<?php
/**
* Payment Api class.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Payments;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\NoticeHandler;

View File

@ -1,14 +1,6 @@
<?php
/**
* Abstract payment method type class.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Payments\PaymentMethodTypeInterface;
/**

View File

@ -1,11 +1,4 @@
<?php
/**
* Bank Transfer (BACS) (core) gateway implementation.
*
* @package WooCommerce/Blocks
* @since 3.0.0
*/
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;
use Automattic\WooCommerce\Blocks\Assets\Api;

View File

@ -1,11 +1,4 @@
<?php
/**
* Cash on Delivery (COD) (core) gateway implementation.
*
* @package WooCommerce/Blocks
* @since 3.0.0
*/
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;
use Automattic\WooCommerce\Blocks\Assets\Api;

View File

@ -1,11 +1,4 @@
<?php
/**
* Cheque (core) gateway implementation.
*
* @package WooCommerce/Blocks
* @since 2.6.0
*/
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;
use Exception;

View File

@ -1,11 +1,4 @@
<?php
/**
* PayPal Standard (core) gateway implementation.
*
* @package WooCommerce/Blocks
* @since 2.6.0
*/
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;
use Exception;

View File

@ -1,13 +1,4 @@
<?php
/**
* Temporary integration of the stripe payment method for the new cart and
* checkout blocks. Once the api is demonstrated to be stable, this integration
* will be moved to the Stripe extension
*
* @package WooCommerce/Blocks
* @since 2.6.0
*/
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;
use Exception;
@ -20,6 +11,10 @@ use Automattic\WooCommerce\Blocks\Payments\PaymentResult;
/**
* Stripe payment method integration
*
* Temporary integration of the stripe payment method for the new cart and
* checkout blocks. Once the api is demonstrated to be stable, this integration
* will be moved to the Stripe extension
*
* @since 2.6.0
*/
final class Stripe extends AbstractPaymentMethodType {

View File

@ -1,14 +1,6 @@
<?php
/**
* Payment context.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Payments;
defined( 'ABSPATH' ) || exit;
/**
* PaymentContext class.
*/

View File

@ -1,10 +1,4 @@
<?php
/**
* Holds data about registered payment methods.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Payments;
/**

View File

@ -1,14 +1,6 @@
<?php
/**
* Payment method type interface.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Payments;
defined( 'ABSPATH' ) || exit;
interface PaymentMethodTypeInterface {
/**
* The name of the payment method

View File

@ -1,14 +1,6 @@
<?php
/**
* Payment result.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Payments;
defined( 'ABSPATH' ) || exit;
/**
* PaymentResult class.
*/

View File

@ -1,10 +1,4 @@
<?php
/**
* Holds the AbstractDependencyType class.
*
* @package WooCommerce\Blocks
*/
namespace Automattic\WooCommerce\Blocks\Registry;
/**

View File

@ -1,10 +1,4 @@
<?php
/**
* Contains the Container class.
*
* @package WooCommerce\Blocks
*/
namespace Automattic\WooCommerce\Blocks\Registry;
use Closure;
@ -30,7 +24,7 @@ class Container {
* Public api for adding a factory to the container.
*
* Factory dependencies will have the instantiation callback invoked
* everytime the dependency is requested.
* every time the dependency is requested.
*
* Typical Usage:
*
@ -58,7 +52,7 @@ class Container {
* that it will be a single instance shared among any other classes having
* that dependency.
*
* If you want a new instance everytime it's required, then wrap the value
* If you want a new instance every time it's required, then wrap the value
* in a call to the factory method (@see Container::factory for example)
*
* Note: Currently if the provided id already is registered in the container,

View File

@ -1,10 +1,4 @@
<?php
/**
* Holds the FactoryType class
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\Registry;
/**

View File

@ -1,10 +1,4 @@
<?php
/**
* Holds the SharedType class definition
*
* @package WooCommerce\Blocks
*/
namespace Automattic\WooCommerce\Blocks\Registry;
/**

View File

@ -1,19 +1,14 @@
<?php
/**
* Registers controllers in the blocks REST API namespace.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\RoutesController;
use Automattic\WooCommerce\Blocks\StoreApi\SchemaController;
/**
* RestApi class.
* Registers controllers in the blocks REST API namespace.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class RestApi {
/**

View File

@ -1,18 +1,12 @@
<?php
/**
* Abstract Cart route.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* Cart class.
* Abstract Cart Route
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
abstract class AbstractCartRoute extends AbstractRoute {
/**

View File

@ -1,19 +1,12 @@
<?php
/**
* Abstract route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\AbstractSchema;
/**
* AbstractRoute class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
abstract class AbstractRoute implements RouteInterface {
/**

View File

@ -1,20 +1,13 @@
<?php
/**
* Abstract Terms route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\Pagination;
use WP_Term_Query;
/**
* AbstractTermsRoute class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
abstract class AbstractTermsRoute extends AbstractRoute {
/**

View File

@ -1,18 +1,12 @@
<?php
/**
* Cart route.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* Cart class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class Cart extends AbstractCartRoute {
/**

View File

@ -1,18 +1,12 @@
<?php
/**
* Cart add item route.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartAddItem class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartAddItem extends AbstractCartRoute {
/**

View File

@ -1,18 +1,12 @@
<?php
/**
* Cart apply coupon route.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartApplyCoupon class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartApplyCoupon extends AbstractCartRoute {
/**

View File

@ -1,19 +1,12 @@
<?php
/**
* Cart Coupons route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartCoupons class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartCoupons extends AbstractRoute {
/**

View File

@ -1,19 +1,12 @@
<?php
/**
* Cart Coupons route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartCouponsByCode class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartCouponsByCode extends AbstractRoute {
/**

View File

@ -1,19 +1,12 @@
<?php
/**
* Cart items route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartItems class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartItems extends AbstractRoute {
/**

View File

@ -1,19 +1,12 @@
<?php
/**
* Cart item route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartItemsByKey class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartItemsByKey extends AbstractRoute {
/**

View File

@ -1,18 +1,12 @@
<?php
/**
* Cart remove coupon route.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartRemoveCoupon class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartRemoveCoupon extends AbstractCartRoute {
/**

View File

@ -1,18 +1,12 @@
<?php
/**
* Cart remove item route.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartRemoveItem class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartRemoveItem extends AbstractCartRoute {
/**

View File

@ -1,18 +1,12 @@
<?php
/**
* Cart select shipping rate route.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartSelectShippingRate class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartSelectShippingRate extends AbstractCartRoute {
/**

View File

@ -1,18 +1,12 @@
<?php
/**
* Cart update item route.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartUpdateItem class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartUpdateItem extends AbstractCartRoute {
/**

View File

@ -1,18 +1,12 @@
<?php
/**
* Cart update shipping route.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartUpdateShipping class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartUpdateShipping extends AbstractCartRoute {
/**

View File

@ -1,14 +1,6 @@
<?php
/**
* Checkout route.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\OrderController;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\ReserveStock;
@ -18,6 +10,8 @@ use Automattic\WooCommerce\Blocks\Payments\PaymentContext;
/**
* Checkout class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class Checkout extends AbstractRoute {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Product Attribute Terms route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
/**
* ProductAttributeTerms class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductAttributeTerms extends AbstractTermsRoute {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Product Attributes route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
/**
* ProductAttributes class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductAttributes extends AbstractRoute {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Product Attributes route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
/**
* ProductAttributesById class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductAttributesById extends AbstractRoute {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Product Categories route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
/**
* ProductCategories class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductCategories extends AbstractTermsRoute {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Product Category route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
/**
* ProductCategoriesById class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductCategoriesById extends AbstractRoute {
/**

View File

@ -1,21 +1,15 @@
<?php
/**
* Products collection data route. Get aggregate data from a collection of products.
*
* Supports the same parameters as /products, but returns a different response.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\ProductQueryFilters;
/**
* ProductCollectionData route.
* Get aggregate data from a collection of products.
*
* Supports the same parameters as /products, but returns a different response.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductCollectionData extends AbstractRoute {
/**

View File

@ -1,20 +1,13 @@
<?php
/**
* Product Reviews route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use WP_Comment_Query;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\Pagination;
/**
* ProductReviews class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductReviews extends AbstractRoute {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Product Tags route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
/**
* ProductTags class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductTags extends AbstractTermsRoute {
/**

View File

@ -1,20 +1,13 @@
<?php
/**
* Products route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\Pagination;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\ProductQuery;
/**
* Products class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class Products extends AbstractRoute {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Products route.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
/**
* ProductsById class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductsById extends AbstractRoute {
/**

View File

@ -1,14 +1,10 @@
<?php
/**
* Exceptions for rest routes.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
/**
* ReserveStockRouteExceptionException class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class RouteException extends \Exception {
/**

View File

@ -1,16 +1,10 @@
<?php
/**
* Route interface.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;
defined( 'ABSPATH' ) || exit;
/**
* RouteInterface.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
interface RouteInterface {
/**

View File

@ -1,19 +1,12 @@
<?php
/**
* Register Routes.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi;
defined( 'ABSPATH' ) || exit;
use Routes\AbstractRoute;
/**
* RoutesController class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class RoutesController {

View File

@ -1,20 +1,13 @@
<?php
/**
* Register Schemas.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi;
defined( 'ABSPATH' ) || exit;
use Exception;
use Schemas\AbstractSchema;
/**
* SchemaController class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class SchemaController {

View File

@ -1,19 +1,12 @@
<?php
/**
* Abstract Schema.
*
* Rest API schema class.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* AbstractBlock class.
* AbstractSchema class.
*
* For REST Route Schemas
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @since 2.5.0
*/
abstract class AbstractSchema {

View File

@ -1,20 +1,14 @@
<?php
/**
* Billing Address Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\RestApi\Routes;
/**
* BillingAddressSchema class.
*
* Provides a generic billing address schema for composition in other schemas.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class BillingAddressSchema extends AbstractSchema {
/**

View File

@ -1,19 +1,12 @@
<?php
/**
* Cart Coupon Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
/**
* CartCouponSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @since 2.5.0
*/
class CartCouponSchema extends AbstractSchema {

View File

@ -1,17 +1,10 @@
<?php
/**
* Cart Item Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* CartItemSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @since 2.5.0
*/
class CartItemSchema extends ProductSchema {

View File

@ -1,19 +1,12 @@
<?php
/**
* Cart schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
defined( 'ABSPATH' ) || exit;
/**
* CartSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @since 2.5.0
*/
class CartSchema extends AbstractSchema {

View File

@ -1,18 +1,12 @@
<?php
/**
* Cart shipping rate schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
use WC_Shipping_Rate as ShippingRate;
/**
* CartShippingRateSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CartShippingRateSchema extends AbstractSchema {
/**

View File

@ -1,18 +1,12 @@
<?php
/**
* Checkout schema for the Store API.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\Payments\PaymentResult;
/**
* CheckoutSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class CheckoutSchema extends AbstractSchema {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Error Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* ErrorSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @since 2.5.0
*/
class ErrorSchema extends AbstractSchema {

View File

@ -1,16 +1,10 @@
<?php
/**
* Image Attachment Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* ImageAttachmentSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ImageAttachmentSchema extends AbstractSchema {
/**

View File

@ -1,16 +1,10 @@
<?php
/**
* Order Coupon Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* OrderCouponSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class OrderCouponSchema extends AbstractSchema {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Product Attribute Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* ProductAttributeSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @since 2.5.0
*/
class ProductAttributeSchema extends AbstractSchema {

View File

@ -1,16 +1,10 @@
<?php
/**
* Product Category Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* ProductCategorySchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductCategorySchema extends TermSchema {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Product Collection Data Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* ProductCollectionDataSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @since 2.5.0
*/
class ProductCollectionDataSchema extends AbstractSchema {

View File

@ -1,16 +1,10 @@
<?php
/**
* Product Review Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* ProductReviewSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
*/
class ProductReviewSchema extends AbstractSchema {
/**

View File

@ -1,17 +1,10 @@
<?php
/**
* Product Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* ProductSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @since 2.5.0
*/
class ProductSchema extends AbstractSchema {

View File

@ -1,14 +1,6 @@
<?php
/**
* Shipping Address Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Blocks\RestApi\Routes;
/**
@ -16,6 +8,7 @@ use Automattic\WooCommerce\Blocks\RestApi\Routes;
*
* Provides a generic shipping address schema for composition in other schemas.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @since 2.5.0
*/
class ShippingAddressSchema extends AbstractSchema {

View File

@ -1,17 +1,10 @@
<?php
/**
* Term Schema.
*
* @package WooCommerce/Blocks
*/
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;
defined( 'ABSPATH' ) || exit;
/**
* TermSchema class.
*
* @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
* @since 2.5.0
*/
class TermSchema extends AbstractSchema {

Some files were not shown because too many files have changed in this diff Show More