Commit Graph

130 Commits

Author SHA1 Message Date
Nestor Soriano 281ec18158 Undo the registration of old singletons in the DI container.
The container will in principle be used only to register classes
in the `src` directory.

Also, CustomerProvider class removed.
2020-07-24 09:20:24 +02:00
Nestor Soriano 518c52b829 Move PSR4 autoloading from woocommerce.php to the Autoloader class 2020-07-24 09:20:24 +02:00
Nestor Soriano 312383ae47 First steps towards introducing a dependency injection framework.
- Add PHP League's Container package via Composer.
- Add an ObjectContainer class that encapsulates all the configuration
  and insulates the codebase from the concrete DI engine used.
- Add an improved ReflectionContainer class that will allow to
  register individual classes as singletons while autowiring.
- Use ObjectContainer to resolve the WooCommerce class, everything
  instantiated with "new" inside it, and all singletons that are
  usually obtained via WC() function.
- Introduce the CustomerProvider class.
- Introduce a service provider to resolve WC_Queue_Interface,
  this replaces the WC_Queue class.
- Mark as obsolete all the replaced "instance()" methods,
  and the entire WC_Queue class.
2020-07-24 09:20:21 +02:00
Vedanshu Jain a34835e489
Merge pull request #26932 from woocommerce/fix/25442
Show community forum link if wccom is not connected
2020-07-16 00:14:52 +05:30
vedanshujain aabf4bfe37 Add unit tests. 2020-07-15 15:27:34 +05:30
vedanshujain 4500e86198 Shorten class and method names to reduce redundancy in naming. 2020-07-15 15:20:18 +05:30
vedanshujain 1e68ce5dc9 Move function to src for better code architecture 2020-07-14 23:31:56 +05:30
Peter Fabian d54a2c3b2f Removed type hints.
Based on the design committee, we've decided not to use 'old' classes from the includes folder in new code in the 'src' directory. Thus removing those type hints, but leaving them in the docblock to not lose the information.
2020-07-06 15:36:33 +02:00
Claudio Sanches 2869867e35
Updated since tag 2020-06-24 13:08:08 -03:00
Frédéric Demarle 7c7e17dcd0 add filter woocommerce_query_for_reserved_stock
Remove previosuly proposed filter woocommerce_reserve_stock_for_products
2020-06-18 14:12:00 +02:00
Mike Jolley 00f1246553 Update reserved stock when a row already exists 2020-06-18 12:09:57 +01:00
vedanshujain d21cc596df Return early in release stock function if stock reservation is disabled. 2020-06-15 18:40:03 +05:30
vedanshujain 79e13edff0 This commit adds two changes for reserved stock functionality:
1. Use '0000-00-00 00:00:00' instead of CURRENT_TIMESTAMP as default value to support MySQL 5.6
2. Return early if DB version is less than 430 because then it would mean that required wc_reserved_stock table might not be present.
2020-06-05 19:20:06 +05:30
Vedanshu Jain b45373fe0c Revert "Revert "Introduce a `reserved stock` class and database table to prevent race conditions during checkout"" 2020-06-05 15:18:01 +05:30
Christopher Allford 1b2f5ab4ad Added handling to prevent namespace conflicts with included packages
The root namespace of Core is Automattic\WooCommerce, but both the blocks and wc-admin plugins exist in this namespace. In an effort to prevent possible conflicts, we should not allow for overlap in our repository. The rationale behind doing this as opposed to renaming our root namespace feels reasonable. In the case of Blocks, all of the tooling is already set up in their repository, so all blocks should go there anyway. In the case of WC-Admin, we shouldn't be refactoring admin classes, as that would duplicate work done to revamp them entirely.
2020-04-28 14:04:00 -07:00
Vedanshu Jain ee119e0a7e
Revert "Introduce a `reserved stock` class and database table to prevent race conditions during checkout" 2020-04-21 15:37:21 +05:30
Frédéric Demarle 2a70859888 Remove extra @since 2020-04-12 18:03:54 +02:00
Frédéric Demarle 9da21bc841 Add filter for products to reserve stock 2020-04-12 17:50:55 +02:00
Christopher Allford 09df1205de Updated the minimum PHP version to 7.0 2020-04-06 17:07:33 -07:00
Mike Jolley 0cce3c5c45 Missing abspath check 2020-04-03 16:16:20 +01:00
Mike Jolley f248902454 Update versions 2020-04-03 15:56:43 +01:00
Mike Jolley 107879950e Remove get_query_for_stock as it's part of data-store 2020-04-03 15:55:15 +01:00
Mike Jolley c983677a6f Implement stock functions 2020-04-03 15:55:15 +01:00
Mike Jolley d2d0967ac0 Introduce class to handle stock reservation 2020-04-03 15:55:14 +01:00
Ron Rennick 22d5dce682 change the namespace of the WC Admin Package class 2020-02-24 22:56:32 -04:00
Paul Sealock 6c9e78850a wc-admin: Include package 2020-01-16 17:40:30 -07:00
Rodrigo Primo 179dd7003e Fix Generic.Arrays.DisallowShortArraySyntax violations
This commit fixes all violations of the
Generic.Arrays.DisallowShortArraySyntax sniff automatically using
phpcbf.
2019-12-20 14:18:04 -03:00
Mike Jolley 9a8e8dacff Add integration tests 2019-06-25 15:57:44 +01:00
Mike Jolley db6aa55eda Add readme file explaining use of src folder 2019-06-25 13:13:20 +01:00
Mike Jolley f8d6b26e2e Add dedicated Packages loader and Autoloader to init functionality 2019-06-25 13:13:04 +01:00