Merge branch 'master' into add/2021-compat-shop-page

This commit is contained in:
Nestor Soriano 2020-12-02 11:57:38 +01:00
commit 7a34fbcbde
71 changed files with 3669 additions and 983 deletions

3
.gitignore vendored
View File

@ -59,7 +59,8 @@ tests/cli/vendor
# Composer
/vendor/
/bin/composer/**/vendor
/bin/composer/**/vendor/
/lib/vendor/
contributors.md
contributors.html

View File

@ -88,3 +88,13 @@ branches:
- master
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
- /^release\//
# Composer 2.0.7 introduced a change that broke the jetpack autoloader in PHP 7.0 - 7.3.
before_install:
- composer self-update 2.0.6
# Git clone depth
# By default Travis CI clones repositories to a depth of 50 commits. Using a depth of 1 makes this step a bit faster.
git:
depth: 1

View File

@ -1 +0,0 @@
FROM wordpress:5.4.2

View File

@ -173,12 +173,10 @@ a.button {
align-items: center;
justify-content: center;
&::after {
&::before {
content: '';
display: block;
height: 0;
width: 100%;
padding-bottom: 100%;
float: left;
padding-top: 100%;
}
}
@ -200,9 +198,9 @@ a.button {
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
margin-bottom: 5rem;
margin-bottom: 2rem;
margin-left: 0;
background: #eee;
background: var(--global--color-background);
font-size: 0.88889em;
font-family: $headings;
list-style: none;
@ -222,11 +220,6 @@ a.button {
}
}
.woocommerce-message {
background: #eee;
color: $body-color;
}
.woocommerce-error {
color: #fff;
background: #b22222;
@ -249,13 +242,13 @@ a.button {
}
#main {
.woocommerce-error,
.woocommerce-info {
font-family: $headings;
}
}
.woocommerce-message,
.woocommerce-info {
background: #eee;
color: #000;
@ -345,6 +338,8 @@ a.button {
td,
th {
word-break: normal;
border-left: none;
border-right: none;
}
}
}
@ -523,8 +518,9 @@ dl.variation,
}
.single_add_to_cart_button {
padding-top: 1.55rem;
padding-bottom: 1.59rem;
line-height: var(--global--line-height-body) !important;
padding-top: var(--form--spacing-unit) !important;
padding-bottom: var(--form--spacing-unit) !important;
font-size: 1.6rem;
}
@ -544,8 +540,16 @@ dl.variation,
margin-bottom: 8rem;
p.price {
margin-bottom: 3.5rem;
margin-bottom: 2rem;
}
.woocommerce-product-details__short-description {
margin-bottom: 1rem;
}
}
.woocommerce-variation-price {
margin: 2rem 0;
}
.woocommerce-product-rating {
@ -619,6 +623,7 @@ dl.variation,
}
table.variations {
margin: 1rem 0;
label {
margin: 0;
@ -777,21 +782,23 @@ a.reset_variations {
margin: 0 0 1.5rem;
padding: 0;
font-family: $headings;
border-bottom: var(--button--border-width) solid var(--button--color-background);
li {
margin: 0.5rem 4rem 2rem 0;
display: inline-flex !important;
a {
color: $body-color;
text-decoration: none;
font-weight: 700;
padding: var(--button--padding-vertical) var(--button--padding-horizontal);
}
&.active {
a {
color: $highlights-color;
box-shadow: 0 2px 0 $highlights-color;
color: var(--button--color-text);
background-color: var(--button--color-background);
border: var(--button--border-width) solid var(--button--color-background);
}
}
}
@ -939,6 +946,10 @@ a.reset_variations {
.related.products,
.up-sells {
h2 {
margin-bottom: 2rem;
}
clear: both;
ul.products {
@ -1280,208 +1291,6 @@ a.reset_variations {
}
}
/**
* Cart
*/
.woocommerce-cart-form {
img {
max-width: 120px;
height: auto;
display: block;
}
dl.variation {
margin-top: 1rem;
dt,
dd,
p {
font-family: $headings;
font-size: 1.4rem;
}
p,
&:last-child {
margin-bottom: 0;
}
}
.product-remove {
text-align: center;
}
.actions {
.input-text {
width: 280px !important;
float: left;
margin-right: 0.25rem;
border: 1px solid #ddd;
padding-top: 1.7rem;
padding-bottom: 1.9rem;
}
.button {
background: #f9f9f9;
border: 1px solid #555;
color: #555;
}
button[name="update_cart"] {
background: #fff;
color: #000;
}
}
.quantity {
input {
width: 8rem;
border: 1px solid #eee;
}
}
table {
border: 0;
th,
tbody,
td {
border: 0;
}
td.product-thumbnail {
padding: 1.4rem;
width: 10%;
img {
height: auto !important;
}
}
td.product-name {
padding-left: 1.5vw;
}
tbody {
tr {
border-top: 1px solid #eee;
}
}
input.qty {
display: inline-block;
}
}
.actions {
button {
padding-top: 1.55rem;
padding-bottom: 1.59rem;
font-size: 1.6rem;
}
}
}
.cart_totals {
th,
td {
vertical-align: top;
}
th {
padding-right: 1rem;
}
.woocommerce-shipping-destination {
margin-bottom: 1.5rem;
font-family: $headings;
}
table {
border: 0;
tbody,
th,
tr,
td {
border: 0;
padding: 1rem;
}
th {
width: 33%;
}
}
.checkout-button {
width: 100%;
}
input[type="radio"].shipping_method {
display: none;
& + label {
&::before {
content: "";
display: inline-block;
width: 14px;
height: 14px;
border: 2px solid #fff;
box-shadow: 0 0 0 2px #6d6d6d;
background: #fff;
margin-left: 4px;
margin-right: 1.2rem;
border-radius: 100%;
transform: translateY(2px);
}
}
&:checked + label {
&::before {
background: #555;
}
}
}
}
.shipping-calculator-button {
margin-top: 0.5rem;
display: inline-block;
}
.shipping-calculator-form {
margin: 1rem 0 0 0;
}
#shipping_method {
list-style: none;
margin: 0;
padding: 0 0 1.5rem;
font-family: $headings;
li {
margin-bottom: 0.5rem;
margin-left: 0;
input {
float: left;
margin-top: 0.5rem;
margin-right: 0.6rem;
}
label {
line-height: 2.5rem;
}
}
}
.checkout-button {
display: block;
padding: 1rem 2rem;
@ -1513,30 +1322,25 @@ a.reset_variations {
.woocommerce {
max-width: var(--responsive--alignwide-width);
padding: 0 5vw;
margin: 0 auto;
}
}
.select2-container .select2-selection--single {
height: 48px;
.select2-container .select2-dropdown {
border: var(--form--border-width) solid var(--form--border-color);
border-radius: var(--form--border-radius);
border-top: none;
}
.select2-container .select2-selection--single .select2-selection__rendered {
line-height: 48px;
font-family: $headings;
font-size: 1.6rem;
color: #000;
padding-left: 1.8rem;
.select2-container .select2-selection {
border: var(--form--border-width) solid var(--form--border-color);
border-radius: var(--form--border-radius);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 46px;
}
.select2-container--focus .select2-selection {
border-color: #000;
.select2-container--focus .select2-selection,.select2-container--open .select2-selection {
outline-offset: 2px;
outline: 2px dotted var(--form--border-color);
}
.select2-results__option {
@ -1546,7 +1350,7 @@ a.reset_variations {
.select2-container {
.select2-search__field {
height: 4rem;
height: 3rem;
background: #eee;
}
}
@ -1562,6 +1366,35 @@ a.reset_variations {
/**
* Checkout
*/
.woocommerce-form-coupon-toggle .woocommerce-info {
display: block;
margin-bottom: 2rem;
padding: 1rem;
}
.woocommerce-form-coupon {
background: #eee;
padding: 1rem;
font-size: 0.88889em;
color: var(--form--color-text);
#coupon_code {
border: var(--form--border-width) solid var(--form--border-color);
}
button[name="apply_coupon"] {
padding: 0.5rem;
.is-dark-theme & {
border-color: var(--global--color-background);
&:hover,
&:active {
background: var(--global--color-background);
}
}
}
}
#ship-to-different-address {
font-size: 1em;
display: inline-block;
@ -1582,8 +1415,8 @@ a.reset_variations {
display: block;
height: 16px;
width: 30px;
border: 2px solid #bbb;
background: #bbb;
border: 2px solid var(--form--border-color);
background: var(--global--color-primary);
border-radius: 13rem;
box-sizing: content-box;
transition: all ease-in-out 0.3s;
@ -1597,7 +1430,7 @@ a.reset_variations {
display: block;
width: 14px;
height: 14px;
background: #fff;
background: var(--global--color-background);
position: absolute;
top: 3px;
right: 17px;
@ -1612,11 +1445,11 @@ a.reset_variations {
input[type="checkbox"]:checked + span::after {
right: 3px;
background: var(--global--color-primary);
}
input[type="checkbox"]:checked + span::before {
border-color: #000;
background: #000;
background: var(--global--color-background);
}
}
}
@ -1684,7 +1517,7 @@ a.reset_variations {
.woocommerce-billing-fields {
h3 {
margin-top: 4rem;
margin: 2rem 0;
}
}
@ -1711,10 +1544,6 @@ a.reset_variations {
width: 100%;
}
input {
border: 1px solid #ddd;
}
label {
font-family: $headings;
letter-spacing: normal;
@ -1726,7 +1555,7 @@ a.reset_variations {
}
#order_review_heading {
margin-top: 4rem;
margin-top: 2rem;
}
#order_review_heading,
@ -1737,7 +1566,7 @@ a.reset_variations {
clear: right;
.woocommerce-checkout-review-order-table {
margin-top: 2.85rem;
margin-top: 2rem;
border: 0;
th,
@ -1749,19 +1578,13 @@ a.reset_variations {
display: none;
}
tbody::after {
content: "";
display: block;
height: 2rem;
}
.woocommerce-Price-amount {
font-weight: bold;
}
.cart-subtotal,
.order-total {
border-top: 1px solid #ddd;
border-top: 2px solid var(--form--border-color);
}
}
}
@ -1818,18 +1641,6 @@ a.reset_variations {
}
}
input#coupon_code {
padding-top: 1.55rem;
padding-bottom: 1.59rem;
border: 1px solid #ddd;
}
button[name="apply_coupon"] {
padding-top: 1.55rem;
padding-bottom: 1.8rem;
font-size: 1.6rem;
}
.select2-choice,
.select2-choice:hover {
box-shadow: none !important;
@ -1845,18 +1656,26 @@ a.reset_variations {
.select2-container .select2-selection--single .select2-selection__rendered {
line-height: 48px;
font-family: $headings;
font-size: 1.6rem;
color: #000;
padding-left: 1.8rem;
}
.select2-container .select2-selection {
border: var(--form--border-width) solid var(--form--border-color);
border-radius: var(--form--border-radius);
}
.select2-container .select2-dropdown {
border: var(--form--border-width) solid var(--form--border-color);
border-radius: var(--form--border-radius);
border-top: none;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 46px;
}
.select2-container--focus .select2-selection {
border-color: #000;
.select2-container--focus .select2-selection,.select2-container--open .select2-selection {
outline-offset: 2px;
outline: 2px dotted var(--form--border-color);
}
.select2-results__option {
@ -1866,7 +1685,7 @@ a.reset_variations {
.select2-container {
.select2-search__field {
height: 4rem;
height: 3rem;
background: #eee;
}
}
@ -1874,6 +1693,10 @@ a.reset_variations {
.woocommerce-checkout-review-order-table {
ul li {
list-style-type: none;
}
input[type="radio"].shipping_method {
display: none;
@ -1884,9 +1707,8 @@ a.reset_variations {
display: inline-block;
width: 14px;
height: 14px;
border: 2px solid #fff;
box-shadow: 0 0 0 2px #6d6d6d;
background: #fff;
border: var(--form--border-width) solid var(--form--border-color);
background: var(--global--color-white);
margin-left: 4px;
margin-right: 1.2rem;
border-radius: 100%;
@ -1897,7 +1719,11 @@ a.reset_variations {
&:checked + label {
&::before {
background: #555;
background: var(--global--color-border);
}
.is-dark-theme &::before {
background: var(--global--color-background);
}
}
}
@ -2051,9 +1877,8 @@ a.reset_variations {
display: inline-block;
width: 14px;
height: 14px;
border: 2px solid #fff;
box-shadow: 0 0 0 2px #6d6d6d;
background: #fff;
border: var(--form--border-width) solid var(--form--border-color);
background: var(--global--color-white);
margin-left: 4px;
margin-right: 1.2rem;
border-radius: 100%;
@ -2064,7 +1889,11 @@ a.reset_variations {
&:checked + label {
&::before {
background: #555;
background: var(--global--color-border);
}
.is-dark-theme &::before {
background: var(--global--color-background);
}
}
}
@ -2076,7 +1905,6 @@ a.reset_variations {
p {
font-family: $headings;
font-size: 1.6rem;
}
}
}
@ -2125,13 +1953,52 @@ a.reset_variations {
align-items: stretch;
flex-direction: row;
flex-wrap: wrap;
box-sizing: border-box;
word-break: break-word;
min-width: 12vw;
&.columns-2 {
li.product {
width: calc(100% / 2 - 16px) !important;
}
}
&.columns-3 {
li.product {
width: calc(100% / 3 - 16px) !important;
}
}
&.columns-4 {
li.product {
width: calc(100% / 4 - 16px) !important;
}
}
&.columns-5 {
li.product {
width: calc(100% / 5 - 16px) !important;
}
}
&.columns-6 {
li.product {
width: calc(100% / 6 - 16px) !important;
}
}
li.product {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 5em;
margin: 0 8px 16px 8px;
box-sizing: border-box;
img.attachment-woocommerce_thumbnail,
img.woocommerce-placeholder {
@ -2142,12 +2009,18 @@ a.reset_variations {
li.product-category {
a {
text-align: center;
text-align: left;
text-decoration: none;
h2.woocommerce-loop-category__title {
margin-top: 0.4rem;
font-family: $headings;
font-size: 1.5rem;
.count {
background-color: transparent;
color: $body-color;
}
}
}
@ -2183,7 +2056,9 @@ a.reset_variations {
ul.products[class*=columns-] {
li.product {
width: auto;
width: auto !important;
margin-left: auto;
margin-right: auto;
}
}
}
@ -2194,19 +2069,25 @@ a.reset_variations {
.woocommerce,
.woocommerce-page {
.related.products {
ul.products[class*=columns-] {
li.product {
width: 50%;
padding: 0 2vw 3em 0 !important;
margin-bottom: 2em;
}
}
}
li.product:nth-of-type(2n+1) {
ul.products[class*=columns-] {
justify-content: center;
li.product {
width: 50%;
padding: 0 2vw 3em 0;
}
li.product:nth-of-type(2n) {
padding: 0 0 3em 2vw;
}
}
.onsale {
@ -2217,6 +2098,10 @@ a.reset_variations {
@media only screen and (max-width: 768px) {
.woocommerce section.content-area {
padding-top: 0;
}
#main {
.woocommerce {
@ -2367,7 +2252,7 @@ a.reset_variations {
}
#order_review_heading {
margin-top: 4rem;
margin-top: 2rem;
}
#order_review_heading,
@ -2456,6 +2341,18 @@ a.reset_variations {
}
}
/**
* Home page
*/
.home #main {
[class*="woocommerce columns-"] {
word-break: break-word;
max-width: var(--responsive--aligndefault-width);
margin-left: auto;
margin-right: auto;
}
}
/**
* Shop page
*/
@ -2655,3 +2552,146 @@ a.reset_variations {
border-bottom: 3px solid var(--global--color-border);
}
}
.woocommerce-account {
.entry-header {
padding-bottom: 20px !important;
}
.woocommerce-MyAccount-content {
p:first-of-type {
margin-bottom: 2rem;
}
}
.woocommerce-MyAccount-navigation-link {
margin-bottom: 20px !important;
a {
color: $body-color !important;
font-weight: normal !important;
font-size: 1.8rem;
&:hover {
color: $body-color !important;
text-decoration: underline solid $body-color 1px !important;
}
}
}
}
.alignwide .woocommerce {
& > * {
max-width: var(--responsive--alignwide-width);
display: block;
margin: var(--global--spacing-vertical) auto;
}
}
.woocommerce {
.woocommerce-notices-wrapper {
& > * {
background: var(--global--color-light-gray);
padding: 15px;
list-style: none;
}
}
.return-to-shop,
.wc-proceed-to-checkout {
a.button {
margin-top: var(--global--spacing-vertical);
float: left;
display: inline-block;
width: 100%;
}
}
.woocommerce-cart-form {
.shop_table_responsive {
margin-top: var(--global--spacing-vertical);
margin-bottom: var(--global--spacing-vertical);
th {
border: none;
}
#coupon_code {
min-width: 9rem;
}
}
button[name="update_cart"],button[name="apply_coupon"] {
padding: 0.5rem;
color: var(--global--color-primary);
background: var(--global--color-background);
border: var(--form--border-width) solid var(--global--color-primary);
&:hover,
&:active {
color: var(--global--color-background);
background: var(--global--color-primary);
}
}
}
.cart-collaterals {
h2 {
margin-bottom: var(--global--spacing-vertical);
}
#shipping_method {
list-style: none;
padding-left: 0;
}
.shipping-calculator-form {
p {
margin-bottom: 0.5rem;
}
.select2-container {
.select2-selection {
height: auto;
}
.select2-selection__rendered {
border: var(--form--border-width) solid var(--form--border-color);
border-radius: var(--form--border-radius);
color: var(--form--color-text);
height: var(--global--line-height-body);
padding: var(--form--spacing-unit);
}
.select2-selection__arrow {
height: 100%;
}
}
}
.cross-sells {
li {
list-style: none;
}
li > em,
a {
display: inline-block;
}
}
}
}

View File

@ -146,6 +146,11 @@ jQuery( function( $ ) {
}
if ( is_virtual ) {
$( '.show_if_virtual' ).show();
// If user enables virtual while on shipping tab, switch to general tab.
if ( $( '.shipping_options.shipping_tab' ).hasClass( 'active' ) ) {
$( '.general_options.general_tab > a' ).trigger( 'click' );
}
}
$( '.show_if_' + product_type ).show();

View File

@ -16,18 +16,6 @@ jQuery( function ( $ ) {
runTipTip();
// Allow Tabbing
$( '#titlediv' ).find( '#title' ).keyup( function( event ) {
var code = event.keyCode || event.which;
// Tab key
if ( code === '9' && $( '#woocommerce-coupon-description' ).length > 0 ) {
event.stopPropagation();
$( '#woocommerce-coupon-description' ).focus();
return false;
}
});
$( '.wc-metaboxes-wrapper' ).on( 'click', '.wc-metabox > h3', function() {
$( this ).parent( '.wc-metabox' ).toggleClass( 'closed' ).toggleClass( 'open' );
});

View File

@ -507,9 +507,8 @@ jQuery( function( $ ) {
$.ajax({
type: 'POST',
url: wc_checkout_params.checkout_url,
data: new FormData( this ),
contentType: false,
processData: false,
data: $form.serialize(),
dataType: 'json',
success: function( result ) {
// Detach the unload handler that prevents a reload / redirect
wc_checkout_form.detachUnloadEventsOnSubmit();

34
bin/build-lib.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh
# Output colorized strings
#
# Color codes:
# 0 - black
# 1 - red
# 2 - green
# 3 - yellow
# 4 - blue
# 5 - magenta
# 6 - cian
# 7 - white
output() {
echo "$(tput setaf "$1")$2$(tput sgr0)"
}
if [ -z "$(php -r "echo version_compare(PHP_VERSION,'7.2','>=');")" ]; then
output 1 "PHP 7.2 or newer is required to run Mozart, the current PHP version is $(php -r 'echo PHP_VERSION;')"
exit 1
fi
output 6 "Building lib package"
# Clean the output directories to remove any files not present anymore
rm -rf lib/packages lib/classes
mkdir lib/packages lib/classes
# Running update on the lib package will automatically run Mozart
composer update -d ./lib
output 6 "Updating autoload files"
composer dump-autoload

View File

@ -0,0 +1,10 @@
{
"require-dev": {
"coenjacobs/mozart": "dev-master"
},
"config": {
"platform": {
"php": "7.2"
}
}
}

700
bin/composer/mozart/composer.lock generated Normal file
View File

@ -0,0 +1,700 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "cbcce1648bdb890ae805e1afb7396e3c",
"packages": [],
"packages-dev": [
{
"name": "coenjacobs/mozart",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/coenjacobs/mozart.git",
"reference": "5d8041fdefc94ff57edcbe83ab468a9988c4fc11"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/coenjacobs/mozart/zipball/5d8041fdefc94ff57edcbe83ab468a9988c4fc11",
"reference": "5d8041fdefc94ff57edcbe83ab468a9988c4fc11",
"shasum": ""
},
"require": {
"league/flysystem": "^1.0",
"php": "^7.2",
"symfony/console": "^4|^5",
"symfony/finder": "^4|^5"
},
"require-dev": {
"mheap/phpunit-github-actions-printer": "^1.4",
"phpunit/phpunit": "^8.5",
"squizlabs/php_codesniffer": "^3.5"
},
"default-branch": true,
"bin": [
"bin/mozart"
],
"type": "library",
"autoload": {
"psr-4": {
"CoenJacobs\\Mozart\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Coen Jacobs",
"email": "coenjacobs@gmail.com"
}
],
"description": "Composes all dependencies as a package inside a WordPress plugin",
"support": {
"issues": "https://github.com/coenjacobs/mozart/issues",
"source": "https://github.com/coenjacobs/mozart/tree/master"
},
"funding": [
{
"url": "https://github.com/coenjacobs",
"type": "github"
}
],
"time": "2020-11-23T21:03:43+00:00"
},
{
"name": "league/flysystem",
"version": "1.0.70",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "585824702f534f8d3cf7fab7225e8466cc4b7493"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/585824702f534f8d3cf7fab7225e8466cc4b7493",
"reference": "585824702f534f8d3cf7fab7225e8466cc4b7493",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"php": ">=5.5.9"
},
"conflict": {
"league/flysystem-sftp": "<1.0.6"
},
"require-dev": {
"phpspec/phpspec": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"phpunit/phpunit": "^5.7.26"
},
"suggest": {
"ext-fileinfo": "Required for MimeType",
"ext-ftp": "Allows you to use FTP server storage",
"ext-openssl": "Allows you to use FTPS server storage",
"league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
"league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
"league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
"league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
"league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
"league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
"league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
"league/flysystem-webdav": "Allows you to use WebDAV storage",
"league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
"spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
"srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"League\\Flysystem\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frank de Jonge",
"email": "info@frenky.net"
}
],
"description": "Filesystem abstraction: Many filesystems, one API.",
"keywords": [
"Cloud Files",
"WebDAV",
"abstraction",
"aws",
"cloud",
"copy.com",
"dropbox",
"file systems",
"files",
"filesystem",
"filesystems",
"ftp",
"rackspace",
"remote",
"s3",
"sftp",
"storage"
],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/1.0.70"
},
"funding": [
{
"url": "https://offset.earth/frankdejonge",
"type": "other"
}
],
"time": "2020-07-26T07:20:36+00:00"
},
{
"name": "psr/container",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
"homepage": "https://github.com/php-fig/container",
"keywords": [
"PSR-11",
"container",
"container-interface",
"container-interop",
"psr"
],
"support": {
"issues": "https://github.com/php-fig/container/issues",
"source": "https://github.com/php-fig/container/tree/master"
},
"time": "2017-02-14T16:28:37+00:00"
},
{
"name": "symfony/console",
"version": "v4.4.16",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/20f73dd143a5815d475e0838ff867bce1eebd9d5",
"reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php73": "^1.8",
"symfony/polyfill-php80": "^1.15",
"symfony/service-contracts": "^1.1|^2"
},
"conflict": {
"symfony/dependency-injection": "<3.4",
"symfony/event-dispatcher": "<4.3|>=5",
"symfony/lock": "<4.4",
"symfony/process": "<3.3"
},
"provide": {
"psr/log-implementation": "1.0"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "^3.4|^4.0|^5.0",
"symfony/dependency-injection": "^3.4|^4.0|^5.0",
"symfony/event-dispatcher": "^4.3",
"symfony/lock": "^4.4|^5.0",
"symfony/process": "^3.4|^4.0|^5.0",
"symfony/var-dumper": "^4.3|^5.0"
},
"suggest": {
"psr/log": "For using the console logger",
"symfony/event-dispatcher": "",
"symfony/lock": "",
"symfony/process": ""
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Console\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/console/tree/v4.4.16"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-24T11:50:19+00:00"
},
{
"name": "symfony/finder",
"version": "v4.4.16",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "26f63b8d4e92f2eecd90f6791a563ebb001abe31"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/26f63b8d4e92f2eecd90f6791a563ebb001abe31",
"reference": "26f63b8d4e92f2eecd90f6791a563ebb001abe31",
"shasum": ""
},
"require": {
"php": ">=7.1.3"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Finder\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v4.4.16"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-24T11:50:19+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "symfony/polyfill-php73",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
"reference": "8ff431c517be11c78c48a39a66d37431e26a6bed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/8ff431c517be11c78c48a39a66d37431e26a6bed",
"reference": "8ff431c517be11c78c48a39a66d37431e26a6bed",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php73\\": ""
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php73/tree/v1.20.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de",
"reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ion Bazan",
"email": "ion.bazan@gmail.com"
},
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.20.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "symfony/service-contracts",
"version": "v1.1.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
"reference": "b776d18b303a39f56c63747bcb977ad4b27aca26"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/b776d18b303a39f56c63747bcb977ad4b27aca26",
"reference": "b776d18b303a39f56c63747bcb977ad4b27aca26",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
"psr/container": "^1.0"
},
"suggest": {
"symfony/service-implementation": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\Service\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Generic abstractions related to writing services",
"homepage": "https://symfony.com",
"keywords": [
"abstractions",
"contracts",
"decoupling",
"interfaces",
"interoperability",
"standards"
],
"support": {
"source": "https://github.com/symfony/service-contracts/tree/v1.1.9"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-06T13:19:58+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"coenjacobs/mozart": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"platform-overrides": {
"php": "7.2"
},
"plugin-api-version": "2.0.0"
}

View File

@ -9,16 +9,16 @@
"packages-dev": [
{
"name": "gettext/gettext",
"version": "v4.8.2",
"version": "v4.8.3",
"source": {
"type": "git",
"url": "https://github.com/php-gettext/Gettext.git",
"reference": "e474f872f2c8636cf53fd283ec4ce1218f3d236a"
"reference": "57ff4fb16647e78e80a5909fe3c190f1c3110321"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-gettext/Gettext/zipball/e474f872f2c8636cf53fd283ec4ce1218f3d236a",
"reference": "e474f872f2c8636cf53fd283ec4ce1218f3d236a",
"url": "https://api.github.com/repos/php-gettext/Gettext/zipball/57ff4fb16647e78e80a5909fe3c190f1c3110321",
"reference": "57ff4fb16647e78e80a5909fe3c190f1c3110321",
"shasum": ""
},
"require": {
@ -70,9 +70,9 @@
"support": {
"email": "oom@oscarotero.com",
"issues": "https://github.com/oscarotero/Gettext/issues",
"source": "https://github.com/php-gettext/Gettext/tree/v4.8.2"
"source": "https://github.com/php-gettext/Gettext/tree/v4.8.3"
},
"time": "2019-12-02T10:21:14+00:00"
"time": "2020-11-18T22:35:49+00:00"
},
{
"name": "gettext/languages",

View File

@ -1,29 +0,0 @@
#!/bin/sh
# Output colorized strings
#
# Color codes:
# 0 - black
# 1 - red
# 2 - green
# 3 - yellow
# 4 - blue
# 5 - magenta
# 6 - cian
# 7 - white
output() {
echo "$(tput setaf "$1")$2$(tput sgr0)"
}
output 6 "Prefixing the appropriate vendor namespaces with Automattic\WooCommerce\Vendor"
# Replace "League\Container" in "use" and "namespace" with "Automattic\WooCommerce\Vendor\League\Container".
REGEX='s/^[[:space:]]*(use|namespace)[[:space:]]*(League\\Container)/\1 Automattic\\WooCommerce\\Vendor\\\2/g'
find ./vendor/league/container -iname '*.php' -exec sed -i'.bak' -E -e "$REGEX" {} \;
find ./vendor/league/container -name "*.php.bak" -type f -delete
# Replace too in the composer.json file for the package.
sed -i'.bak' -E -e "s/\"(League\\\\\\\Container)/\"Automattic\\\\\\\WooCommerce\\\\\\\Vendor\\\\\\\\\1/g" vendor/league/container/composer.json
rm -f vendor/league/container/composer.json.bak

View File

@ -1,5 +1,14 @@
== Changelog ==
= 4.7.1 - 2020-11-24 =
**WooCommerce**
* Fix - Prevent variable product to be added to cart until a valid variation is selected first. #28103
* Fix - Restored support for custom `taxonomy-product_cat-<SLUG>.php` and `taxonomy-product_tag-<SLUG>.php` templates. #28377
* Fix - Display overrides of `taxonomy-product_<cat|tag>.php` and `content-product_cat.php` templates in Status page. #28378
* Dev - Apply `woocommerce_cart_needs_payment` filter in `WC_Checkout::process_checkout()` to make backwards compatible. #28281
= 4.7.0 - 2020-11-10 =
**WooCommerce**

View File

@ -6,18 +6,23 @@
"license": "GPL-3.0-or-later",
"prefer-stable": true,
"minimum-stability": "dev",
"repositories": [
{
"type": "path",
"url": "lib"
}
],
"require": {
"php": ">=7.0",
"automattic/jetpack-autoloader": "2.2.0",
"automattic/jetpack-constants": "1.5.0",
"automattic/jetpack-autoloader": "2.6.0",
"automattic/jetpack-constants": "1.5.1",
"composer/installers": "~1.7",
"maxmind-db/reader": "1.6.0",
"pelago/emogrifier": "3.1.0",
"psr/container": "1.0.0",
"woocommerce/action-scheduler": "3.1.6",
"woocommerce/woocommerce-admin": "1.7.0",
"woocommerce/woocommerce-blocks": "3.8.0",
"league/container": "3.3.3"
"woocommerce/woocommerce-admin": "1.7.2",
"woocommerce/woocommerce-blocks": "3.8.1"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4"
@ -43,7 +48,10 @@
],
"psr-4": {
"Automattic\\WooCommerce\\": "src/",
"Automattic\\WooCommerce\\Vendor\\League\\Container\\": "vendor/league/container/"
"Automattic\\WooCommerce\\Vendor\\": "lib/packages/"
},
"psr-0": {
"Automattic\\WooCommerce\\Vendor\\": "lib/packages/"
}
},
"autoload-dev": {
@ -58,12 +66,10 @@
"scripts": {
"post-install-cmd": [
"@composer bin all install --ansi",
"sh ./bin/prefix-vendor-namespaces.sh",
"sh ./bin/package-update.sh"
],
"post-update-cmd": [
"@composer bin all update --ansi",
"sh ./bin/prefix-vendor-namespaces.sh",
"sh ./bin/package-update.sh"
],
"test": [
@ -86,6 +92,9 @@
],
"bin": [
"echo 'bin not installed'"
],
"build-lib": [
"sh ./bin/build-lib.sh"
]
},
"extra": {

172
composer.lock generated
View File

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "928d8825a02fc4217b3af36a83c2fbc8",
"content-hash": "486f7eb6eda8b5a537d5a6e72c4cbdad",
"packages": [
{
"name": "automattic/jetpack-autoloader",
"version": "v2.2.0",
"version": "v2.6.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-autoloader.git",
"reference": "66a5d150b3928be718d86696f85631a7f0b98a7b"
"reference": "47dde8dbca6b1e30f176725f2f748a9abefcaf58"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/66a5d150b3928be718d86696f85631a7f0b98a7b",
"reference": "66a5d150b3928be718d86696f85631a7f0b98a7b",
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/47dde8dbca6b1e30f176725f2f748a9abefcaf58",
"reference": "47dde8dbca6b1e30f176725f2f748a9abefcaf58",
"shasum": ""
},
"require": {
@ -31,6 +31,9 @@
"class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin"
},
"autoload": {
"classmap": [
"src/AutoloadGenerator.php"
],
"psr-4": {
"Automattic\\Jetpack\\Autoloader\\": "src"
}
@ -41,22 +44,22 @@
],
"description": "Creates a custom autoloader for a plugin or theme.",
"support": {
"source": "https://github.com/Automattic/jetpack-autoloader/tree/master"
"source": "https://github.com/Automattic/jetpack-autoloader/tree/v2.6.0"
},
"time": "2020-08-14T20:34:36+00:00"
"time": "2020-11-19T21:20:12+00:00"
},
{
"name": "automattic/jetpack-constants",
"version": "v1.5.0",
"version": "v1.5.1",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-constants.git",
"reference": "9827a2f446b8c4faafaf1c740483031c073a381d"
"reference": "18f772daddc8be5df76c9f4a92e017a3c2569a5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/9827a2f446b8c4faafaf1c740483031c073a381d",
"reference": "9827a2f446b8c4faafaf1c740483031c073a381d",
"url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/18f772daddc8be5df76c9f4a92e017a3c2569a5b",
"reference": "18f772daddc8be5df76c9f4a92e017a3c2569a5b",
"shasum": ""
},
"require-dev": {
@ -75,9 +78,9 @@
],
"description": "A wrapper for defining constants in a more testable way.",
"support": {
"source": "https://github.com/Automattic/jetpack-constants/tree/master"
"source": "https://github.com/Automattic/jetpack-constants/tree/v1.5.1"
},
"time": "2020-08-13T14:33:09+00:00"
"time": "2020-10-28T19:00:31+00:00"
},
{
"name": "composer/installers",
@ -220,82 +223,6 @@
],
"time": "2020-04-07T06:57:05+00:00"
},
{
"name": "league/container",
"version": "3.3.3",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/container.git",
"reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/container/zipball/7dc67bdf89efc338e674863c0ea70a63efe4de05",
"reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0",
"psr/container": "^1.0"
},
"provide": {
"psr/container-implementation": "^1.0"
},
"replace": {
"orno/di": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"squizlabs/php_codesniffer": "^3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-3.x": "3.x-dev",
"dev-2.x": "2.x-dev",
"dev-1.x": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Container\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Phil Bennett",
"email": "philipobenito@gmail.com",
"homepage": "http://www.philipobenito.com",
"role": "Developer"
}
],
"description": "A fast and intuitive dependency injection container.",
"homepage": "https://github.com/thephpleague/container",
"keywords": [
"container",
"dependency",
"di",
"injection",
"league",
"provider",
"service"
],
"support": {
"issues": "https://github.com/thephpleague/container/issues",
"source": "https://github.com/thephpleague/container/tree/3.3.3"
},
"funding": [
{
"url": "https://github.com/philipobenito",
"type": "github"
}
],
"time": "2020-09-28T13:38:44+00:00"
},
{
"name": "maxmind-db/reader",
"version": "v1.6.0",
@ -493,22 +420,27 @@
},
{
"name": "symfony/css-selector",
"version": "v3.4.46",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33"
"reference": "4d882dced7b995d5274293039370148e291808f2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/da3d9da2ce0026771f5fe64cb332158f1bd2bc33",
"reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/4d882dced7b995d5274293039370148e291808f2",
"reference": "4d882dced7b995d5274293039370148e291808f2",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8"
"php": ">=5.5.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\CssSelector\\": ""
@ -522,14 +454,14 @@
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Jean-François Simon",
"email": "jeanfrancois.simon@sensiolabs.com"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
@ -538,23 +470,9 @@
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/css-selector/tree/v3.4.46"
"source": "https://github.com/symfony/css-selector/tree/master"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-24T10:57:07+00:00"
"time": "2017-05-01T15:01:29+00:00"
},
{
"name": "woocommerce/action-scheduler",
@ -597,16 +515,16 @@
},
{
"name": "woocommerce/woocommerce-admin",
"version": "1.7.0",
"version": "1.7.2",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-admin.git",
"reference": "14dc0c78ce163ed0d5daf8f83765b65a76f61010"
"reference": "efd94d917504fe71bae650233de47344c8d5c005"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/14dc0c78ce163ed0d5daf8f83765b65a76f61010",
"reference": "14dc0c78ce163ed0d5daf8f83765b65a76f61010",
"url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/efd94d917504fe71bae650233de47344c8d5c005",
"reference": "efd94d917504fe71bae650233de47344c8d5c005",
"shasum": ""
},
"require": {
@ -640,22 +558,22 @@
"homepage": "https://github.com/woocommerce/woocommerce-admin",
"support": {
"issues": "https://github.com/woocommerce/woocommerce-admin/issues",
"source": "https://github.com/woocommerce/woocommerce-admin/tree/v1.7.0"
"source": "https://github.com/woocommerce/woocommerce-admin/tree/v1.7.2"
},
"time": "2020-11-11T22:56:39+00:00"
"time": "2020-11-19T17:48:33+00:00"
},
{
"name": "woocommerce/woocommerce-blocks",
"version": "v3.8.0",
"version": "v3.8.1",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git",
"reference": "8b7d485ec8d26a6d5c9011dbdb49443cad9beee7"
"reference": "e5aef9eddd13c5511ba673eb70ed8cb3e80d828c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/8b7d485ec8d26a6d5c9011dbdb49443cad9beee7",
"reference": "8b7d485ec8d26a6d5c9011dbdb49443cad9beee7",
"url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/e5aef9eddd13c5511ba673eb70ed8cb3e80d828c",
"reference": "e5aef9eddd13c5511ba673eb70ed8cb3e80d828c",
"shasum": ""
},
"require": {
@ -691,9 +609,9 @@
],
"support": {
"issues": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues",
"source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v3.8.0"
"source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v3.8.1"
},
"time": "2020-11-10T15:07:11+00:00"
"time": "2020-11-23T20:48:39+00:00"
}
],
"packages-dev": [
@ -758,7 +676,7 @@
},
"platform-dev": [],
"platform-overrides": {
"php": "7.1"
"php": "7.0"
},
"plugin-api-version": "2.0.0"
}

View File

@ -57,6 +57,10 @@ class WC_Helper_Updater {
'upgrade_notice' => $data['upgrade_notice'],
);
if ( isset( $data['requires_php'] ) ) {
$item['requires_php'] = $data['requires_php'];
}
// We don't want to deliver a valid upgrade package when their subscription has expired.
// To avoid the generic "no_package" error that empty strings give, we will store an
// indication of expiration for the `upgrader_pre_download` filter to error on.

View File

@ -194,7 +194,7 @@ class WC_Meta_Box_Coupon_Data {
foreach ( $product_ids as $product_id ) {
$product = wc_get_product( $product_id );
if ( is_object( $product ) ) {
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . htmlspecialchars( wp_kses_post( $product->get_formatted_name() ) ) . '</option>';
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>';
}
}
?>
@ -212,7 +212,7 @@ class WC_Meta_Box_Coupon_Data {
foreach ( $product_ids as $product_id ) {
$product = wc_get_product( $product_id );
if ( is_object( $product ) ) {
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . htmlspecialchars( wp_kses_post( $product->get_formatted_name() ) ) . '</option>';
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>';
}
}
?>

View File

@ -3,7 +3,7 @@ if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div data-taxonomy="<?php echo esc_attr( $attribute->get_taxonomy() ); ?>" class="woocommerce_attribute wc-metabox closed <?php echo esc_attr( implode( ' ', $metabox_class ) ); ?>" rel="<?php echo esc_attr( $attribute->get_position() ); ?>">
<div data-taxonomy="<?php echo esc_attr( $attribute->get_taxonomy() ); ?>" class="woocommerce_attribute wc-metabox postbox closed <?php echo esc_attr( implode( ' ', $metabox_class ) ); ?>" rel="<?php echo esc_attr( $attribute->get_position() ); ?>">
<h3>
<a href="#" class="remove_row delete"><?php esc_html_e( 'Remove', 'woocommerce' ); ?></a>
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'woocommerce' ); ?>"></div>

View File

@ -19,7 +19,7 @@ defined( 'ABSPATH' ) || exit;
foreach ( $product_ids as $product_id ) {
$product = wc_get_product( $product_id );
if ( is_object( $product ) ) {
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . htmlspecialchars( wp_kses_post( $product->get_formatted_name() ) ) . '</option>';
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>';
}
}
?>
@ -37,7 +37,7 @@ defined( 'ABSPATH' ) || exit;
foreach ( $product_ids as $product_id ) {
$product = wc_get_product( $product_id );
if ( is_object( $product ) ) {
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . htmlspecialchars( wp_kses_post( $product->get_formatted_name() ) ) . '</option>';
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>';
}
}
?>
@ -53,7 +53,7 @@ defined( 'ABSPATH' ) || exit;
foreach ( $product_ids as $product_id ) {
$product = wc_get_product( $product_id );
if ( is_object( $product ) ) {
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . htmlspecialchars( wp_kses_post( $product->get_formatted_name() ) ) . '</option>';
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>';
}
}
?>

View File

@ -251,7 +251,12 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
);
foreach ( $this->report_data->full_refunds as $key => $order ) {
$this->report_data->full_refunds[ $key ]->net_refund = $order->total_refund - ( $order->total_shipping + $order->total_tax + $order->total_shipping_tax );
$total_refund = is_numeric( $order->total_refund ) ? $order->total_refund : 0;
$total_shipping = is_numeric( $order->total_shipping ) ? $order->total_shipping : 0;
$total_tax = is_numeric( $order->total_tax ) ? $order->total_tax : 0;
$total_shipping_tax = is_numeric( $order->total_shipping_tax ) ? $order->total_shipping_tax : 0;
$this->report_data->full_refunds[ $key ]->net_refund = $total_refund - ( $total_shipping + $total_tax + $total_shipping_tax );
}
/**

View File

@ -1594,7 +1594,7 @@ class WC_AJAX {
$formatted_name .= ' &ndash; ' . sprintf( __( 'Stock: %d', 'woocommerce' ), wc_format_stock_quantity_for_display( $stock_amount, $product_object ) );
}
$products[ $product_object->get_id() ] = rawurldecode( $formatted_name );
$products[ $product_object->get_id() ] = rawurldecode( wp_strip_all_tags( $formatted_name ) );
}
wp_send_json( apply_filters( 'woocommerce_json_search_found_products', $products ) );

View File

@ -1158,7 +1158,16 @@ class WC_Checkout {
do_action( 'woocommerce_checkout_order_processed', $order_id, $posted_data, $order );
if ( $order->needs_payment() ) {
/**
* Note that woocommerce_cart_needs_payment is only used in
* WC_Checkout::process_checkout() to keep backwards compatibility.
* Use woocommerce_order_needs_payment instead.
*
* Note that at this point you can't rely on the Cart Object anymore,
* since it could be empty see:
* https://github.com/woocommerce/woocommerce/issues/24631
*/
if ( apply_filters( 'woocommerce_cart_needs_payment', $order->needs_payment(), WC()->cart ) ) {
$this->process_order_payment( $order_id, $posted_data['payment_method'] );
} else {
$this->process_order_without_payment( $order_id );

View File

@ -220,7 +220,7 @@ class WC_Shortcodes {
foreach ( $product_categories as $category ) {
wc_get_template(
'content-product-cat.php',
'content-product_cat.php',
array(
'category' => $category,
)

View File

@ -1191,8 +1191,10 @@ class WC_Tax {
public static function get_rates_for_tax_class( $tax_class ) {
global $wpdb;
$tax_class = self::format_tax_rate_class( $tax_class );
// Get all the rates and locations. Snagging all at once should significantly cut down on the number of queries.
$rates = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rates` WHERE `tax_rate_class` = %s;", sanitize_title( $tax_class ) ) );
$rates = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rates` WHERE `tax_rate_class` = %s;", $tax_class ) );
$locations = $wpdb->get_results( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rate_locations`" );
if ( ! empty( $rates ) ) {

View File

@ -155,6 +155,12 @@ class WC_Template_Loader {
if ( is_product_taxonomy() ) {
$object = get_queried_object();
$templates[] = 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php';
$templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php';
$templates[] = 'taxonomy-' . $object->taxonomy . '.php';
$templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '.php';
if ( is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) {
$cs_taxonomy = str_replace( '_', '-', $object->taxonomy );
$cs_default = str_replace( '_', '-', $default_file );
@ -163,11 +169,6 @@ class WC_Template_Loader {
$templates[] = 'taxonomy-' . $object->taxonomy . '.php';
$templates[] = WC()->template_path() . 'taxonomy-' . $cs_taxonomy . '.php';
$templates[] = $cs_default;
} else {
$templates[] = 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php';
$templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php';
$templates[] = 'taxonomy-' . $object->taxonomy . '.php';
$templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '.php';
}
}

View File

@ -22,7 +22,7 @@ final class WooCommerce {
*
* @var string
*/
public $version = '4.8.0';
public $version = '4.9.0';
/**
* WooCommerce Schema version.

View File

@ -1041,6 +1041,12 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
$override_files = array();
$outdated_templates = false;
$scan_files = WC_Admin_Status::scan_template_files( WC()->plugin_path() . '/templates/' );
// Include *-product_<cat|tag> templates for backwards compatibility.
$scan_files[] = 'content-product_cat.php';
$scan_files[] = 'taxonomy-product_cat.php';
$scan_files[] = 'taxonomy-product_tag.php';
foreach ( $scan_files as $file ) {
$located = apply_filters( 'wc_get_template', $file, $file, array(), WC()->template_path(), WC()->plugin_path() . '/templates/' );
@ -1059,7 +1065,14 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
}
if ( ! empty( $theme_file ) ) {
$core_version = WC_Admin_Status::get_file_version( WC()->plugin_path() . '/templates/' . $file );
$core_file = $file;
// Update *-product_<cat|tag> template name before searching in core.
if ( false !== strpos( $core_file, '-product_cat' ) || false !== strpos( $core_file, '-product_tag' ) ) {
$core_file = str_replace( '_', '-', $core_file );
}
$core_version = WC_Admin_Status::get_file_version( WC()->plugin_path() . '/templates/' . $core_file );
$theme_version = WC_Admin_Status::get_file_version( $theme_file );
if ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) {
if ( ! $outdated_templates ) {

View File

@ -638,7 +638,12 @@ function wc_let_to_num( $size ) {
* @return string
*/
function wc_date_format() {
return apply_filters( 'woocommerce_date_format', get_option( 'date_format' ) );
$date_format = get_option( 'date_format' );
if ( empty( $date_format ) ) {
// Return default date format if the option is empty.
$date_format = 'F j, Y';
}
return apply_filters( 'woocommerce_date_format', $date_format );
}
/**
@ -647,7 +652,12 @@ function wc_date_format() {
* @return string
*/
function wc_time_format() {
return apply_filters( 'woocommerce_time_format', get_option( 'time_format' ) );
$time_format = get_option( 'time_format' );
if ( empty( $time_format ) ) {
// Return default time format if the option is empty.
$time_format = 'g:i a';
}
return apply_filters( 'woocommerce_time_format', $time_format );
}
/**
@ -1190,7 +1200,7 @@ function wc_format_stock_for_display( $product ) {
switch ( get_option( 'woocommerce_stock_format' ) ) {
case 'low_amount':
if ( $stock_amount <= get_option( 'woocommerce_notify_low_stock_amount' ) ) {
if ( $stock_amount <= wc_get_low_stock_amount( $product ) ) {
/* translators: %s: stock amount */
$display = sprintf( __( 'Only %s left in stock', 'woocommerce' ), wc_format_stock_quantity_for_display( $stock_amount, $product ) );
}

View File

@ -2491,7 +2491,7 @@ if ( ! function_exists( 'woocommerce_output_product_categories' ) ) {
foreach ( $product_categories as $category ) {
wc_get_template(
'content-product-cat.php',
'content-product_cat.php',
array(
'category' => $category,
)

31
lib/README.md Normal file
View File

@ -0,0 +1,31 @@
## WooCommerce Lib Directory
This directory contains a dummy package responsible for managing WooCommerce dependencies that require conflict avoidance.
The contents of the `packages` and `classes` directories get automatically generated by `composer install` and `composer update`.
This allows us to prefix namespaces and classmap classes to avoid conflicts with plugins that include the same package.
All namespaces are prefixed with `Automattic\WooCommerce\Vendor` and classmap classes prefixed with `WC_Vendor_`.
**_Do not_ make direct changes in the files contained in `packages` or `classes`! Any changes will be lost!**
### Adding Packages
In order to avoid including the original dependencies in the root autoloader we must utilize `require-dev` for them.
Composer treats `require` dependencies as transitive while `require-dev` dependencies get ignored by consumers.
1. Add package to `require-dev` section of `composer.json`
2. Add package slug to `extra/mozart/packages` section of `composer.json`
3. Run `composer run-script build-lib` from the root directory (You should now see the package in `packages/VendorName/PackageName` or `classes`)
### Updating Packages
Updating a package is as easy as changing the version in `composer.json` and then running `composer run-script build-lib` from the root directory.
### Ignoring Packages
If you would like to add a package which does not undergo conflict avoidance you must take steps to ensure it appears in
the root autoloader.
1. Add package to the `require` section of both the `lib/composer.json` and root `composer.json` file instead of `require-dev`
2. Add package slug to `extra/mozart/excluded-packages` section of `composer.json`
3. Run `composer run-script build-lib` from the root directory (You **should not** see the package in `packages/VendorName/PackageName` or `classes`)

41
lib/composer.json Normal file
View File

@ -0,0 +1,41 @@
{
"name": "woocommerce/woocommerce-lib",
"description": "A package for hiding re-namespaced dependencies and executing them",
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"php": ">=7.0",
"psr/container": "^1.0"
},
"require-dev": {
"league/container": "3.3.3"
},
"config": {
"platform": {
"php": "7.0"
}
},
"scripts": {
"post-install-cmd": [
"\"../vendor/bin/mozart\" compose"
],
"post-update-cmd": [
"\"../vendor/bin/mozart\" compose"
]
},
"extra": {
"mozart": {
"dep_namespace": "Automattic\\WooCommerce\\Vendor\\",
"dep_directory": "/packages/",
"packages": [
"league/container"
],
"excluded_packages": [
"psr/container"
],
"classmap_directory": "/classes/",
"classmap_prefix": "WC_Vendor_",
"delete_vendor_directories": true
}
}
}

146
lib/composer.lock generated Normal file
View File

@ -0,0 +1,146 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "df548645b5c00d585705cd10c6ffd3f7",
"packages": [
{
"name": "psr/container",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
"homepage": "https://github.com/php-fig/container",
"keywords": [
"PSR-11",
"container",
"container-interface",
"container-interop",
"psr"
],
"time": "2017-02-14T16:28:37+00:00"
}
],
"packages-dev": [
{
"name": "league/container",
"version": "3.3.3",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/container.git",
"reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/container/zipball/7dc67bdf89efc338e674863c0ea70a63efe4de05",
"reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0",
"psr/container": "^1.0"
},
"provide": {
"psr/container-implementation": "^1.0"
},
"replace": {
"orno/di": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"squizlabs/php_codesniffer": "^3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-3.x": "3.x-dev",
"dev-2.x": "2.x-dev",
"dev-1.x": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Container\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Phil Bennett",
"email": "philipobenito@gmail.com",
"homepage": "http://www.philipobenito.com",
"role": "Developer"
}
],
"description": "A fast and intuitive dependency injection container.",
"homepage": "https://github.com/thephpleague/container",
"keywords": [
"container",
"dependency",
"di",
"injection",
"league",
"provider",
"service"
],
"funding": [
{
"url": "https://github.com/philipobenito",
"type": "github"
}
],
"time": "2020-09-28T13:38:44+00:00"
}
],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": [],
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": ">=7.0"
},
"platform-dev": [],
"platform-overrides": {
"php": "7.0"
},
"plugin-api-version": "1.1.0"
}

View File

@ -0,0 +1,28 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
use ReflectionFunctionAbstract;
interface ArgumentResolverInterface extends ContainerAwareInterface
{
/**
* Resolve an array of arguments to their concrete implementations.
*
* @param array $arguments
*
* @return array
*/
public function resolveArguments(array $arguments) : array;
/**
* Resolves the correct arguments to be passed to a method.
*
* @param ReflectionFunctionAbstract $method
* @param array $args
*
* @return array
*/
public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []) : array;
}

View File

@ -0,0 +1,120 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
use Automattic\WooCommerce\Vendor\League\Container\Container;
use Automattic\WooCommerce\Vendor\League\Container\Exception\{ContainerException, NotFoundException};
use Automattic\WooCommerce\Vendor\League\Container\ReflectionContainer;
use Psr\Container\ContainerInterface;
use ReflectionFunctionAbstract;
use ReflectionParameter;
trait ArgumentResolverTrait
{
/**
* {@inheritdoc}
*/
public function resolveArguments(array $arguments) : array
{
return array_map(function ($argument) {
$justStringValue = false;
if ($argument instanceof RawArgumentInterface) {
return $argument->getValue();
} elseif ($argument instanceof ClassNameInterface) {
$id = $argument->getClassName();
} elseif (!is_string($argument)) {
return $argument;
} else {
$justStringValue = true;
$id = $argument;
}
$container = null;
try {
$container = $this->getLeagueContainer();
} catch (ContainerException $e) {
if ($this instanceof ReflectionContainer) {
$container = $this;
}
}
if ($container !== null) {
try {
return $container->get($id);
} catch (NotFoundException $exception) {
if ($argument instanceof ClassNameWithOptionalValue) {
return $argument->getOptionalValue();
}
if ($justStringValue) {
return $id;
}
throw $exception;
}
}
if ($argument instanceof ClassNameWithOptionalValue) {
return $argument->getOptionalValue();
}
// Just a string value.
return $id;
}, $arguments);
}
/**
* {@inheritdoc}
*/
public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []) : array
{
$arguments = array_map(function (ReflectionParameter $param) use ($method, $args) {
$name = $param->getName();
$type = $param->getType();
if (array_key_exists($name, $args)) {
return new RawArgument($args[$name]);
}
if ($type) {
if (PHP_VERSION_ID >= 70200) {
$typeName = $type->getName();
} else {
$typeName = (string) $type;
}
$typeName = ltrim($typeName, '?');
if ($param->isDefaultValueAvailable()) {
return new ClassNameWithOptionalValue($typeName, $param->getDefaultValue());
}
return new ClassName($typeName);
}
if ($param->isDefaultValueAvailable()) {
return new RawArgument($param->getDefaultValue());
}
throw new NotFoundException(sprintf(
'Unable to resolve a value for parameter (%s) in the function/method (%s)',
$name,
$method->getName()
));
}, $method->getParameters());
return $this->resolveArguments($arguments);
}
/**
* @return ContainerInterface
*/
abstract public function getContainer() : ContainerInterface;
/**
* @return Container
*/
abstract public function getLeagueContainer() : Container;
}

View File

@ -0,0 +1,29 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
class ClassName implements ClassNameInterface
{
/**
* @var string
*/
protected $value;
/**
* Construct.
*
* @param string $value
*/
public function __construct(string $value)
{
$this->value = $value;
}
/**
* {@inheritdoc}
*/
public function getClassName() : string
{
return $this->value;
}
}

View File

@ -0,0 +1,13 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
interface ClassNameInterface
{
/**
* Return the class name.
*
* @return string
*/
public function getClassName() : string;
}

View File

@ -0,0 +1,39 @@
<?php
namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
class ClassNameWithOptionalValue implements ClassNameInterface
{
/**
* @var string
*/
private $className;
/**
* @var mixed
*/
private $optionalValue;
/**
* @param string $className
* @param mixed $optionalValue
*/
public function __construct(string $className, $optionalValue)
{
$this->className = $className;
$this->optionalValue = $optionalValue;
}
/**
* @inheritDoc
*/
public function getClassName(): string
{
return $this->className;
}
public function getOptionalValue()
{
return $this->optionalValue;
}
}

View File

@ -0,0 +1,29 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
class RawArgument implements RawArgumentInterface
{
/**
* @var mixed
*/
protected $value;
/**
* Construct.
*
* @param mixed $value
*/
public function __construct($value)
{
$this->value = $value;
}
/**
* {@inheritdoc}
*/
public function getValue()
{
return $this->value;
}
}

View File

@ -0,0 +1,13 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
interface RawArgumentInterface
{
/**
* Return the value of the raw argument.
*
* @return mixed
*/
public function getValue();
}

View File

@ -0,0 +1,248 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container;
use Automattic\WooCommerce\Vendor\League\Container\Definition\{DefinitionAggregate, DefinitionInterface, DefinitionAggregateInterface};
use Automattic\WooCommerce\Vendor\League\Container\Exception\{NotFoundException, ContainerException};
use Automattic\WooCommerce\Vendor\League\Container\Inflector\{InflectorAggregate, InflectorInterface, InflectorAggregateInterface};
use Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\{
ServiceProviderAggregate,
ServiceProviderAggregateInterface,
ServiceProviderInterface
};
use Psr\Container\ContainerInterface;
class Container implements ContainerInterface
{
/**
* @var boolean
*/
protected $defaultToShared = false;
/**
* @var DefinitionAggregateInterface
*/
protected $definitions;
/**
* @var ServiceProviderAggregateInterface
*/
protected $providers;
/**
* @var InflectorAggregateInterface
*/
protected $inflectors;
/**
* @var ContainerInterface[]
*/
protected $delegates = [];
/**
* Construct.
*
* @param DefinitionAggregateInterface|null $definitions
* @param ServiceProviderAggregateInterface|null $providers
* @param InflectorAggregateInterface|null $inflectors
*/
public function __construct(
DefinitionAggregateInterface $definitions = null,
ServiceProviderAggregateInterface $providers = null,
InflectorAggregateInterface $inflectors = null
) {
$this->definitions = $definitions ?? new DefinitionAggregate;
$this->providers = $providers ?? new ServiceProviderAggregate;
$this->inflectors = $inflectors ?? new InflectorAggregate;
if ($this->definitions instanceof ContainerAwareInterface) {
$this->definitions->setLeagueContainer($this);
}
if ($this->providers instanceof ContainerAwareInterface) {
$this->providers->setLeagueContainer($this);
}
if ($this->inflectors instanceof ContainerAwareInterface) {
$this->inflectors->setLeagueContainer($this);
}
}
/**
* Add an item to the container.
*
* @param string $id
* @param mixed $concrete
* @param boolean $shared
*
* @return DefinitionInterface
*/
public function add(string $id, $concrete = null, bool $shared = null) : DefinitionInterface
{
$concrete = $concrete ?? $id;
$shared = $shared ?? $this->defaultToShared;
return $this->definitions->add($id, $concrete, $shared);
}
/**
* Proxy to add with shared as true.
*
* @param string $id
* @param mixed $concrete
*
* @return DefinitionInterface
*/
public function share(string $id, $concrete = null) : DefinitionInterface
{
return $this->add($id, $concrete, true);
}
/**
* Whether the container should default to defining shared definitions.
*
* @param boolean $shared
*
* @return self
*/
public function defaultToShared(bool $shared = true) : ContainerInterface
{
$this->defaultToShared = $shared;
return $this;
}
/**
* Get a definition to extend.
*
* @param string $id [description]
*
* @return DefinitionInterface
*/
public function extend(string $id) : DefinitionInterface
{
if ($this->providers->provides($id)) {
$this->providers->register($id);
}
if ($this->definitions->has($id)) {
return $this->definitions->getDefinition($id);
}
throw new NotFoundException(
sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $id)
);
}
/**
* Add a service provider.
*
* @param ServiceProviderInterface|string $provider
*
* @return self
*/
public function addServiceProvider($provider) : self
{
$this->providers->add($provider);
return $this;
}
/**
* {@inheritdoc}
*/
public function get($id, bool $new = false)
{
if ($this->definitions->has($id)) {
$resolved = $this->definitions->resolve($id, $new);
return $this->inflectors->inflect($resolved);
}
if ($this->definitions->hasTag($id)) {
$arrayOf = $this->definitions->resolveTagged($id, $new);
array_walk($arrayOf, function (&$resolved) {
$resolved = $this->inflectors->inflect($resolved);
});
return $arrayOf;
}
if ($this->providers->provides($id)) {
$this->providers->register($id);
if (!$this->definitions->has($id) && !$this->definitions->hasTag($id)) {
throw new ContainerException(sprintf('Service provider lied about providing (%s) service', $id));
}
return $this->get($id, $new);
}
foreach ($this->delegates as $delegate) {
if ($delegate->has($id)) {
$resolved = $delegate->get($id);
return $this->inflectors->inflect($resolved);
}
}
throw new NotFoundException(sprintf('Alias (%s) is not being managed by the container or delegates', $id));
}
/**
* {@inheritdoc}
*/
public function has($id) : bool
{
if ($this->definitions->has($id)) {
return true;
}
if ($this->definitions->hasTag($id)) {
return true;
}
if ($this->providers->provides($id)) {
return true;
}
foreach ($this->delegates as $delegate) {
if ($delegate->has($id)) {
return true;
}
}
return false;
}
/**
* Allows for manipulation of specific types on resolution.
*
* @param string $type
* @param callable|null $callback
*
* @return InflectorInterface
*/
public function inflector(string $type, callable $callback = null) : InflectorInterface
{
return $this->inflectors->add($type, $callback);
}
/**
* Delegate a backup container to be checked for services if it
* cannot be resolved via this container.
*
* @param ContainerInterface $container
*
* @return self
*/
public function delegate(ContainerInterface $container) : self
{
$this->delegates[] = $container;
if ($container instanceof ContainerAwareInterface) {
$container->setLeagueContainer($this);
}
return $this;
}
}

View File

@ -0,0 +1,40 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container;
use Psr\Container\ContainerInterface;
interface ContainerAwareInterface
{
/**
* Set a container
*
* @param ContainerInterface $container
*
* @return self
*/
public function setContainer(ContainerInterface $container) : self;
/**
* Get the container
*
* @return ContainerInterface
*/
public function getContainer() : ContainerInterface;
/**
* Set a container. This will be removed in favour of setContainer receiving Container in next major release.
*
* @param Container $container
*
* @return self
*/
public function setLeagueContainer(Container $container) : self;
/**
* Get the container. This will be removed in favour of getContainer returning Container in next major release.
*
* @return Container
*/
public function getLeagueContainer() : Container;
}

View File

@ -0,0 +1,76 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container;
use Automattic\WooCommerce\Vendor\League\Container\Exception\ContainerException;
use Psr\Container\ContainerInterface;
trait ContainerAwareTrait
{
/**
* @var ContainerInterface
*/
protected $container;
/**
* @var Container
*/
protected $leagueContainer;
/**
* Set a container.
*
* @param ContainerInterface $container
*
* @return self
*/
public function setContainer(ContainerInterface $container) : ContainerAwareInterface
{
$this->container = $container;
return $this;
}
/**
* Get the container.
*
* @return ContainerInterface
*/
public function getContainer() : ContainerInterface
{
if ($this->container instanceof ContainerInterface) {
return $this->container;
}
throw new ContainerException('No container implementation has been set.');
}
/**
* Set a container.
*
* @param Container $container
*
* @return self
*/
public function setLeagueContainer(Container $container) : ContainerAwareInterface
{
$this->container = $container;
$this->leagueContainer = $container;
return $this;
}
/**
* Get the container.
*
* @return Container
*/
public function getLeagueContainer() : Container
{
if ($this->leagueContainer instanceof Container) {
return $this->leagueContainer;
}
throw new ContainerException('No container implementation has been set.');
}
}

View File

@ -0,0 +1,274 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Definition;
use Automattic\WooCommerce\Vendor\League\Container\Argument\{
ArgumentResolverInterface, ArgumentResolverTrait, ClassNameInterface, RawArgumentInterface
};
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareTrait;
use ReflectionClass;
use ReflectionException;
class Definition implements ArgumentResolverInterface, DefinitionInterface
{
use ArgumentResolverTrait;
use ContainerAwareTrait;
/**
* @var string
*/
protected $alias;
/**
* @var mixed
*/
protected $concrete;
/**
* @var boolean
*/
protected $shared = false;
/**
* @var array
*/
protected $tags = [];
/**
* @var array
*/
protected $arguments = [];
/**
* @var array
*/
protected $methods = [];
/**
* @var mixed
*/
protected $resolved;
/**
* Constructor.
*
* @param string $id
* @param mixed $concrete
*/
public function __construct(string $id, $concrete = null)
{
$concrete = $concrete ?? $id;
$this->alias = $id;
$this->concrete = $concrete;
}
/**
* {@inheritdoc}
*/
public function addTag(string $tag) : DefinitionInterface
{
$this->tags[$tag] = true;
return $this;
}
/**
* {@inheritdoc}
*/
public function hasTag(string $tag) : bool
{
return isset($this->tags[$tag]);
}
/**
* {@inheritdoc}
*/
public function setAlias(string $id) : DefinitionInterface
{
$this->alias = $id;
return $this;
}
/**
* {@inheritdoc}
*/
public function getAlias() : string
{
return $this->alias;
}
/**
* {@inheritdoc}
*/
public function setShared(bool $shared = true) : DefinitionInterface
{
$this->shared = $shared;
return $this;
}
/**
* {@inheritdoc}
*/
public function isShared() : bool
{
return $this->shared;
}
/**
* {@inheritdoc}
*/
public function getConcrete()
{
return $this->concrete;
}
/**
* {@inheritdoc}
*/
public function setConcrete($concrete) : DefinitionInterface
{
$this->concrete = $concrete;
$this->resolved = null;
return $this;
}
/**
* {@inheritdoc}
*/
public function addArgument($arg) : DefinitionInterface
{
$this->arguments[] = $arg;
return $this;
}
/**
* {@inheritdoc}
*/
public function addArguments(array $args) : DefinitionInterface
{
foreach ($args as $arg) {
$this->addArgument($arg);
}
return $this;
}
/**
* {@inheritdoc}
*/
public function addMethodCall(string $method, array $args = []) : DefinitionInterface
{
$this->methods[] = [
'method' => $method,
'arguments' => $args
];
return $this;
}
/**
* {@inheritdoc}
*/
public function addMethodCalls(array $methods = []) : DefinitionInterface
{
foreach ($methods as $method => $args) {
$this->addMethodCall($method, $args);
}
return $this;
}
/**
* {@inheritdoc}
*/
public function resolve(bool $new = false)
{
$concrete = $this->concrete;
if ($this->isShared() && $this->resolved !== null && $new === false) {
return $this->resolved;
}
if (is_callable($concrete)) {
$concrete = $this->resolveCallable($concrete);
}
if ($concrete instanceof RawArgumentInterface) {
$this->resolved = $concrete->getValue();
return $concrete->getValue();
}
if ($concrete instanceof ClassNameInterface) {
$concrete = $concrete->getClassName();
}
if (is_string($concrete) && class_exists($concrete)) {
$concrete = $this->resolveClass($concrete);
}
if (is_object($concrete)) {
$concrete = $this->invokeMethods($concrete);
}
$this->resolved = $concrete;
return $concrete;
}
/**
* Resolve a callable.
*
* @param callable $concrete
*
* @return mixed
*/
protected function resolveCallable(callable $concrete)
{
$resolved = $this->resolveArguments($this->arguments);
return call_user_func_array($concrete, $resolved);
}
/**
* Resolve a class.
*
* @param string $concrete
*
* @return object
*
* @throws ReflectionException
*/
protected function resolveClass(string $concrete)
{
$resolved = $this->resolveArguments($this->arguments);
$reflection = new ReflectionClass($concrete);
return $reflection->newInstanceArgs($resolved);
}
/**
* Invoke methods on resolved instance.
*
* @param object $instance
*
* @return object
*/
protected function invokeMethods($instance)
{
foreach ($this->methods as $method) {
$args = $this->resolveArguments($method['arguments']);
/** @var callable $callable */
$callable = [$instance, $method['method']];
call_user_func_array($callable, $args);
}
return $instance;
}
}

View File

@ -0,0 +1,124 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Definition;
use Generator;
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareTrait;
use Automattic\WooCommerce\Vendor\League\Container\Exception\NotFoundException;
class DefinitionAggregate implements DefinitionAggregateInterface
{
use ContainerAwareTrait;
/**
* @var DefinitionInterface[]
*/
protected $definitions = [];
/**
* Construct.
*
* @param DefinitionInterface[] $definitions
*/
public function __construct(array $definitions = [])
{
$this->definitions = array_filter($definitions, function ($definition) {
return ($definition instanceof DefinitionInterface);
});
}
/**
* {@inheritdoc}
*/
public function add(string $id, $definition, bool $shared = false) : DefinitionInterface
{
if (!$definition instanceof DefinitionInterface) {
$definition = new Definition($id, $definition);
}
$this->definitions[] = $definition
->setAlias($id)
->setShared($shared)
;
return $definition;
}
/**
* {@inheritdoc}
*/
public function has(string $id) : bool
{
foreach ($this->getIterator() as $definition) {
if ($id === $definition->getAlias()) {
return true;
}
}
return false;
}
/**
* {@inheritdoc}
*/
public function hasTag(string $tag) : bool
{
foreach ($this->getIterator() as $definition) {
if ($definition->hasTag($tag)) {
return true;
}
}
return false;
}
/**
* {@inheritdoc}
*/
public function getDefinition(string $id) : DefinitionInterface
{
foreach ($this->getIterator() as $definition) {
if ($id === $definition->getAlias()) {
return $definition->setLeagueContainer($this->getLeagueContainer());
}
}
throw new NotFoundException(sprintf('Alias (%s) is not being handled as a definition.', $id));
}
/**
* {@inheritdoc}
*/
public function resolve(string $id, bool $new = false)
{
return $this->getDefinition($id)->resolve($new);
}
/**
* {@inheritdoc}
*/
public function resolveTagged(string $tag, bool $new = false) : array
{
$arrayOf = [];
foreach ($this->getIterator() as $definition) {
if ($definition->hasTag($tag)) {
$arrayOf[] = $definition->setLeagueContainer($this->getLeagueContainer())->resolve($new);
}
}
return $arrayOf;
}
/**
* {@inheritdoc}
*/
public function getIterator() : Generator
{
$count = count($this->definitions);
for ($i = 0; $i < $count; $i++) {
yield $this->definitions[$i];
}
}
}

View File

@ -0,0 +1,67 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Definition;
use IteratorAggregate;
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
interface DefinitionAggregateInterface extends ContainerAwareInterface, IteratorAggregate
{
/**
* Add a definition to the aggregate.
*
* @param string $id
* @param mixed $definition
* @param boolean $shared
*
* @return DefinitionInterface
*/
public function add(string $id, $definition, bool $shared = false) : DefinitionInterface;
/**
* Checks whether alias exists as definition.
*
* @param string $id
*
* @return boolean
*/
public function has(string $id) : bool;
/**
* Checks whether tag exists as definition.
*
* @param string $tag
*
* @return boolean
*/
public function hasTag(string $tag) : bool;
/**
* Get the definition to be extended.
*
* @param string $id
*
* @return DefinitionInterface
*/
public function getDefinition(string $id) : DefinitionInterface;
/**
* Resolve and build a concrete value from an id/alias.
*
* @param string $id
* @param boolean $new
*
* @return mixed
*/
public function resolve(string $id, bool $new = false);
/**
* Resolve and build an array of concrete values from a tag.
*
* @param string $tag
* @param boolean $new
*
* @return mixed
*/
public function resolveTagged(string $tag, bool $new = false);
}

View File

@ -0,0 +1,120 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Definition;
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
interface DefinitionInterface extends ContainerAwareInterface
{
/**
* Add a tag to the definition.
*
* @param string $tag
*
* @return self
*/
public function addTag(string $tag) : DefinitionInterface;
/**
* Does the definition have a tag?
*
* @param string $tag
*
* @return boolean
*/
public function hasTag(string $tag) : bool;
/**
* Set the alias of the definition.
*
* @param string $id
*
* @return DefinitionInterface
*/
public function setAlias(string $id) : DefinitionInterface;
/**
* Get the alias of the definition.
*
* @return string
*/
public function getAlias() : string;
/**
* Set whether this is a shared definition.
*
* @param boolean $shared
*
* @return self
*/
public function setShared(bool $shared) : DefinitionInterface;
/**
* Is this a shared definition?
*
* @return boolean
*/
public function isShared() : bool;
/**
* Get the concrete of the definition.
*
* @return mixed
*/
public function getConcrete();
/**
* Set the concrete of the definition.
*
* @param mixed $concrete
*
* @return DefinitionInterface
*/
public function setConcrete($concrete) : DefinitionInterface;
/**
* Add an argument to be injected.
*
* @param mixed $arg
*
* @return self
*/
public function addArgument($arg) : DefinitionInterface;
/**
* Add multiple arguments to be injected.
*
* @param array $args
*
* @return self
*/
public function addArguments(array $args) : DefinitionInterface;
/**
* Add a method to be invoked
*
* @param string $method
* @param array $args
*
* @return self
*/
public function addMethodCall(string $method, array $args = []) : DefinitionInterface;
/**
* Add multiple methods to be invoked
*
* @param array $methods
*
* @return self
*/
public function addMethodCalls(array $methods = []) : DefinitionInterface;
/**
* Handle instantiation and manipulation of value and return.
*
* @param boolean $new
*
* @return mixed
*/
public function resolve(bool $new = false);
}

View File

@ -0,0 +1,10 @@
<?php
namespace Automattic\WooCommerce\Vendor\League\Container\Exception;
use Psr\Container\ContainerExceptionInterface;
use RuntimeException;
class ContainerException extends RuntimeException implements ContainerExceptionInterface
{
}

View File

@ -0,0 +1,10 @@
<?php
namespace Automattic\WooCommerce\Vendor\League\Container\Exception;
use Psr\Container\NotFoundExceptionInterface;
use InvalidArgumentException;
class NotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
{
}

View File

@ -0,0 +1,123 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Inflector;
use Automattic\WooCommerce\Vendor\League\Container\Argument\ArgumentResolverInterface;
use Automattic\WooCommerce\Vendor\League\Container\Argument\ArgumentResolverTrait;
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareTrait;
class Inflector implements ArgumentResolverInterface, InflectorInterface
{
use ArgumentResolverTrait;
use ContainerAwareTrait;
/**
* @var string
*/
protected $type;
/**
* @var callable|null
*/
protected $callback;
/**
* @var array
*/
protected $methods = [];
/**
* @var array
*/
protected $properties = [];
/**
* Construct.
*
* @param string $type
* @param callable|null $callback
*/
public function __construct(string $type, callable $callback = null)
{
$this->type = $type;
$this->callback = $callback;
}
/**
* {@inheritdoc}
*/
public function getType() : string
{
return $this->type;
}
/**
* {@inheritdoc}
*/
public function invokeMethod(string $name, array $args) : InflectorInterface
{
$this->methods[$name] = $args;
return $this;
}
/**
* {@inheritdoc}
*/
public function invokeMethods(array $methods) : InflectorInterface
{
foreach ($methods as $name => $args) {
$this->invokeMethod($name, $args);
}
return $this;
}
/**
* {@inheritdoc}
*/
public function setProperty(string $property, $value) : InflectorInterface
{
$this->properties[$property] = $this->resolveArguments([$value])[0];
return $this;
}
/**
* {@inheritdoc}
*/
public function setProperties(array $properties) : InflectorInterface
{
foreach ($properties as $property => $value) {
$this->setProperty($property, $value);
}
return $this;
}
/**
* {@inheritdoc}
*/
public function inflect($object)
{
$properties = $this->resolveArguments(array_values($this->properties));
$properties = array_combine(array_keys($this->properties), $properties);
// array_combine() can technically return false
foreach ($properties ?: [] as $property => $value) {
$object->{$property} = $value;
}
foreach ($this->methods as $method => $args) {
$args = $this->resolveArguments($args);
/** @var callable $callable */
$callable = [$object, $method];
call_user_func_array($callable, $args);
}
if ($this->callback !== null) {
call_user_func($this->callback, $object);
}
}
}

View File

@ -0,0 +1,58 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Inflector;
use Generator;
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareTrait;
class InflectorAggregate implements InflectorAggregateInterface
{
use ContainerAwareTrait;
/**
* @var Inflector[]
*/
protected $inflectors = [];
/**
* {@inheritdoc}
*/
public function add(string $type, callable $callback = null) : Inflector
{
$inflector = new Inflector($type, $callback);
$this->inflectors[] = $inflector;
return $inflector;
}
/**
* {@inheritdoc}
*/
public function getIterator() : Generator
{
$count = count($this->inflectors);
for ($i = 0; $i < $count; $i++) {
yield $this->inflectors[$i];
}
}
/**
* {@inheritdoc}
*/
public function inflect($object)
{
foreach ($this->getIterator() as $inflector) {
$type = $inflector->getType();
if (! $object instanceof $type) {
continue;
}
$inflector->setLeagueContainer($this->getLeagueContainer());
$inflector->inflect($object);
}
return $object;
}
}

View File

@ -0,0 +1,27 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Inflector;
use IteratorAggregate;
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
interface InflectorAggregateInterface extends ContainerAwareInterface, IteratorAggregate
{
/**
* Add an inflector to the aggregate.
*
* @param string $type
* @param callable $callback
*
* @return Inflector
*/
public function add(string $type, callable $callback = null) : Inflector;
/**
* Applies all inflectors to an object.
*
* @param object $object
* @return object
*/
public function inflect($object);
}

View File

@ -0,0 +1,60 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\Inflector;
interface InflectorInterface
{
/**
* Get the type.
*
* @return string
*/
public function getType() : string;
/**
* Defines a method to be invoked on the subject object.
*
* @param string $name
* @param array $args
*
* @return self
*/
public function invokeMethod(string $name, array $args) : InflectorInterface;
/**
* Defines multiple methods to be invoked on the subject object.
*
* @param array $methods
*
* @return self
*/
public function invokeMethods(array $methods) : InflectorInterface;
/**
* Defines a property to be set on the subject object.
*
* @param string $property
* @param mixed $value
*
* @return self
*/
public function setProperty(string $property, $value) : InflectorInterface;
/**
* Defines multiple properties to be set on the subject object.
*
* @param array $properties
*
* @return self
*/
public function setProperties(array $properties) : InflectorInterface;
/**
* Apply inflections to an object.
*
* @param object $object
*
* @return void
*/
public function inflect($object);
}

View File

@ -0,0 +1,125 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container;
use Automattic\WooCommerce\Vendor\League\Container\Argument\{ArgumentResolverInterface, ArgumentResolverTrait};
use Automattic\WooCommerce\Vendor\League\Container\Exception\NotFoundException;
use Psr\Container\ContainerInterface;
use ReflectionClass;
use ReflectionException;
use ReflectionFunction;
use ReflectionMethod;
class ReflectionContainer implements ArgumentResolverInterface, ContainerInterface
{
use ArgumentResolverTrait;
use ContainerAwareTrait;
/**
* @var boolean
*/
protected $cacheResolutions = false;
/**
* Cache of resolutions.
*
* @var array
*/
protected $cache = [];
/**
* {@inheritdoc}
*
* @throws ReflectionException
*/
public function get($id, array $args = [])
{
if ($this->cacheResolutions === true && array_key_exists($id, $this->cache)) {
return $this->cache[$id];
}
if (! $this->has($id)) {
throw new NotFoundException(
sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $id)
);
}
$reflector = new ReflectionClass($id);
$construct = $reflector->getConstructor();
$resolution = $construct === null
? new $id
: $resolution = $reflector->newInstanceArgs($this->reflectArguments($construct, $args))
;
if ($this->cacheResolutions === true) {
$this->cache[$id] = $resolution;
}
return $resolution;
}
/**
* {@inheritdoc}
*/
public function has($id) : bool
{
return class_exists($id);
}
/**
* Invoke a callable via the container.
*
* @param callable $callable
* @param array $args
*
* @return mixed
*
* @throws ReflectionException
*/
public function call(callable $callable, array $args = [])
{
if (is_string($callable) && strpos($callable, '::') !== false) {
$callable = explode('::', $callable);
}
if (is_array($callable)) {
if (is_string($callable[0])) {
$callable[0] = $this->getContainer()->get($callable[0]);
}
$reflection = new ReflectionMethod($callable[0], $callable[1]);
if ($reflection->isStatic()) {
$callable[0] = null;
}
return $reflection->invokeArgs($callable[0], $this->reflectArguments($reflection, $args));
}
if (is_object($callable)) {
$reflection = new ReflectionMethod($callable, '__invoke');
return $reflection->invokeArgs($callable, $this->reflectArguments($reflection, $args));
}
$reflection = new ReflectionFunction(\Closure::fromCallable($callable));
return $reflection->invokeArgs($this->reflectArguments($reflection, $args));
}
/**
* Whether the container should default to caching resolutions and returning
* the cache on following calls.
*
* @param boolean $option
*
* @return self
*/
public function cacheResolutions(bool $option = true) : ContainerInterface
{
$this->cacheResolutions = $option;
return $this;
}
}

View File

@ -0,0 +1,46 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\ServiceProvider;
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareTrait;
abstract class AbstractServiceProvider implements ServiceProviderInterface
{
use ContainerAwareTrait;
/**
* @var array
*/
protected $provides = [];
/**
* @var string
*/
protected $identifier;
/**
* {@inheritdoc}
*/
public function provides(string $alias) : bool
{
return in_array($alias, $this->provides, true);
}
/**
* {@inheritdoc}
*/
public function setIdentifier(string $id) : ServiceProviderInterface
{
$this->identifier = $id;
return $this;
}
/**
* {@inheritdoc}
*/
public function getIdentifier() : string
{
return $this->identifier ?? get_class($this);
}
}

View File

@ -0,0 +1,14 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\ServiceProvider;
interface BootableServiceProviderInterface extends ServiceProviderInterface
{
/**
* Method will be invoked on registration of a service provider implementing
* this interface. Provides ability for eager loading of Service Providers.
*
* @return void
*/
public function boot();
}

View File

@ -0,0 +1,106 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\ServiceProvider;
use Generator;
use Automattic\WooCommerce\Vendor\League\Container\{ContainerAwareInterface, ContainerAwareTrait};
use Automattic\WooCommerce\Vendor\League\Container\Exception\ContainerException;
class ServiceProviderAggregate implements ServiceProviderAggregateInterface
{
use ContainerAwareTrait;
/**
* @var ServiceProviderInterface[]
*/
protected $providers = [];
/**
* @var array
*/
protected $registered = [];
/**
* {@inheritdoc}
*/
public function add($provider) : ServiceProviderAggregateInterface
{
if (is_string($provider) && $this->getContainer()->has($provider)) {
$provider = $this->getContainer()->get($provider);
} elseif (is_string($provider) && class_exists($provider)) {
$provider = new $provider;
}
if (in_array($provider, $this->providers, true)) {
return $this;
}
if ($provider instanceof ContainerAwareInterface) {
$provider->setLeagueContainer($this->getLeagueContainer());
}
if ($provider instanceof BootableServiceProviderInterface) {
$provider->boot();
}
if ($provider instanceof ServiceProviderInterface) {
$this->providers[] = $provider;
return $this;
}
throw new ContainerException(
'A service provider must be a fully qualified class name or instance ' .
'of (\Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\ServiceProviderInterface)'
);
}
/**
* {@inheritdoc}
*/
public function provides(string $service) : bool
{
foreach ($this->getIterator() as $provider) {
if ($provider->provides($service)) {
return true;
}
}
return false;
}
/**
* {@inheritdoc}
*/
public function getIterator() : Generator
{
$count = count($this->providers);
for ($i = 0; $i < $count; $i++) {
yield $this->providers[$i];
}
}
/**
* {@inheritdoc}
*/
public function register(string $service)
{
if (false === $this->provides($service)) {
throw new ContainerException(
sprintf('(%s) is not provided by a service provider', $service)
);
}
foreach ($this->getIterator() as $provider) {
if (in_array($provider->getIdentifier(), $this->registered, true)) {
continue;
}
if ($provider->provides($service)) {
$provider->register();
$this->registered[] = $provider->getIdentifier();
}
}
}
}

View File

@ -0,0 +1,36 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\ServiceProvider;
use IteratorAggregate;
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
interface ServiceProviderAggregateInterface extends ContainerAwareInterface, IteratorAggregate
{
/**
* Add a service provider to the aggregate.
*
* @param string|ServiceProviderInterface $provider
*
* @return self
*/
public function add($provider) : ServiceProviderAggregateInterface;
/**
* Determines whether a service is provided by the aggregate.
*
* @param string $service
*
* @return boolean
*/
public function provides(string $service) : bool;
/**
* Invokes the register method of a provider that provides a specific service.
*
* @param string $service
*
* @return void
*/
public function register(string $service);
}

View File

@ -0,0 +1,46 @@
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\League\Container\ServiceProvider;
use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
interface ServiceProviderInterface extends ContainerAwareInterface
{
/**
* Returns a boolean if checking whether this provider provides a specific
* service or returns an array of provided services if no argument passed.
*
* @param string $service
*
* @return boolean
*/
public function provides(string $service) : bool;
/**
* Use the register method to register items with the container via the
* protected $this->leagueContainer property or the `getLeagueContainer` method
* from the ContainerAwareTrait.
*
* @return void
*/
public function register();
/**
* Set a custom id for the service provider. This enables
* registering the same service provider multiple times.
*
* @param string $id
*
* @return self
*/
public function setIdentifier(string $id) : ServiceProviderInterface;
/**
* The id of the service provider uniquely identifies it, so
* that we can quickly determine if it has already been registered.
* Defaults to get_class($provider).
*
* @return string
*/
public function getIdentifier() : string;
}

583
package-lock.json generated
View File

@ -1,16 +1,16 @@
{
"name": "woocommerce",
"version": "4.8.0",
"version": "4.9.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@babel/cli": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.12.1.tgz",
"integrity": "sha512-eRJREyrfAJ2r42Iaxe8h3v6yyj1wu9OyosaUHW6UImjGf9ahGL9nsFNh7OCopvtcPL8WnEo7tp78wrZaZ6vG9g==",
"version": "7.12.8",
"resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.12.8.tgz",
"integrity": "sha512-/6nQj11oaGhLmZiuRUfxsujiPDc9BBReemiXgIbxc+M5W+MIiFKYwvNDJvBfnGKNsJTKbUfEheKc9cwoPHAVQA==",
"dev": true,
"requires": {
"@nicolo-ribaudo/chokidar-2": "^2.1.8",
"@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents",
"chokidar": "^3.4.0",
"commander": "^4.0.1",
"convert-source-map": "^1.1.0",
@ -20,117 +20,6 @@
"make-dir": "^2.1.0",
"slash": "^2.0.0",
"source-map": "^0.5.0"
},
"dependencies": {
"anymatch": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz",
"integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==",
"dev": true,
"optional": true,
"requires": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
}
},
"binary-extensions": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz",
"integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==",
"dev": true,
"optional": true
},
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"optional": true,
"requires": {
"fill-range": "^7.0.1"
}
},
"chokidar": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz",
"integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==",
"dev": true,
"optional": true,
"requires": {
"anymatch": "~3.1.1",
"braces": "~3.0.2",
"fsevents": "~2.1.2",
"glob-parent": "~5.1.0",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.5.0"
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"optional": true,
"requires": {
"to-regex-range": "^5.0.1"
}
},
"fsevents": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
"dev": true,
"optional": true
},
"glob-parent": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
"dev": true,
"optional": true,
"requires": {
"is-glob": "^4.0.1"
}
},
"is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"dev": true,
"optional": true,
"requires": {
"binary-extensions": "^2.0.0"
}
},
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
"optional": true
},
"readdirp": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz",
"integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==",
"dev": true,
"optional": true,
"requires": {
"picomatch": "^2.2.1"
}
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"optional": true,
"requires": {
"is-number": "^7.0.0"
}
}
}
},
"@babel/code-frame": {
@ -143,25 +32,25 @@
}
},
"@babel/compat-data": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.1.tgz",
"integrity": "sha512-725AQupWJZ8ba0jbKceeFblZTY90McUBWMwHhkFQ9q1zKPJ95GUktljFcgcsIVwRnTnRKlcYzfiNImg5G9m6ZQ==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.7.tgz",
"integrity": "sha512-YaxPMGs/XIWtYqrdEOZOCPsVWfEoriXopnsz3/i7apYPXQ3698UFhS6dVT1KN5qOsWmVgw/FOrmQgpRaZayGsw==",
"dev": true
},
"@babel/core": {
"version": "7.12.3",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz",
"integrity": "sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==",
"version": "7.12.9",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz",
"integrity": "sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.1",
"@babel/generator": "^7.12.5",
"@babel/helper-module-transforms": "^7.12.1",
"@babel/helpers": "^7.12.1",
"@babel/parser": "^7.12.3",
"@babel/template": "^7.10.4",
"@babel/traverse": "^7.12.1",
"@babel/types": "^7.12.1",
"@babel/helpers": "^7.12.5",
"@babel/parser": "^7.12.7",
"@babel/template": "^7.12.7",
"@babel/traverse": "^7.12.9",
"@babel/types": "^7.12.7",
"convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.1",
@ -173,43 +62,54 @@
},
"dependencies": {
"@babel/generator": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz",
"integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==",
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz",
"integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==",
"dev": true,
"requires": {
"@babel/types": "^7.12.1",
"@babel/types": "^7.12.5",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
}
},
"@babel/parser": {
"version": "7.12.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz",
"integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz",
"integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==",
"dev": true
},
"@babel/traverse": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz",
"integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==",
"@babel/template": {
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz",
"integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.1",
"@babel/parser": "^7.12.7",
"@babel/types": "^7.12.7"
}
},
"@babel/traverse": {
"version": "7.12.9",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz",
"integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.5",
"@babel/helper-function-name": "^7.10.4",
"@babel/helper-split-export-declaration": "^7.11.0",
"@babel/parser": "^7.12.1",
"@babel/types": "^7.12.1",
"@babel/parser": "^7.12.7",
"@babel/types": "^7.12.7",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.19"
}
},
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@ -218,9 +118,9 @@
}
},
"debug": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
"integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
@ -292,14 +192,14 @@
}
},
"@babel/helper-compilation-targets": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.1.tgz",
"integrity": "sha512-jtBEif7jsPwP27GPHs06v4WBV0KrE8a/P7n0N0sSvHn2hwUCYnolP/CLmz51IzAW4NlN+HuoBtb9QcwnRo9F/g==",
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz",
"integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.12.1",
"@babel/compat-data": "^7.12.5",
"@babel/helper-validator-option": "^7.12.1",
"browserslist": "^4.12.0",
"browserslist": "^4.14.5",
"semver": "^5.5.0"
},
"dependencies": {
@ -325,13 +225,12 @@
}
},
"@babel/helper-create-regexp-features-plugin": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.1.tgz",
"integrity": "sha512-rsZ4LGvFTZnzdNZR5HZdmJVuXK8834R5QkF3WvcnBhrlVtF0HSIUC6zbreL9MgjTywhKokn8RIYRiq99+DLAxA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.7.tgz",
"integrity": "sha512-idnutvQPdpbduutvi3JVfEgcVIHooQnhvhx0Nk9isOINOIGYkZea1Pk2JlJRiUnMefrlvr0vkByATBY/mB4vjQ==",
"dev": true,
"requires": {
"@babel/helper-annotate-as-pure": "^7.10.4",
"@babel/helper-regex": "^7.10.4",
"regexpu-core": "^4.7.1"
}
},
@ -356,9 +255,9 @@
},
"dependencies": {
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@ -398,18 +297,18 @@
}
},
"@babel/helper-member-expression-to-functions": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz",
"integrity": "sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz",
"integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==",
"dev": true,
"requires": {
"@babel/types": "^7.12.1"
"@babel/types": "^7.12.7"
},
"dependencies": {
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@ -446,52 +345,52 @@
},
"dependencies": {
"@babel/generator": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz",
"integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==",
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz",
"integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==",
"dev": true,
"requires": {
"@babel/types": "^7.12.1",
"@babel/types": "^7.12.5",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
}
},
"@babel/helper-module-imports": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz",
"integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==",
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz",
"integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==",
"dev": true,
"requires": {
"@babel/types": "^7.12.1"
"@babel/types": "^7.12.5"
}
},
"@babel/parser": {
"version": "7.12.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz",
"integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz",
"integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==",
"dev": true
},
"@babel/traverse": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz",
"integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==",
"version": "7.12.9",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz",
"integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.1",
"@babel/generator": "^7.12.5",
"@babel/helper-function-name": "^7.10.4",
"@babel/helper-split-export-declaration": "^7.11.0",
"@babel/parser": "^7.12.1",
"@babel/types": "^7.12.1",
"@babel/parser": "^7.12.7",
"@babel/types": "^7.12.7",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.19"
}
},
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@ -500,9 +399,9 @@
}
},
"debug": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
"integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
@ -517,12 +416,25 @@
}
},
"@babel/helper-optimise-call-expression": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz",
"integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.7.tgz",
"integrity": "sha512-I5xc9oSJ2h59OwyUqjv95HRyzxj53DAubUERgQMrpcCEYQyToeHA+NEcUEsVWB4j53RDeskeBJ0SgRAYHDBckw==",
"dev": true,
"requires": {
"@babel/types": "^7.10.4"
"@babel/types": "^7.12.7"
},
"dependencies": {
"@babel/types": {
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
"lodash": "^4.17.19",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-plugin-utils": {
@ -531,15 +443,6 @@
"integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==",
"dev": true
},
"@babel/helper-regex": {
"version": "7.10.5",
"resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.5.tgz",
"integrity": "sha512-68kdUAzDrljqBrio7DYAEgCoJHxppJOERHOgOrDN7WjOzP0ZQ1LsSDRXcemzVZaLvjaJsJEESb6qt+znNuENDg==",
"dev": true,
"requires": {
"lodash": "^4.17.19"
}
},
"@babel/helper-remap-async-to-generator": {
"version": "7.11.4",
"resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.11.4.tgz",
@ -553,55 +456,55 @@
}
},
"@babel/helper-replace-supers": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz",
"integrity": "sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw==",
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz",
"integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==",
"dev": true,
"requires": {
"@babel/helper-member-expression-to-functions": "^7.12.1",
"@babel/helper-optimise-call-expression": "^7.10.4",
"@babel/traverse": "^7.12.1",
"@babel/types": "^7.12.1"
"@babel/traverse": "^7.12.5",
"@babel/types": "^7.12.5"
},
"dependencies": {
"@babel/generator": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz",
"integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==",
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz",
"integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==",
"dev": true,
"requires": {
"@babel/types": "^7.12.1",
"@babel/types": "^7.12.5",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
}
},
"@babel/parser": {
"version": "7.12.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz",
"integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz",
"integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==",
"dev": true
},
"@babel/traverse": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz",
"integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==",
"version": "7.12.9",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz",
"integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.1",
"@babel/generator": "^7.12.5",
"@babel/helper-function-name": "^7.10.4",
"@babel/helper-split-export-declaration": "^7.11.0",
"@babel/parser": "^7.12.1",
"@babel/types": "^7.12.1",
"@babel/parser": "^7.12.7",
"@babel/types": "^7.12.7",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.19"
}
},
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@ -610,9 +513,9 @@
}
},
"debug": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
"integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
@ -636,9 +539,9 @@
},
"dependencies": {
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@ -658,9 +561,9 @@
},
"dependencies": {
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@ -704,54 +607,54 @@
}
},
"@babel/helpers": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.1.tgz",
"integrity": "sha512-9JoDSBGoWtmbay98efmT2+mySkwjzeFeAL9BuWNoVQpkPFQF8SIIFUfY5os9u8wVzglzoiPRSW7cuJmBDUt43g==",
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz",
"integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==",
"dev": true,
"requires": {
"@babel/template": "^7.10.4",
"@babel/traverse": "^7.12.1",
"@babel/types": "^7.12.1"
"@babel/traverse": "^7.12.5",
"@babel/types": "^7.12.5"
},
"dependencies": {
"@babel/generator": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz",
"integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==",
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz",
"integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==",
"dev": true,
"requires": {
"@babel/types": "^7.12.1",
"@babel/types": "^7.12.5",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
}
},
"@babel/parser": {
"version": "7.12.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz",
"integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz",
"integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==",
"dev": true
},
"@babel/traverse": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz",
"integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==",
"version": "7.12.9",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz",
"integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.1",
"@babel/generator": "^7.12.5",
"@babel/helper-function-name": "^7.10.4",
"@babel/helper-split-export-declaration": "^7.11.0",
"@babel/parser": "^7.12.1",
"@babel/types": "^7.12.1",
"@babel/parser": "^7.12.7",
"@babel/types": "^7.12.7",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.19"
}
},
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@ -760,9 +663,9 @@
}
},
"debug": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
"integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
@ -865,9 +768,9 @@
}
},
"@babel/plugin-proposal-numeric-separator": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.1.tgz",
"integrity": "sha512-MR7Ok+Af3OhNTCxYVjJZHS0t97ydnJZt/DbR4WISO39iDnhiD8XHrY12xuSJ90FFEGjir0Fzyyn7g/zY6hxbxA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.7.tgz",
"integrity": "sha512-8c+uy0qmnRTeukiGsjLGy6uVs/TFjJchGXUeBqlG4VWYOdJWkhhVPdQ3uHwbmalfJwv2JsV0qffXP4asRfL2SQ==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.10.4",
@ -896,9 +799,9 @@
}
},
"@babel/plugin-proposal-optional-chaining": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.1.tgz",
"integrity": "sha512-c2uRpY6WzaVDzynVY9liyykS+kVU+WRZPMPYpkelXH8KBt1oXoI89kPbZKKG/jDT5UK92FTW2fZkZaJhdiBabw==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.7.tgz",
"integrity": "sha512-4ovylXZ0PWmwoOvhU2vhnzVNnm88/Sm9nx7V8BPgMvAzn5zDou3/Awy0EjglyubVHasJj+XCEkr/r1X3P5elCA==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.10.4",
@ -1082,12 +985,12 @@
},
"dependencies": {
"@babel/helper-module-imports": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz",
"integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==",
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz",
"integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==",
"dev": true,
"requires": {
"@babel/types": "^7.12.1"
"@babel/types": "^7.12.5"
}
},
"@babel/helper-remap-async-to-generator": {
@ -1102,9 +1005,9 @@
}
},
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@ -1395,13 +1298,12 @@
}
},
"@babel/plugin-transform-sticky-regex": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.1.tgz",
"integrity": "sha512-CiUgKQ3AGVk7kveIaPEET1jNDhZZEl1RPMWdTBE1799bdz++SwqDHStmxfCtDfBhQgCl38YRiSnrMuUMZIWSUQ==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.7.tgz",
"integrity": "sha512-VEiqZL5N/QvDbdjfYQBhruN0HYjSPjC4XkeqW4ny/jNtH9gcbgaqBIXYEZCNnESMAGs0/K/R7oFGMhOyu/eIxg==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.10.4",
"@babel/helper-regex": "^7.10.4"
"@babel/helper-plugin-utils": "^7.10.4"
}
},
"@babel/plugin-transform-template-literals": {
@ -1452,14 +1354,14 @@
}
},
"@babel/preset-env": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.1.tgz",
"integrity": "sha512-H8kxXmtPaAGT7TyBvSSkoSTUK6RHh61So05SyEbpmr0MCZrsNYn7mGMzzeYoOUCdHzww61k8XBft2TaES+xPLg==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.7.tgz",
"integrity": "sha512-OnNdfAr1FUQg7ksb7bmbKoby4qFOHw6DKWWUNB9KqnnCldxhxJlP+21dpyaWFmf2h0rTbOkXJtAGevY3XW1eew==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.12.1",
"@babel/helper-compilation-targets": "^7.12.1",
"@babel/helper-module-imports": "^7.12.1",
"@babel/compat-data": "^7.12.7",
"@babel/helper-compilation-targets": "^7.12.5",
"@babel/helper-module-imports": "^7.12.5",
"@babel/helper-plugin-utils": "^7.10.4",
"@babel/helper-validator-option": "^7.12.1",
"@babel/plugin-proposal-async-generator-functions": "^7.12.1",
@ -1469,10 +1371,10 @@
"@babel/plugin-proposal-json-strings": "^7.12.1",
"@babel/plugin-proposal-logical-assignment-operators": "^7.12.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
"@babel/plugin-proposal-numeric-separator": "^7.12.1",
"@babel/plugin-proposal-numeric-separator": "^7.12.7",
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
"@babel/plugin-proposal-optional-catch-binding": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
"@babel/plugin-proposal-private-methods": "^7.12.1",
"@babel/plugin-proposal-unicode-property-regex": "^7.12.1",
"@babel/plugin-syntax-async-generators": "^7.8.0",
@ -1514,24 +1416,24 @@
"@babel/plugin-transform-reserved-words": "^7.12.1",
"@babel/plugin-transform-shorthand-properties": "^7.12.1",
"@babel/plugin-transform-spread": "^7.12.1",
"@babel/plugin-transform-sticky-regex": "^7.12.1",
"@babel/plugin-transform-sticky-regex": "^7.12.7",
"@babel/plugin-transform-template-literals": "^7.12.1",
"@babel/plugin-transform-typeof-symbol": "^7.12.1",
"@babel/plugin-transform-unicode-escapes": "^7.12.1",
"@babel/plugin-transform-unicode-regex": "^7.12.1",
"@babel/preset-modules": "^0.1.3",
"@babel/types": "^7.12.1",
"core-js-compat": "^3.6.2",
"@babel/types": "^7.12.7",
"core-js-compat": "^3.7.0",
"semver": "^5.5.0"
},
"dependencies": {
"@babel/helper-module-imports": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz",
"integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==",
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz",
"integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==",
"dev": true,
"requires": {
"@babel/types": "^7.12.1"
"@babel/types": "^7.12.5"
}
},
"@babel/helper-remap-async-to-generator": {
@ -1586,9 +1488,9 @@
}
},
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@ -3719,13 +3621,23 @@
}
},
"@nicolo-ribaudo/chokidar-2": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8.tgz",
"integrity": "sha512-FohwULwAebCUKi/akMFyGi7jfc7JXTeMHzKxuP3umRd9mK/2Y7/SMBSI2jX+YLopPXi+PF9l307NmpfxTdCegA==",
"version": "2.1.8-no-fsevents",
"resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.tgz",
"integrity": "sha512-+nb9vWloHNNMFHjGofEam3wopE3m1yuambrrd/fnPc+lFOMB9ROTqQlche9ByFWNkdNqfSgR/kkQtQ8DzEWt2w==",
"dev": true,
"optional": true,
"requires": {
"chokidar": "2.1.8"
"anymatch": "^2.0.0",
"async-each": "^1.0.1",
"braces": "^2.3.2",
"glob-parent": "^3.1.0",
"inherits": "^2.0.3",
"is-binary-path": "^1.0.0",
"is-glob": "^4.0.0",
"normalize-path": "^3.0.0",
"path-is-absolute": "^1.0.0",
"readdirp": "^2.2.1",
"upath": "^1.1.1"
}
},
"@nodelib/fs.scandir": {
@ -23270,9 +23182,9 @@
}
},
"config": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/config/-/config-3.3.2.tgz",
"integrity": "sha512-NlGfBn2565YA44Irn7GV5KHlIGC3KJbf0062/zW5ddP9VXIuRj0m7HVyFAWvMZvaHPEglyGfwmevGz3KosIpCg==",
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/config/-/config-3.3.3.tgz",
"integrity": "sha512-T3RmZQEAji5KYqUQpziWtyGJFli6Khz7h0rpxDwYNjSkr5ynyTWwO7WpfjHzTXclNCDfSWQRcwMb+NwxJesCKw==",
"dev": true,
"requires": {
"json5": "^2.1.1"
@ -23809,15 +23721,52 @@
"dev": true
},
"core-js-compat": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz",
"integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==",
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.8.0.tgz",
"integrity": "sha512-o9QKelQSxQMYWHXc/Gc4L8bx/4F7TTraE5rhuN8I7mKBt5dBIUpXpIR3omv70ebr8ST5R3PqbDQr+ZI3+Tt1FQ==",
"dev": true,
"requires": {
"browserslist": "^4.8.5",
"browserslist": "^4.14.7",
"semver": "7.0.0"
},
"dependencies": {
"browserslist": {
"version": "4.14.7",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz",
"integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001157",
"colorette": "^1.2.1",
"electron-to-chromium": "^1.3.591",
"escalade": "^3.1.1",
"node-releases": "^1.1.66"
}
},
"caniuse-lite": {
"version": "1.0.30001163",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001163.tgz",
"integrity": "sha512-QQbOGkHWnvhn3Dlf4scPlXTZVhGOK+2qCOP5gPxqzXHhtn3tZHwNdH9qNcQRWN0f3tDYrsyXFJCFiP/GLzI5Vg==",
"dev": true
},
"electron-to-chromium": {
"version": "1.3.611",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.611.tgz",
"integrity": "sha512-YhqTzCXtEO2h0foGLGS60ortd6yY/yUQhqDEp1VWG3DIyHvckFFyaRwR41M0/M3m7Yb8Exqh+nzyb2TuxaoMTw==",
"dev": true
},
"escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
"dev": true
},
"node-releases": {
"version": "1.1.67",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz",
"integrity": "sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg==",
"dev": true
},
"semver": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz",
@ -24059,9 +24008,9 @@
"dev": true
},
"deasync": {
"version": "0.1.20",
"resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.20.tgz",
"integrity": "sha512-E1GI7jMI57hL30OX6Ht/hfQU8DO4AuB9m72WFm4c38GNbUD4Q03//XZaOIHZiY+H1xUaomcot5yk2q/qIZQkGQ==",
"version": "0.1.21",
"resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.21.tgz",
"integrity": "sha512-kUmM8Y+PZpMpQ+B4AuOW9k2Pfx/mSupJtxOsLzmnHY2WqZUYRFccFn2RhzPAqt3Xb+sorK/badW2D4zNzqZz5w==",
"dev": true,
"requires": {
"bindings": "^1.5.0",
@ -27500,12 +27449,12 @@
"dev": true
},
"grunt-stylelint": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/grunt-stylelint/-/grunt-stylelint-0.15.0.tgz",
"integrity": "sha512-1G5kbT3Y6OtAqgIv/XErtI6ai1t1UdtQWXxUV5Gd900PQoEzu/WrBYhGNAXdb/9nAsNWNjFHQjtdXQtZcDmobA==",
"version": "0.16.0",
"resolved": "https://registry.npmjs.org/grunt-stylelint/-/grunt-stylelint-0.16.0.tgz",
"integrity": "sha512-ullm0h9iCdgPEDq1TNwKL5HteXA4zke6wbYoRtsO32ATCU3zfUXmDN9unhu+joEcdgJKOPcd2+7UhRNXO1rr+w==",
"dev": true,
"requires": {
"chalk": "^3.0.0"
"chalk": "^4.1.0"
},
"dependencies": {
"ansi-styles": {
@ -27518,9 +27467,9 @@
}
},
"chalk": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
"integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
@ -34613,9 +34562,9 @@
"dev": true
},
"regenerate": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz",
"integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==",
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz",
"integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==",
"dev": true
},
"regenerate-unicode-properties": {

View File

@ -1,7 +1,7 @@
{
"name": "woocommerce",
"title": "WooCommerce",
"version": "4.8.0",
"version": "4.9.0",
"homepage": "https://woocommerce.com/",
"repository": {
"type": "git",
@ -34,10 +34,10 @@
"git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && node ./node_modules/husky/husky.js install"
},
"devDependencies": {
"@babel/cli": "7.12.1",
"@babel/core": "7.12.3",
"@babel/cli": "7.12.8",
"@babel/core": "7.12.9",
"@babel/polyfill": "7.12.1",
"@babel/preset-env": "7.12.1",
"@babel/preset-env": "7.12.7",
"@babel/register": "7.12.1",
"@typescript-eslint/eslint-plugin": "3.10.1",
"@typescript-eslint/experimental-utils": "3.10.1",
@ -55,9 +55,9 @@
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"commander": "4.1.1",
"config": "3.3.2",
"config": "3.3.3",
"cross-env": "6.0.3",
"deasync": "0.1.20",
"deasync": "0.1.21",
"eslint": "6.8.0",
"eslint-config-wpcalypso": "5.0.0",
"eslint-plugin-jest": "23.20.0",
@ -73,7 +73,7 @@
"grunt-postcss": "0.9.0",
"grunt-rtlcss": "2.0.2",
"grunt-sass": "3.1.0",
"grunt-stylelint": "0.15.0",
"grunt-stylelint": "0.16.0",
"gruntify-eslint": "5.0.0",
"husky": "4.3.0",
"istanbul": "1.0.0-alpha.2",

View File

@ -14,6 +14,7 @@
<exclude-pattern>includes/wc-deprecated-functions.php</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>lib/</exclude-pattern>
<!-- Show progress, show the error codes for each message (source). -->
<arg value="ps" />

View File

@ -2,7 +2,7 @@
Contributors: automattic, mikejolley, jameskoster, claudiosanches, rodrigosprimo, peterfabian1000, vedjain, jamosova, obliviousharmony, konamiman, sadowski, wpmuguru, royho
Tags: e-commerce, store, sales, sell, woo, shop, cart, checkout, downloadable, downloads, payments, paypal, storefront, stripe, woo commerce
Requires at least: 5.3
Tested up to: 5.5
Tested up to: 5.6
Requires PHP: 7.0
Stable tag: 4.6.2
License: GPLv3
@ -160,7 +160,7 @@ WooCommerce comes with some sample data you can use to see how products look; im
== Changelog ==
= 4.8.0 - 2020-12-xx =
= 4.9.0 - 2021-01-xx =
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce/master/changelog.txt).

View File

@ -7,6 +7,7 @@ namespace Automattic\WooCommerce\Internal\DependencyManagement;
use Automattic\WooCommerce\Vendor\League\Container\Argument\RawArgument;
use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface;
use Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\AbstractServiceProvider as BaseServiceProvider;
/**
* Base class for the service providers used to register classes in the container.
@ -18,7 +19,7 @@ use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterfac
* - The `share_with_auto_arguments` method, sibling of the above.
* - Convenience `add` and `share` methods that are just proxies for the same methods in `$this->getContainer()`.
*/
abstract class AbstractServiceProvider extends \Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\AbstractServiceProvider {
abstract class AbstractServiceProvider extends BaseServiceProvider {
/**
* Register a class in the container and use reflection to guess the injection method arguments.

5
src/Vendor/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# Prevent anyone from accidentally adding code to these directories.
# This will break any PRs that do, revealing ths mistake they made.
README.md
!.gitignore
!README.md

7
src/Vendor/README.md vendored Normal file
View File

@ -0,0 +1,7 @@
# WARNING
The namespace of this folder belongs to our dummy [lib package](./../lib/README.md) to manage conflict avoidance.
No files should be added here!
These are **internal** dependencies and **should not** be considered backwards compatible! Developers should not
use these files outside of WooCommerce Core as they are subject to change.

View File

@ -0,0 +1,15 @@
#!/bin/bash
echo "Initializing WooCommerce E2E"
wp plugin install woocommerce --activate
wp theme install twentynineteen --activate
wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=password --role=customer --path=/var/www/html
# we cannot create API keys for the API, so we using basic auth, this plugin allows that.
wp plugin install https://github.com/WP-API/Basic-Auth/archive/master.zip --activate
echo "Updating to WordPress Nightly Point Release"
wp plugin install wordpress-beta-tester --activate
wp core check-update

View File

@ -8,18 +8,20 @@ const { getAppRoot, getAppName, getTestConfig } = require( '../utils' );
const dockerArgs = [];
let command = '';
let customInitFile = '';
program
.command( 'up', 'Start and build the Docker container' )
.command( 'down', 'Stop the Docker container and remove volumes' )
.action( ( cmd, options ) => {
arg = options.args ? options.args[ 0 ] : options[ 0 ];
if ( 'up' === arg ) {
args = options.args ? options.args : options;
if ( 'up' === args[0] ) {
command = 'up';
dockerArgs.push( 'up', '--build', '-d' );
customInitFile = args[1] ? args[1] : '';
}
if ( 'down' === arg ) {
if ( 'down' === args[0] ) {
command = 'down';
dockerArgs.push( 'down', '-v' );
}
@ -32,8 +34,17 @@ const envVars = {};
if ( appPath ) {
if ( 'up' === command ) {
// Look for an initialization script in the dependent app.
const appInitFile = path.resolve( appPath, 'tests/e2e/docker/initialize.sh' );
if ( customInitFile ) {
const possibleInitFile = customInitFile;
customInitFile = path.resolve( possibleInitFile );
if ( ! fs.existsSync( customInitFile ) ) {
customInitFile = path.resolve( appPath, possibleInitFile );
}
if ( ! fs.existsSync( customInitFile ) ) {
customInitFile = '';
}
}
const appInitFile = customInitFile ? customInitFile : path.resolve( appPath, 'tests/e2e/docker/initialize.sh' );
// If found, copy it into the wp-cli Docker context so
// it gets picked up by the entrypoint script.
if ( fs.existsSync( appInitFile ) ) {
@ -41,6 +52,7 @@ if ( appPath ) {
appInitFile,
path.resolve( __dirname, '../docker/wp-cli/initialize.sh' )
);
console.log('Initializing ' + appInitFile );
}
}

View File

@ -39,4 +39,4 @@ if [[ $1 ]]; then
fi
#
# Run Docker
./bin/docker-compose.js $1
./bin/docker-compose.js $@

2
tests/e2e/env/package-lock.json generated vendored
View File

@ -5,7 +5,7 @@
"requires": true,
"dependencies": {
"@automattic/puppeteer-utils": {
"version": "github:Automattic/puppeteer-utils#0f3ec50fc22d7bd2a4bd69fc172e8a66d958ef2d",
"version": "github:Automattic/puppeteer-utils#0f3ec50",
"from": "github:Automattic/puppeteer-utils#0f3ec50",
"requires": {
"@babel/cli": "^7.8.3",

View File

@ -202,145 +202,6 @@ const completeOnboardingWizard = async () => {
await page.click( 'button.components-guide__finish-button' );
};
/**
* Complete old setup wizard.
*/
const completeOldSetupWizard = async () => {
// Fill out store setup section details
// Select country where the store is located
await expect( page ).toSelect( 'select[name="store_country"]', config.get( 'addresses.admin.store.country' ) );
// Fill store's address - first line
await expect( page ).toFill( '#store_address', config.get( 'addresses.admin.store.addressfirstline' ) );
// Fill store's address - second line
await expect( page ).toFill( '#store_address_2', config.get( 'addresses.admin.store.addresssecondline' ) );
// Fill the city where the store is located
await expect( page ).toFill( '#store_city', config.get( 'addresses.admin.store.city' ) );
// Select the state where the store is located
await expect( page ).toSelect( 'select[name="store_state"]', config.get( 'addresses.admin.store.state') );
// Fill postcode of the store
await expect( page ).toFill( '#store_postcode', config.get( 'addresses.admin.store.postcode' ) );
// Select currency and type of products to sell details
await expect( page ).toSelect( 'select[name="currency_code"]', '\n' +
'\t\t\t\t\t\tUnited States (US) dollar ($ USD)\t\t\t\t\t' );
await expect( page ).toSelect( 'select[name="product_type"]', 'I plan to sell both physical and digital products' );
// Verify that checkbox next to "I will also be selling products or services in person." is not selected
await verifyCheckboxIsUnset( '#woocommerce_sell_in_person' );
// Click on "Let's go!" button to move to the next step
await page.$eval( 'button[name=save_step]', elem => elem.click() );
// Wait for usage tracking pop-up window to appear
await page.waitForSelector( '#wc-backbone-modal-dialog' );
await expect( page ).toMatchElement(
'.wc-backbone-modal-header', { text: 'Help improve WooCommerce with usage tracking' }
);
await page.waitForSelector( '#wc_tracker_checkbox_dialog' );
// Verify that checkbox next to "Enable usage tracking and help improve WooCommerce" is not selected
await verifyCheckboxIsUnset( '#wc_tracker_checkbox_dialog' );
await Promise.all( [
// Click on "Continue" button to move to the next step
page.$eval( '#wc_tracker_submit', elem => elem.click() ),
// Wait for the Payment section to load
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
] );
// Fill out payment section details
// Turn off Stripe account toggle
await page.click( '.wc-wizard-service-toggle' );
await Promise.all( [
// Click on "Continue" button to move to the next step
page.click( 'button[name=save_step]', { text: 'Continue' } ),
// Wait for the Shipping section to load
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
] );
// Fill out shipping section details
// Turn off WooCommerce Shipping option
await page.$eval( '#wc_recommended_woocommerce_services', elem => elem.click() );
await page.waitForSelector( 'select[name="shipping_zones[domestic][method]"]' );
await page.waitForSelector( 'select[name="shipping_zones[intl][method]"]' );
// Select Flat Rate shipping method for domestic shipping zone
await page.evaluate( () => {
document.querySelector( 'select[name="shipping_zones[domestic][method]"] > option:nth-child(1)' ).selected = true;
let element = document.querySelector( 'select[name="shipping_zones[domestic][method]"]' );
let event = new Event( 'change', { bubbles: true } );
event.simulated = true;
element.dispatchEvent( event );
} );
await page.$eval( 'input[name="shipping_zones[domestic][flat_rate][cost]"]', e => e.setAttribute( 'value', '10.00' ) );
// Select Flat Rate shipping method for the rest of the world shipping zone
await page.evaluate( () => {
document.querySelector( 'select[name="shipping_zones[intl][method]"] > option:nth-child(1)' ).selected = true;
let element = document.querySelector( 'select[name="shipping_zones[intl][method]"]' );
let event = new Event( 'change', { bubbles: true } );
event.simulated = true;
element.dispatchEvent( event );
} );
await page.$eval( 'input[name="shipping_zones[intl][flat_rate][cost]"]', e => e.setAttribute( 'value', '20.00' ) );
// Select product weight and product dimensions options
await expect( page ).toSelect( 'select[name="weight_unit"]', 'Pounds' );
await expect( page ).toSelect( 'select[name="dimension_unit"]', 'Inches' );
await Promise.all( [
// Click on "Continue" button to move to the next step
page.click( 'button[name=save_step]', { text: 'Continue' } ),
// Wait for the Recommended section to load
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
] );
// Fill out recommended section details
// Turn off Storefront Theme option
await page.waitForSelector( '#wc_recommended_storefront_theme', { visible: true } );
await page.$eval( '#wc_recommended_storefront_theme', elem => elem.click() );
// Turn off Automated Taxes option
await page.waitForSelector( '#wc_recommended_automated_taxes', { visible: true } );
await page.$eval( '#wc_recommended_automated_taxes', elem => elem.click() );
// Turn off Mailchimp option
await page.waitForSelector( '#wc_recommended_mailchimp', { visible: true } );
await page.$eval( '#wc_recommended_mailchimp', elem => elem.click() );
// Turn off Facebook option
await page.waitForSelector( '#wc_recommended_facebook', { visible: true } );
await page.$eval( '#wc_recommended_facebook', elem => elem.click() );
await Promise.all( [
// Click on "Continue" button to move to the next step
page.click( 'button[name=save_step]', { text: 'Continue' } ),
// Wait for the Jetpack section to load
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
] );
// Skip activate Jetpack section
// Click on "Skip this step" in order to skip Jetpack installation
await page.click( '.wc-setup-footer-links' );
// Finish Setup Wizard - Ready! section
// Visit Dashboard
await StoreOwnerFlow.openDashboard();
} ;
/**
* Create simple product.
*/
@ -484,7 +345,6 @@ const createVariableProduct = async () => {
};
export {
completeOldSetupWizard,
completeOnboardingWizard,
createSimpleProduct,
createVariableProduct,

View File

@ -3,7 +3,7 @@
* Plugin Name: WooCommerce
* Plugin URI: https://woocommerce.com/
* Description: An eCommerce toolkit that helps you sell anything. Beautifully.
* Version: 4.8.0-dev
* Version: 4.9.0-dev
* Author: Automattic
* Author URI: https://woocommerce.com
* Text Domain: woocommerce