diff --git a/.ddev/cart-block.txt b/.ddev/cart-block.txt new file mode 100644 index 000000000..ef46ba325 --- /dev/null +++ b/.ddev/cart-block.txt @@ -0,0 +1,51 @@ + +
+
+
+
+
+ + + +
+
+ + + +
+ + + +
+ + + +
+
+
+ + + +
+
+ + + +

Your cart is currently empty!

+ + + +

Browse store.

+ + + +
+ + + +

New in store

+ + +
+
+ diff --git a/.ddev/checkout-block.txt b/.ddev/checkout-block.txt new file mode 100644 index 000000000..ef672eea4 --- /dev/null +++ b/.ddev/checkout-block.txt @@ -0,0 +1,45 @@ + +
+
+
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
+ + + +
+
+
+
+ diff --git a/.ddev/commands/web/orchestrate.d/50_woocommerce.sh b/.ddev/commands/web/orchestrate.d/30_woocommerce.sh similarity index 100% rename from .ddev/commands/web/orchestrate.d/50_woocommerce.sh rename to .ddev/commands/web/orchestrate.d/30_woocommerce.sh diff --git a/.ddev/commands/web/orchestrate.d/31_woocommerce_products.sh b/.ddev/commands/web/orchestrate.d/31_woocommerce_products.sh new file mode 100644 index 000000000..f0a11514c --- /dev/null +++ b/.ddev/commands/web/orchestrate.d/31_woocommerce_products.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +wp plugin install wordpress-importer --activate +wp import ../sample_products.xml --authors=skip diff --git a/.ddev/commands/web/orchestrate.d/32_woocommerce_blocks.sh b/.ddev/commands/web/orchestrate.d/32_woocommerce_blocks.sh new file mode 100644 index 000000000..906620c9d --- /dev/null +++ b/.ddev/commands/web/orchestrate.d/32_woocommerce_blocks.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +wp plugin install woo-gutenberg-products-block --activate diff --git a/.ddev/commands/web/orchestrate.d/33_woocommerce_config.sh b/.ddev/commands/web/orchestrate.d/33_woocommerce_config.sh new file mode 100644 index 000000000..2ee4c7831 --- /dev/null +++ b/.ddev/commands/web/orchestrate.d/33_woocommerce_config.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +#activate tax setting +wp option set woocommerce_calc_taxes "yes" +#create tax +wp wc tax create --rate=10 --name="Standard tax" --priority=1 --compound=0 --shipping=1 --user="admin" +wp option set woocommerce_tax_display_shop "incl" +#euro +wp option set woocommerce_currency "EUR" + +#store address +wp option set woocommerce_store_address "Calle Drutal" +wp option set woocommerce_store_address_2 "" +wp option set woocommerce_store_city "Valencia" +wp option set woocommerce_default_country "DE:DE-BE" diff --git a/.ddev/commands/web/orchestrate.d/34_woocommerce_classic_pages.sh b/.ddev/commands/web/orchestrate.d/34_woocommerce_classic_pages.sh new file mode 100644 index 000000000..655e16f40 --- /dev/null +++ b/.ddev/commands/web/orchestrate.d/34_woocommerce_classic_pages.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +wp wc tool run install_pages --user="admin" diff --git a/.ddev/commands/web/orchestrate.d/35_woocommerce_block_pages.sh b/.ddev/commands/web/orchestrate.d/35_woocommerce_block_pages.sh new file mode 100644 index 000000000..2a5b6e826 --- /dev/null +++ b/.ddev/commands/web/orchestrate.d/35_woocommerce_block_pages.sh @@ -0,0 +1,4 @@ +#!/bin/bash + + wp post create ../checkout-block.txt --post_title='checkout-block' --post_type=page --post_status=publish + wp post create ../cart-block.txt --post_title='cart-block' --post_type=page --post_status=publish diff --git a/.ddev/commands/web/orchestrate.d/30_install_plugin_packages.sh b/.ddev/commands/web/orchestrate.d/40_install_plugin_packages.sh similarity index 100% rename from .ddev/commands/web/orchestrate.d/30_install_plugin_packages.sh rename to .ddev/commands/web/orchestrate.d/40_install_plugin_packages.sh diff --git a/.ddev/commands/web/orchestrate.d/40_setup_and_activate.sh b/.ddev/commands/web/orchestrate.d/40_setup_and_activate.sh deleted file mode 100644 index fdd06dbfc..000000000 --- a/.ddev/commands/web/orchestrate.d/40_setup_and_activate.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -pushd "${DDEV_DOCROOT}" - -wp plugin activate "${PLUGIN_NAME:-$DDEV_PROJECT}" diff --git a/.ddev/commands/web/orchestrate.d/41_setup_and_activate.sh b/.ddev/commands/web/orchestrate.d/41_setup_and_activate.sh new file mode 100644 index 000000000..1ed1a910f --- /dev/null +++ b/.ddev/commands/web/orchestrate.d/41_setup_and_activate.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +pushd "${DDEV_DOCROOT}" + +wp plugin activate --all diff --git a/.ddev/config.yaml b/.ddev/config.yaml index 2ffd7f244..16f0f8802 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -1,4 +1,4 @@ -name: mollie +name: mollie-payments-for-woocommerce type: php docroot: .ddev/wordpress php_version: "7.4" @@ -18,14 +18,14 @@ hooks: pre-start: - exec-host: "mkdir -p .ddev/wordpress/wp-content/plugins/${DDEV_PROJECT}" web_environment: - - WP_VERSION=5.9 - - WP_LOCALE=de_DE + - WP_VERSION=6.1 + - WP_LOCALE=en_US - WP_TITLE=Mollie WordPress Test - PLUGIN_NAME=mollie-payments-for-woocommerce - ADMIN_USER=admin - ADMIN_PASS=admin - ADMIN_EMAIL=admin@example.com - - WC_VERSION=6.1.0 + - WC_VERSION=7.2.2 hooks: post-start: @@ -98,7 +98,7 @@ hooks: # Please take care with this because it can cause great confusion. # upload_dir: custom/upload/dir -# would set the destination path for ddev import-files to /custom/upload/dir +# would set the destination path for ddev import-files to /custom/upload/dir # working_dir: # web: /var/www/html diff --git a/.ddev/docker-compose.wp-plugin.yaml b/.ddev/docker-compose.wp-plugin.yaml index 699272849..56fa35cc9 100644 --- a/.ddev/docker-compose.wp-plugin.yaml +++ b/.ddev/docker-compose.wp-plugin.yaml @@ -3,5 +3,5 @@ services: web: volumes: - source: ../ - target: /var/www/html/.ddev/wordpress/wp-content/plugins/mollie-payments-for-woocommerce:ro + target: /var/www/html/.ddev/wordpress/wp-content/plugins/mollie-payments-for-woocommerce type: bind diff --git a/.ddev/sample_products.xml b/.ddev/sample_products.xml new file mode 100644 index 000000000..ef53c5021 --- /dev/null +++ b/.ddev/sample_products.xml @@ -0,0 +1,1210 @@ + + + + + +WooCommerce Demo Store +http: +Just another WooCommerce store +Wed, 16 Jan 2019 13:09:24 +0000 +en-US +1.2 +http: +http: + + 1 + shopmanager + info@woocommerce.com + + + + +https://wordpress.org/?v=5.0.3 + + V-Neck T-Shirt + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt/ + Wed, 16 Jan 2019 13:01:52 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt/ + + + + 6 + 2019-01-16 13:01:52 + 2019-01-16 13:01:52 + open + closed + v-neck-t-shirt + publish + 0 + 0 + product + + 0 + + + + + + + + + + + _sku + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _thumbnail_id + + + + _price + + + + _price + + + + _regular_price + + + + _sale_price + + + + + Beanie + https://woocommercecore.mystagingwebsite.com/product/beanie/ + Wed, 16 Jan 2019 13:01:52 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/beanie/ + + + + 10 + 2019-01-16 13:01:52 + 2019-01-16 13:01:52 + open + closed + beanie + publish + 0 + 0 + product + + 0 + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Album + https://woocommercecore.mystagingwebsite.com/product/album/ + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/album/ + + + + 18 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + open + closed + album + publish + 0 + 0 + product + + 0 + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + V-Neck T-Shirt - Red + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt/?attribute_pa_color=red + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt-red/ + + + + 20 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + closed + closed + v-neck-t-shirt-red + publish + 6 + 0 + product_variation + + 0 + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _variation_description + + + + _thumbnail_id + + + + attribute_pa_color + + + + attribute_pa_size + + + + + V-Neck T-Shirt - Green + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt/?attribute_pa_color=green + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt-green/ + + + + 21 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + closed + closed + v-neck-t-shirt-green + publish + 6 + 0 + product_variation + + 0 + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _variation_description + + + + _thumbnail_id + + + + attribute_pa_color + + + + attribute_pa_size + + + + + V-Neck T-Shirt - Blue + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt/?attribute_pa_color=blue + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt-blue/ + + + + 22 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + closed + closed + v-neck-t-shirt-blue + publish + 6 + 0 + product_variation + + 0 + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _wpcom_is_markdown + + + + _wp_old_slug + + + + _variation_description + + + + _thumbnail_id + + + + attribute_pa_color + + + + attribute_pa_size + + + + + vneck-tee-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=31 + Wed, 16 Jan 2019 13:01:56 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vneck-tee-2.jpg + + + + 31 + 2019-01-16 13:01:56 + 2019-01-16 13:01:56 + open + closed + vneck-tee-2-jpg + inherit + 6 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vneck-tee-2.jpg + + _wc_attachment_source + + + + + vnech-tee-green-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=32 + Wed, 16 Jan 2019 13:01:57 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vnech-tee-green-1.jpg + + + + 32 + 2019-01-16 13:01:57 + 2019-01-16 13:01:57 + open + closed + vnech-tee-green-1-jpg + inherit + 6 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vnech-tee-green-1.jpg + + _wc_attachment_source + + + + + vnech-tee-blue-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=33 + Wed, 16 Jan 2019 13:01:58 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vnech-tee-blue-1.jpg + + + + 33 + 2019-01-16 13:01:58 + 2019-01-16 13:01:58 + open + closed + vnech-tee-blue-1-jpg + inherit + 6 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vnech-tee-blue-1.jpg + + _wc_attachment_source + + + + + beanie-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=39 + Wed, 16 Jan 2019 13:02:02 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/beanie-2.jpg + + + + 39 + 2019-01-16 13:02:02 + 2019-01-16 13:02:02 + open + closed + beanie-2-jpg + inherit + 10 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/beanie-2.jpg + + _wc_attachment_source + + + + + album-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=47 + Wed, 16 Jan 2019 13:02:09 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2022/05/album-1.jpg + + + + 47 + 2019-01-16 13:02:09 + 2019-01-16 13:02:09 + open + closed + album-1-jpg + inherit + 18 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2022/05/album-1.jpg + + _wc_attachment_source + + + + + diff --git a/.env.example b/.env.example index 47e8b6461..78fe98dfd 100644 --- a/.env.example +++ b/.env.example @@ -23,3 +23,9 @@ WP_TITLE="Mollie Test" ADMIN_USER=admin ADMIN_PASS=admin ADMIN_EMAIL=me@my.com + +E2E_AUTH_USERNAME=admin +E2E_AUTH_PW=admin +E2E_URL_TESTSITE=mollie.ddev.site +MOLLIE_LIVE_API_KEY= +MOLLIE_TEST_API_KEY= diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41e253743..348be82bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,9 @@ jobs: - name: Run PHPUnit run: ./vendor/bin/phpunit + + - name: Run Psalm + run: ./vendor/bin/psalm --show-info=false --threads=2 + + - name: Run PhpCS + run: ./vendor/bin/phpcs -n --parallel=2 --runtime-set ignore_warnings_on_exit 1 diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 000000000..0d6cf8ef4 --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,55 @@ +name: E2E Tests +on: + workflow_dispatch +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: [ '7.4' ] + wc-versions: [ '5.9.5' ] + + name: PHP ${{ matrix.php-versions }} WC ${{ matrix.wc-versions }} + steps: + - uses: satackey/action-docker-layer-caching@v0.0.11 + continue-on-error: true + + - uses: jonaseberle/github-action-setup-ddev@v1 + with: + autostart: false + + - uses: actions/checkout@v1 + - uses: actions/setup-node@v2 + with: + node-version: '14.x' + - name: Configure DDEV + run: ddev config --php-version ${{ matrix.php-versions }} --web-environment-add="WC_VERSION=${{ matrix.wc-versions }}" + + - name: Start DDEV + run: ddev start + + - name: Orchestrate DDEV + run: ddev orchestrate + - name: Install Playwright + run: npx playwright install --with-deps + - name: Install Ngrok + run: curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok + - name: Add ngrok Authtoken + run: ngrok config add-authtoken ${{ secrets.NGROK_AUTHTOKEN1 }}_${{ secrets.NGROK_AUTHTOKEN2 }} + - name: Run Ngrok + run: bin/ddev-share --ci + - name: Run Playwright tests + run: npx playwright test TestCI.spec.js + env: + E2E_AUTH_USERNAME: ${{ secrets.E2E_AUTH_USERNAME }} + E2E_AUTH_PW: ${{ secrets.E2E_AUTH_PW }} + MOLLIE_LIVE_API_KEY: ${{ secrets.MOLLIE_LIVE_API_KEY }} + MOLLIE_TEST_API_KEY: ${{ secrets.MOLLIE_TEST_API_KEY }} + BASEURL: ${{ env.BASEURL }} + - uses: actions/upload-artifact@v2 + if: always() + with: + name: e2e-results + path: tests/e2e/Reports/ + retention-days: 30 diff --git a/.gitignore b/.gitignore index 5157fda82..6082f0b83 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,12 @@ /public/css/ /tools/ /build/ -/tests/e2e/config/default.json +/tests/e2e/Shared/default.json .env cypress.json +test-results/ +playwright-report/ +/test-results/ +/playwright-report/ +/playwright/.cache/ diff --git a/.idea/WooCommerce.iml b/.idea/WooCommerce.iml index 0e3abaf43..b4ab7c5cc 100644 --- a/.idea/WooCommerce.iml +++ b/.idea/WooCommerce.iml @@ -8,74 +8,75 @@ - - - - - + - - - - - - - - - - - - - - + + - - - + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + - - - + + - - - - - - + + + + + - - - - - - - - - - - + + - + + + + + + + + + - - - - + + + + + + + - + + + diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 03d9549ea..f576bf5a2 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,6 +1,24 @@ - \ No newline at end of file + diff --git a/.idea/php-test-framework.xml b/.idea/php-test-framework.xml index 48151b5a2..11b6887b9 100644 --- a/.idea/php-test-framework.xml +++ b/.idea/php-test-framework.xml @@ -6,10 +6,9 @@ - - \ No newline at end of file + diff --git a/.idea/php.xml b/.idea/php.xml index 5d7477695..2df240ff7 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -23,102 +23,115 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -333,6 +346,17 @@ + + + + + + + + + + + @@ -342,7 +366,7 @@ - + diff --git a/.phive/phars.xml b/.phive/phars.xml deleted file mode 100644 index ec1b26d44..000000000 --- a/.phive/phars.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/.psalm/stubs.php b/.psalm/stubs.php new file mode 100644 index 000000000..b0916a8fc --- /dev/null +++ b/.psalm/stubs.php @@ -0,0 +1,20 @@ +> $GITHUB_ENV +else + echo "Running in local mode" + #this sets all variables at once, so we need to pass them all in + ddev config --web-environment="BASEURL=https://${NGROK_HOST}, WP_VERSION=6.1, WP_LOCALE=en_US, WP_TITLE=Mollie WordPress Test, PLUGIN_NAME=mollie-payments-for-woocommerce, ADMIN_USER=admin, ADMIN_PASS=admin, ADMIN_EMAIL=admin@example.com, WC_VERSION=7.2.2" + echo "ctrl-c to stop sharing and revert database changes" + trap kill-ngrok INT + wait -f "${NGROK_PID}" +fi diff --git a/composer.json b/composer.json index 6029e8033..775f2ec40 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,8 @@ "johnpbloch/wordpress-core": "^5.0", "fzaninotto/faker": "^1.9@dev", "inpsyde/php-coding-standards": "^1.0.0", + "php-stubs/wordpress-stubs": "^5.0@stable", + "php-stubs/woocommerce-stubs": "^5.0@stable", "vimeo/psalm": "^4.8" }, "autoload": { @@ -45,7 +47,7 @@ } }, "scripts": { - "check-coding-standards": "vendor/bin/phpcs", + "check-coding-standards": "vendor/bin/phpcs --parallel=8 -s", "fix-coding-standards": "vendor/bin/phpcbf", "tests": "@php ./vendor/phpunit/phpunit/phpunit --coverage-text", "tests:no-cov": "@php ./vendor/phpunit/phpunit/phpunit --no-coverage", diff --git a/composer.lock b/composer.lock index 705e93391..984a996a8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "318fa773e4f4de32cf59fca3767d461d", + "content-hash": "d9e49ce3ea480fa5a1ebc4002a89eb3e", "packages": [ { "name": "composer/ca-bundle", @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "5f7f80cfc25e2e435f960e8ca178aeb9f786ae65" + "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/5f7f80cfc25e2e435f960e8ca178aeb9f786ae65", - "reference": "5f7f80cfc25e2e435f960e8ca178aeb9f786ae65", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd", "shasum": "" }, "require": { @@ -65,7 +65,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/main" + "source": "https://github.com/composer/ca-bundle/tree/1.3.5" }, "funding": [ { @@ -81,7 +81,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T12:11:04+00:00" + "time": "2023-01-11T08:27:00+00:00" }, { "name": "inpsyde/modularity", @@ -89,18 +89,18 @@ "source": { "type": "git", "url": "https://github.com/inpsyde/modularity.git", - "reference": "16aa1701340fcecd1889584a6790c14fdec1d8f5" + "reference": "eb14a9b0468000fa88646824080bc035a7a03b61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/inpsyde/modularity/zipball/16aa1701340fcecd1889584a6790c14fdec1d8f5", - "reference": "16aa1701340fcecd1889584a6790c14fdec1d8f5", + "url": "https://api.github.com/repos/inpsyde/modularity/zipball/eb14a9b0468000fa88646824080bc035a7a03b61", + "reference": "eb14a9b0468000fa88646824080bc035a7a03b61", "shasum": "" }, "require": { "ext-json": "*", "php": ">=7.2", - "psr/container": "~1.0" + "psr/container": "^1.1.0 || ^2" }, "require-dev": { "brain/monkey": "^2.6.1", @@ -139,11 +139,6 @@ "email": "c.leucht@inpsyde.com", "role": "Developer" }, - { - "name": "Pablo Kauffman", - "email": "p.kauffman@inpsyde.com", - "role": "Developer" - }, { "name": "Giuseppe Mazzapica", "email": "g.mazzapica@inpsyde.com", @@ -153,22 +148,22 @@ "description": "Modular PSR-11 implementation for WordPress plugins, themes or libraries.", "support": { "issues": "https://github.com/inpsyde/modularity/issues", - "source": "https://github.com/inpsyde/modularity/tree/master" + "source": "https://github.com/inpsyde/modularity/tree/1.6.1" }, - "time": "2022-03-18T07:17:12+00:00" + "time": "2023-02-16T09:37:57+00:00" }, { "name": "mollie/mollie-api-php", - "version": "v2.44.1", + "version": "v2.50.0", "source": { "type": "git", "url": "https://github.com/mollie/mollie-api-php.git", - "reference": "5906cf9ff3133a4f47fea47624f3839ac07d0805" + "reference": "2291b114ec636392e3e48b73d33199b3b4a790d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/5906cf9ff3133a4f47fea47624f3839ac07d0805", - "reference": "5906cf9ff3133a4f47fea47624f3839ac07d0805", + "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/2291b114ec636392e3e48b73d33199b3b4a790d5", + "reference": "2291b114ec636392e3e48b73d33199b3b4a790d5", "shasum": "" }, "require": { @@ -176,14 +171,14 @@ "ext-curl": "*", "ext-json": "*", "ext-openssl": "*", - "php": "^7.0|^8.0" + "php": "^7.2|^8.0" }, "require-dev": { "eloquent/liberator": "^2.0||^3.0", "friendsofphp/php-cs-fixer": "^3.0", "guzzlehttp/guzzle": "^6.3 || ^7.0", "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^6.5 || ^7.1 || ^8.5 || ^9.5" + "phpunit/phpunit": "^8.5 || ^9.5" }, "suggest": { "mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://docs.mollie.com/ for more information." @@ -245,28 +240,33 @@ ], "support": { "issues": "https://github.com/mollie/mollie-api-php/issues", - "source": "https://github.com/mollie/mollie-api-php/tree/v2.44.1" + "source": "https://github.com/mollie/mollie-api-php/tree/v2.50.0" }, - "time": "2022-05-24T14:03:01+00:00" + "time": "2023-01-02T08:49:24+00:00" }, { "name": "psr/container", - "version": "1.1.x-dev", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/2ae37329ee82f91efadc282cc2d527fd6065a5ef", + "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef", "shasum": "" }, "require": { "php": ">=7.2.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -293,9 +293,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.x" + "source": "https://github.com/php-fig/container/tree/2.0.1" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-03-24T13:40:57+00:00" }, { "name": "psr/log", @@ -351,16 +351,16 @@ "packages-dev": [ { "name": "amphp/amp", - "version": "dev-master", + "version": "2.x-dev", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" + "reference": "c5ea79065f98f93f7b16a4d5a504fe5d69451447" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "url": "https://api.github.com/repos/amphp/amp/zipball/c5ea79065f98f93f7b16a4d5a504fe5d69451447", + "reference": "c5ea79065f98f93f7b16a4d5a504fe5d69451447", "shasum": "" }, "require": { @@ -375,7 +375,6 @@ "psalm/phar": "^3.11@dev", "react/promise": "^2" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -429,7 +428,7 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.2" + "source": "https://github.com/amphp/amp/tree/master" }, "funding": [ { @@ -437,11 +436,11 @@ "type": "github" } ], - "time": "2022-02-20T17:52:18+00:00" + "time": "2022-08-21T11:55:21+00:00" }, { "name": "amphp/byte-stream", - "version": "dev-master", + "version": "1.x-dev", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", @@ -465,7 +464,6 @@ "phpunit/phpunit": "^6 || ^7 || ^8", "psalm/phar": "^3.11.4" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -519,16 +517,16 @@ }, { "name": "antecedent/patchwork", - "version": "2.1.21", + "version": "2.1.25", "source": { "type": "git", "url": "https://github.com/antecedent/patchwork.git", - "reference": "25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d" + "reference": "17314e042d45e0dacb0a494c2d1ef50e7621136a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d", - "reference": "25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/17314e042d45e0dacb0a494c2d1ef50e7621136a", + "reference": "17314e042d45e0dacb0a494c2d1ef50e7621136a", "shasum": "" }, "require": { @@ -561,9 +559,9 @@ ], "support": { "issues": "https://github.com/antecedent/patchwork/issues", - "source": "https://github.com/antecedent/patchwork/tree/2.1.21" + "source": "https://github.com/antecedent/patchwork/tree/2.1.25" }, - "time": "2022-02-07T07:28:34+00:00" + "time": "2023-02-19T12:51:24+00:00" }, { "name": "automattic/phpcs-neutron-standard", @@ -814,12 +812,12 @@ "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "b2d040ded1201088ff10dbc456ed2df9e2fc7717" + "reference": "3fdb2807b31a78a40ad89570e30ec77466c98717" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/b2d040ded1201088ff10dbc456ed2df9e2fc7717", - "reference": "b2d040ded1201088ff10dbc456ed2df9e2fc7717", + "url": "https://api.github.com/repos/composer/pcre/zipball/3fdb2807b31a78a40ad89570e30ec77466c98717", + "reference": "3fdb2807b31a78a40ad89570e30ec77466c98717", "shasum": "" }, "require": { @@ -877,7 +875,7 @@ "type": "tidelift" } ], - "time": "2022-06-22T06:34:17+00:00" + "time": "2022-11-16T18:32:04+00:00" }, { "name": "composer/semver", @@ -885,12 +883,12 @@ "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "fa1ec24f0ab1efe642671ec15c51a3ab879f59bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf", + "reference": "fa1ec24f0ab1efe642671ec15c51a3ab879f59bf", "shasum": "" }, "require": { @@ -941,9 +939,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/main" }, "funding": [ { @@ -959,7 +957,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2023-01-13T15:47:53+00:00" }, { "name": "composer/xdebug-handler", @@ -1145,27 +1143,28 @@ "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -1191,7 +1190,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.x" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -1207,7 +1206,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -1373,12 +1372,12 @@ "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "c4a71eb93b6d7effffc1f45edbede2cf6eb168d2" + "reference": "d34238d1651eb62fc39ab4efe26df74dc293ebbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/c4a71eb93b6d7effffc1f45edbede2cf6eb168d2", - "reference": "c4a71eb93b6d7effffc1f45edbede2cf6eb168d2", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/d34238d1651eb62fc39ab4efe26df74dc293ebbb", + "reference": "d34238d1651eb62fc39ab4efe26df74dc293ebbb", "shasum": "" }, "require": { @@ -1417,7 +1416,7 @@ "issues": "https://github.com/hamcrest/hamcrest-php/issues", "source": "https://github.com/hamcrest/hamcrest-php/tree/master" }, - "time": "2022-02-04T09:26:57+00:00" + "time": "2022-11-06T05:05:05+00:00" }, { "name": "inpsyde/php-coding-standards", @@ -1425,12 +1424,12 @@ "source": { "type": "git", "url": "https://github.com/inpsyde/php-coding-standards.git", - "reference": "bab7e00068c2b7a601e3cdce6b0bf6a0ccfe8355" + "reference": "7880c1e0ad1099c5fa8613626ac2544336625327" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/inpsyde/php-coding-standards/zipball/bab7e00068c2b7a601e3cdce6b0bf6a0ccfe8355", - "reference": "bab7e00068c2b7a601e3cdce6b0bf6a0ccfe8355", + "url": "https://api.github.com/repos/inpsyde/php-coding-standards/zipball/7880c1e0ad1099c5fa8613626ac2544336625327", + "reference": "7880c1e0ad1099c5fa8613626ac2544336625327", "shasum": "" }, "require": { @@ -1439,7 +1438,7 @@ "dealerdirect/phpcodesniffer-composer-installer": "~0.7.0", "php": ">=7", "phpcompatibility/php-compatibility": "^9.3.5", - "squizlabs/php_codesniffer": "~3.6.0", + "squizlabs/php_codesniffer": "^3.6.0", "wp-coding-standards/wpcs": "^2.3" }, "require-dev": { @@ -1479,13 +1478,14 @@ "phpcs", "psr-12", "standards", + "static analysis", "wordpress" ], "support": { "issues": "https://github.com/inpsyde/php-coding-standards/issues", - "source": "https://github.com/inpsyde/php-coding-standards/tree/1.0.0" + "source": "https://github.com/inpsyde/php-coding-standards/tree/master" }, - "time": "2022-02-28T11:55:53+00:00" + "time": "2022-12-21T13:29:27+00:00" }, { "name": "johnpbloch/wordpress-core", @@ -1493,12 +1493,12 @@ "source": { "type": "git", "url": "https://github.com/johnpbloch/wordpress-core.git", - "reference": "35a2b47e86c252986c1d7e5bfbd5b5959a116243" + "reference": "710f37a6f28ff3c0d75bb9e2a4f207cf559d2847" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/35a2b47e86c252986c1d7e5bfbd5b5959a116243", - "reference": "35a2b47e86c252986c1d7e5bfbd5b5959a116243", + "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/710f37a6f28ff3c0d75bb9e2a4f207cf559d2847", + "reference": "710f37a6f28ff3c0d75bb9e2a4f207cf559d2847", "shasum": "" }, "require": { @@ -1533,7 +1533,7 @@ "source": "https://core.trac.wordpress.org/browser", "wiki": "https://codex.wordpress.org/" }, - "time": "2022-05-04T11:49:03+00:00" + "time": "2023-02-21T03:04:20+00:00" }, { "name": "mockery/mockery", @@ -1541,12 +1541,12 @@ "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "a60f28f954cbe31e0dfd63f92334785abf031934" + "reference": "dc206df4fa314a50bbb81cf72239a305c5bbd5c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/a60f28f954cbe31e0dfd63f92334785abf031934", - "reference": "a60f28f954cbe31e0dfd63f92334785abf031934", + "url": "https://api.github.com/repos/mockery/mockery/zipball/dc206df4fa314a50bbb81cf72239a305c5bbd5c0", + "reference": "dc206df4fa314a50bbb81cf72239a305c5bbd5c0", "shasum": "" }, "require": { @@ -1602,7 +1602,7 @@ "issues": "https://github.com/mockery/mockery/issues", "source": "https://github.com/mockery/mockery/tree/1.3" }, - "time": "2022-04-12T10:01:48+00:00" + "time": "2022-09-07T15:05:49+00:00" }, { "name": "myclabs/deep-copy", @@ -1666,16 +1666,16 @@ }, { "name": "netresearch/jsonmapper", - "version": "v4.0.0", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", "shasum": "" }, "require": { @@ -1711,9 +1711,9 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.1.0" }, - "time": "2020-12-01T19:48:11+00:00" + "time": "2022-12-08T20:46:14+00:00" }, { "name": "nikic/php-parser", @@ -1721,12 +1721,12 @@ "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "2d589921f23d869846a52c541247e0bafca61ab3" + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2d589921f23d869846a52c541247e0bafca61ab3", - "reference": "2d589921f23d869846a52c541247e0bafca61ab3", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", "shasum": "" }, "require": { @@ -1737,6 +1737,7 @@ "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, + "default-branch": true, "bin": [ "bin/php-parse" ], @@ -1767,9 +1768,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/4.x" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" }, - "time": "2022-06-04T10:44:36+00:00" + "time": "2023-01-16T22:05:37+00:00" }, { "name": "openlss/lib-array2xml", @@ -1943,6 +1944,97 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "php-stubs/woocommerce-stubs", + "version": "v5.9.1", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/woocommerce-stubs.git", + "reference": "486ccff117badfab94c404065d37a77d632d7db5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/486ccff117badfab94c404065d37a77d632d7db5", + "reference": "486ccff117badfab94c404065d37a77d632d7db5", + "shasum": "" + }, + "require": { + "php-stubs/wordpress-stubs": "^5.3.0" + }, + "require-dev": { + "php": "~7.1", + "php-stubs/generator": "^0.8.0" + }, + "suggest": { + "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WooCommerce function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/woocommerce-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "woocommerce", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v5.9.1" + }, + "time": "2022-04-30T06:35:48+00:00" + }, + { + "name": "php-stubs/wordpress-stubs", + "version": "v5.9.5", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wordpress-stubs.git", + "reference": "13ecf204a7e6d215a7c0d23e2aa27940fe617717" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/13ecf204a7e6d215a7c0d23e2aa27940fe617717", + "reference": "13ecf204a7e6d215a7c0d23e2aa27940fe617717", + "shasum": "" + }, + "replace": { + "giacocorsiglia/wordpress-stubs": "*" + }, + "require-dev": { + "nikic/php-parser": "< 4.12.0", + "php": "~7.3 || ~8.0", + "php-stubs/generator": "^0.8.1", + "phpdocumentor/reflection-docblock": "^5.3", + "phpstan/phpstan": "^1.2" + }, + "suggest": { + "paragonie/sodium_compat": "Pure PHP implementation of libsodium", + "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/wordpress-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/wordpress-stubs/issues", + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.9.5" + }, + "time": "2022-11-09T05:32:14+00:00" + }, { "name": "phpcompatibility/php-compatibility", "version": "9.3.5", @@ -2060,16 +2152,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "dev-master", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9455bde915e322a823d464a2c41e5c0de03512a6" + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9455bde915e322a823d464a2c41e5c0de03512a6", - "reference": "9455bde915e322a823d464a2c41e5c0de03512a6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { @@ -2080,10 +2172,9 @@ "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.5", + "mockery/mockery": "~1.3.2", "psalm/phar": "^4.8" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -2112,13 +2203,13 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" }, - "time": "2022-04-02T20:16:01+00:00" + "time": "2021-10-19T17:43:47+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.x-dev", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", @@ -2138,7 +2229,6 @@ "ext-tokenizer": "*", "psalm/phar": "^4.8" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -2167,74 +2257,6 @@ }, "time": "2022-03-15T21:29:03+00:00" }, - { - "name": "phpspec/prophecy", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, { "name": "phpunit/php-code-coverage", "version": "7.0.x-dev", @@ -2538,12 +2560,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "df70070f2711b8fe8dcca0797c1239ede8c94be6" + "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/df70070f2711b8fe8dcca0797c1239ede8c94be6", - "reference": "df70070f2711b8fe8dcca0797c1239ede8c94be6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e", + "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e", "shasum": "" }, "require": { @@ -2558,15 +2580,14 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.2", - "phpspec/prophecy": "^1.10.3", "phpunit/php-code-coverage": "^7.0.12", "phpunit/php-file-iterator": "^2.0.4", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", + "sebastian/comparator": "^3.0.5", "sebastian/diff": "^3.0.2", "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.2", + "sebastian/exporter": "^3.1.5", "sebastian/global-state": "^3.0.0", "sebastian/object-enumerator": "^3.0.3", "sebastian/resource-operations": "^2.0.1", @@ -2612,7 +2633,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.33" }, "funding": [ { @@ -2622,9 +2643,13 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-06-19T12:11:16+00:00" + "time": "2023-02-27T13:04:50+00:00" }, { "name": "ptrofimov/xpmock", @@ -2724,12 +2749,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" + "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770", + "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770", "shasum": "" }, "require": { @@ -2782,7 +2807,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0" + "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.5" }, "funding": [ { @@ -2790,7 +2815,7 @@ "type": "github" } ], - "time": "2020-11-30T08:04:30+00:00" + "time": "2022-09-14T12:31:48+00:00" }, { "name": "sebastian/diff", @@ -2927,12 +2952,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "77200c5b1b7b073a04aca7f593a26dad7df1de35" + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/77200c5b1b7b073a04aca7f593a26dad7df1de35", - "reference": "77200c5b1b7b073a04aca7f593a26dad7df1de35", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", "shasum": "" }, "require": { @@ -2996,7 +3021,7 @@ "type": "github" } ], - "time": "2022-03-06T06:59:21+00:00" + "time": "2022-09-14T06:00:17+00:00" }, { "name": "sebastian/global-state", @@ -3398,12 +3423,12 @@ "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "e9c99cda31b21ccb4da4c2124b57c8355ddce48e" + "reference": "0f25a3766f26df91d6bdda0c8931303fc85499d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/e9c99cda31b21ccb4da4c2124b57c8355ddce48e", - "reference": "e9c99cda31b21ccb4da4c2124b57c8355ddce48e", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/0f25a3766f26df91d6bdda0c8931303fc85499d7", + "reference": "0f25a3766f26df91d6bdda0c8931303fc85499d7", "shasum": "" }, "require": { @@ -3411,11 +3436,12 @@ "squizlabs/php_codesniffer": "^3.5.6" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", "phpcsstandards/phpcsdevcs": "^1.1", "phpstan/phpstan": "^1.7", "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", - "sirbrillig/phpcs-import-detection": "^1.1" + "sirbrillig/phpcs-import-detection": "^1.1", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" }, "default-branch": true, "type": "phpcodesniffer-standard", @@ -3439,25 +3465,29 @@ } ], "description": "A PHPCS sniff to detect problems with variables.", + "keywords": [ + "phpcs", + "static analysis" + ], "support": { "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2022-06-13T13:49:41+00:00" + "time": "2023-01-05T18:45:16+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.2", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -3469,6 +3499,7 @@ "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, + "default-branch": true, "bin": [ "bin/phpcs", "bin/phpcbf" @@ -3493,14 +3524,15 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2021-12-12T21:44:58+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "symfony/console", @@ -3508,12 +3540,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "56f40c96d6619cd87717a066f7ce65054bfd38b1" + "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/56f40c96d6619cd87717a066f7ce65054bfd38b1", - "reference": "56f40c96d6619cd87717a066f7ce65054bfd38b1", + "url": "https://api.github.com/repos/symfony/console/zipball/c77433ddc6cdc689caf48065d9ea22ca0853fbd9", + "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9", "shasum": "" }, "require": { @@ -3599,7 +3631,7 @@ "type": "tidelift" } ], - "time": "2022-06-07T04:48:21+00:00" + "time": "2023-02-25T16:59:41+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3607,12 +3639,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", "shasum": "" }, "require": { @@ -3666,7 +3698,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2023-01-24T14:02:46+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3674,12 +3706,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -3695,7 +3727,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3733,7 +3765,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/main" }, "funding": [ { @@ -3749,7 +3781,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -3757,12 +3789,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -3775,7 +3807,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3815,7 +3847,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/main" }, "funding": [ { @@ -3831,7 +3863,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -3839,12 +3871,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -3857,7 +3889,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3900,7 +3932,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/main" }, "funding": [ { @@ -3916,7 +3948,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3924,12 +3956,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "f9c7affe77a00ae32ca127ca6833d034e6d33f25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f9c7affe77a00ae32ca127ca6833d034e6d33f25", + "reference": "f9c7affe77a00ae32ca127ca6833d034e6d33f25", "shasum": "" }, "require": { @@ -3945,7 +3977,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3984,7 +4016,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/main" }, "funding": [ { @@ -4000,7 +4032,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-30T17:25:47+00:00" }, { "name": "symfony/polyfill-php73", @@ -4008,12 +4040,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -4023,7 +4055,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4064,7 +4096,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php73/tree/main" }, "funding": [ { @@ -4080,7 +4112,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", @@ -4088,12 +4120,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -4103,7 +4135,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4148,7 +4180,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/main" }, "funding": [ { @@ -4164,41 +4196,33 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/service-contracts", - "version": "2.5.x-dev", + "version": "v1.1.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" + "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0", + "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" + "php": "^7.1.3" }, "suggest": { + "psr/container": "", "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "dev-master": "1.1-dev" } }, "autoload": { @@ -4231,23 +4255,9 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/2.5" + "source": "https://github.com/symfony/service-contracts/tree/v1.1.2" }, - "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": "2022-03-13T20:07:29+00:00" + "time": "2019-05-28T07:50:59+00:00" }, { "name": "symfony/string", @@ -4255,12 +4265,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99" + "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", - "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", + "url": "https://api.github.com/repos/symfony/string/zipball/edac10d167b78b1d90f46a80320d632de0bd9f2f", + "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f", "shasum": "" }, "require": { @@ -4280,7 +4290,6 @@ "symfony/translation-contracts": "^1.1|^2", "symfony/var-exporter": "^4.4|^5.0|^6.0" }, - "default-branch": true, "type": "library", "autoload": { "files": [ @@ -4318,7 +4327,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.9" + "source": "https://github.com/symfony/string/tree/5.4" }, "funding": [ { @@ -4334,7 +4343,7 @@ "type": "tidelift" } ], - "time": "2022-04-19T10:40:37+00:00" + "time": "2023-02-22T08:00:55+00:00" }, { "name": "theseer/tokenizer", @@ -4392,12 +4401,12 @@ "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "1f87a5056e90c33c5e71628b99074aa6d943f071" + "reference": "f630a0dc399170e5c7e8bd57ee28c2f5d01505e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/1f87a5056e90c33c5e71628b99074aa6d943f071", - "reference": "1f87a5056e90c33c5e71628b99074aa6d943f071", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/f630a0dc399170e5c7e8bd57ee28c2f5d01505e6", + "reference": "f630a0dc399170e5c7e8bd57ee28c2f5d01505e6", "shasum": "" }, "require": { @@ -4436,6 +4445,7 @@ "phpdocumentor/reflection-docblock": "^5", "phpmyadmin/sql-parser": "5.1.0||dev-master", "phpspec/prophecy": ">=1.9.0", + "phpstan/phpdoc-parser": "1.2.* || 1.6.4", "phpunit/phpunit": "^9.0", "psalm/plugin-phpunit": "^0.16", "slevomat/coding-standard": "^7.0", @@ -4492,7 +4502,7 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm/tree/4.x" }, - "time": "2022-06-22T17:19:57+00:00" + "time": "2022-11-07T12:23:42+00:00" }, { "name": "webmozart/assert", @@ -4659,7 +4669,9 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "fzaninotto/faker": 20 + "fzaninotto/faker": 20, + "php-stubs/wordpress-stubs": 0, + "php-stubs/woocommerce-stubs": 0 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/development/fswatch-sync.sh b/development/fswatch-sync.sh deleted file mode 100755 index d4ffc9b5c..000000000 --- a/development/fswatch-sync.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash - -# @author Clemens Westrup -# @date 07.07.2014 - -# This is a script to automatically synchronize a local project folder to a -# folder on a cluster server via a middle server. -# It watches the local folder for changes and recreates the local state on the -# target machine as soon as a change is detected. - -# https://github.com/aalto-ics-kepaco/fswatch-rsync - -################################################################################ - -# Set up your path to fswatch here if you don't want to / can't add it -# globally to your PATH variable (default is "fswatch" when specified in PATH). -# e.g. FSWATCH_PATH="/Users/you/builds/fswatch/fswatch" -FSWATCH_PATH="fswatch" - -# Sync latency / speed in seconds -LATENCY="2" - -# check color support -colors=$(tput colors) -if (($colors >= 8)); then - red='\033[0;31m' - green='\033[0;32m' - nocolor='\033[00m' -else - red= - green= - nocolor= -fi - -# Check compulsory arguments -if [[ "$1" = "" || "$2" = "" ]]; then - echo -e "${red}Error: Takes 2 compulsory arguments.${nocolor}" - echo -n "Usage: fswatch-rsync.sh /source/path /target/path" - exit -else - SOURCE_PATH="$1" - TARGET_PATH="$2" -fi - -# Welcome -echo "" -echo "Source path: \"$SOURCE_PATH\"" -echo "Target path: \"$TARGET_PATH\"" -echo "" -echo -n "Performing initial complete synchronization " -echo -n "(Warning: Target directory will be overwritten " -echo "with local version if differences occur)." - -# Perform initial complete sync -read -n1 -r -p "Press any key to continue (or abort with Ctrl-C)... " key -echo "" -echo -n "Synchronizing... " -rsync -avzr -q --delete --force \ ---exclude=".*/" --exclude=".*" \ ---exclude="*___jb_bak___" --exclude="*___jb_old___" \ ---exclude="*.lock" \ -$SOURCE_PATH $TARGET_PATH -echo "done." -echo "" - -# Watch for changes and sync (exclude hidden files) -echo "Watching for changes. Quit anytime with Ctrl-C." -${FSWATCH_PATH} -0 -r -l $LATENCY $SOURCE_PATH \ ---exclude="/\.*/$" --exclude="/\.[^/]*$" \ ---exclude=".*___jb_bak___$" --exclude=".*___jb_old___$" \ ---exclude=".*\.lock$" \ -| while read -d "" event - do - echo $event > .tmp_files - echo -en "${green}" `date` "${nocolor}\"$event\" changed. Synchronizing... " - rsync -avzr -q --delete --force \ - --include-from=.tmp_files \ - $SOURCE_PATH $TARGET_PATH - echo "done." - rm -rf .tmp_files - done diff --git a/development/readme.md b/development/readme.md deleted file mode 100644 index 900d8611d..000000000 --- a/development/readme.md +++ /dev/null @@ -1,235 +0,0 @@ -## Development machine (vagrant) - -I use [Varying Vagrant Vagrants](https://github.com/Varying-Vagrant-Vagrants/VVV) for WordPress development. This is a vagrant machine which installs a couple of WordPress websites for you to use to develop or test your plugins. [Installation instructions](https://github.com/Varying-Vagrant-Vagrants/VVV#the-first-vagrant-up). - -### Add new WordPress website to vagrant machine - -You can manually add new WordPress websites using [auto site setup](https://github.com/varying-vagrant-vagrants/vvv/wiki/Auto-site-Setup) but you can also use a command line tool like [vv](https://github.com/bradp/vv) to add and configure new WordPress websites. The tool will automatically update and provision your vagrant machine. - -This can be used to test the Mollie WooCommerce plugin in a specific WordPress + WooCommerce version. - -## GIT checkout plugin code - -I have checked out the Mollie plugin in my vagrant `www` directory so it is accessible by the vagrant machine and makes it easier to later update the translation files. - -``` -cd /wwww -git clone git@github.com:mollie/WooCommerce.git -cd WooCommerce/ - -# Load submodule -git submodule init -git submodule update -``` - -## Keep the plugin sourcecode in sync with the plugin in your WordPress website - -I use [fswatch](https://github.com/emcrisostomo/fswatch) to watch the plugin directory for changes and copy the changes to my WordPress plugin directory to keep them in sync. I use [this shell script](https://github.com/mollie/WooCommerce/tree/master/development/fswatch-sync.sh) to automatically watch for changes and update the plugin in my WordPress website. - -``` -cd /wwww -fswatch-sync.sh ./WooCommerce/mollie-payments-for-woocommerce/ ./wordpress-default/wp-content/plugins/mollie-payments-for-woocommerce/ -``` - -It will notify you that the target directory will be overwritten. Changes made in the target directory will be overwritten when you make a change to the source directory. - -## Updating translations - -The development Wordpress website in the vagrant machine contains [translation tools](https://codex.wordpress.org/I18n_for_WordPress_Developers#Using_the_i18n_tools) to parse your sourcecode and update the translation `.pot` file. - -On your vagrant machine: - -``` -cd /srv/www -makepot wp-plugin ./WooCommerce/mollie-payments-for-woocommerce/ ./WooCommerce/mollie-payments-for-woocommerce/i18n/languages/mollie-payments-for-woocommerce.pot -``` - -After the `.pot` file is updated you can update the translation files using [Poedit](https://poedit.net/). You can use the "Update from POT file..." to get the update translation keys. - -## Available gateway ID's - -A gateway ID is used by WooCommerce to identify the payment gateway. - -* mollie_wc_gateway_banktransfer -* mollie_wc_gateway_belfius -* mollie_wc_gateway_bitcoin -* mollie_wc_gateway_creditcard -* mollie_wc_gateway_directdebit -* mollie_wc_gateway_ideal -* mollie_wc_gateway_kbc -* mollie_wc_gateway_mistercash -* mollie_wc_gateway_paypal -* mollie_wc_gateway_paysafecard -* mollie_wc_gateway_sofort - -## Filters - -### `mollie-payments-for-woocommerce_initial_order_status` -Determine the default order status (default: `pending`). This status is assigned to the order when the payment is created. Use this filter -if you want to overwrite this status for all payment gateways this plugin provides. - -``` -add_filter('mollie-payments-for-woocommerce_initial_order_status', function($initial_order_status) { - /* https://docs.woocommerce.com/document/managing-orders/ */ - return 'pending'; -}); -``` - -### `mollie-payments-for-woocommerce_initial_order_status_` -Determine the default order status (default: `pending`). This status is assigned to the order when the payment is created. Use this filter -if you want to overwrite this status for a specific payment gateway this plugin provides. - -``` -$gateway_id = 'mollie_wc_gateway_creditcard'; - -add_filter('mollie-payments-for-woocommerce_initial_order_status_' . $gateway_id, function($initial_order_status) { - /* https://docs.woocommerce.com/document/managing-orders/ */ - return 'pending'; -}); -``` - -### `mollie-payments-for-woocommerce_order_status_cancelled` -Determine the new order status for when the Mollie payment is cancelled (default: `pending`). Use this filter if you want to overwrite this -status for all payment gateways this plugin provides. - -``` -add_filter('mollie-payments-for-woocommerce_order_status_cancelled', function($order_status) { - /* https://docs.woocommerce.com/document/managing-orders/ */ - return 'pending'; -}); -``` - -### `mollie-payments-for-woocommerce_order_status_cancelled_` -Determine the new order status for when the Mollie payment is cancelled (default: `pending`). Use this filter if you want -to overwrite this status for a specific payment gateway this plugin provides. - -``` -$gateway_id = 'mollie_wc_gateway_creditcard'; - -add_filter('mollie-payments-for-woocommerce_order_status_cancelled_' . $gateway_id, function($order_status) { - /* https://docs.woocommerce.com/document/managing-orders/ */ - return 'pending'; -}); -``` - -### `mollie-payments-for-woocommerce_order_status_expired` -Determine the new order status for when the Mollie payment has expired (default: `pending`). Use this filter if you want to overwrite this -status for all payment gateways this plugin provides. - -``` -add_filter('mollie-payments-for-woocommerce_order_status_cancelled', function($order_status) { - /* https://docs.woocommerce.com/document/managing-orders/ */ - return 'cancelled'; -}); -``` - -### `mollie-payments-for-woocommerce_order_status_expired_` -Determine the new order status for when the Mollie payment has expired (default: `pending`). Use this filter if you want -to overwrite this status for a specific payment gateway this plugin provides. - -``` -$gateway_id = 'mollie_wc_gateway_creditcard'; - -add_filter('mollie-payments-for-woocommerce_order_status_expired_' . $gateway_id, function($order_status) { - /* https://docs.woocommerce.com/document/managing-orders/ */ - return 'cancelled'; -}); -``` - -### `_icon_url` -Implement this filter if you want to overwrite the default gateway icon URL. - -``` -$gateway_id = 'mollie_wc_gateway_creditcard'; - -add_filter($gateway_id . '_icon_url', function($icon_url) { - // Overwrite gateway icon URL - $icon_url = 'http://my-website.com/path/to/icons/creditcard.png'; - - return $icon_url; -}); -``` - -### `mollie-payments-for-woocommerce_webhook_url` -This filter can be added if you want to overwrite the payment webhook. This can be useful if your development environment is on a local machine and your machine is not publicly accessible by the Mollie platform, in which case Mollie can not deliver the webhook request to your website. You can use a tool like [ngrok](https://ngrok.com/) to create a public endpoint that proxies requests to your local machine. - -``` -add_filter('mollie-payments-for-woocommerce_webhook_url', function($webhook_url, WC_Order $order) { - // Overwrite plugin webhook URL (I use ngrok.io) - $new_webhook_url = str_replace($_SERVER['HTTP_HOST'], '63950d2f.ngrok.io', $webhook_url); - - return $new_webhook_url; -}); -``` - -### `mollie-payments-for-woocommerce_return_url` -This filter can be added if you want to overwrite the payment return URL. The user is redirected to this return URL after he or she completes the payment. - -``` -add_filter('mollie-payments-for-woocommerce_return_url', function($return_url, WC_Order $order) { - return $return_url; -}); -``` - -### `mollie-payments-for-woocommerce_api_endpoint` -You can use this filter to overwrite the Mollie API endpoint. This is only useful for Mollie employees who have a local development version of Mollie on their own machine. - -``` -// Overwrite Mollie API endpoint for local Mollie installation (Mollie employees only) -add_filter('mollie-payments-for-woocommerce_api_endpoint', function($api_endpoint) { - return 'http://api.mollie.dev'; -}); -``` - -### `woocommerce__args` -Use this filter if you need to overwrite or add specific Mollie payment parameters for creating a new payment. - -``` -add_filter('woocommerce_' . $this->id . '_args', function(array $arguments, WC_Order $order) { - /* Here you can overwrite or add new arguments to the $arguments array */ - - return $arguments; -}); -``` - -## Actions - -### `mollie-payments-for-woocommerce_create_payment` -Add this action if you want to receive the arguments that are used for creating a new payment. This can be useful if you want to log this during development. - -``` -add_action('mollie-payments-for-woocommerce_create_payment', function(array $payment_arguments, WC_Order $order) { - log("Order {$order->id} create payment parameters: " . print_r($payment_arguments, TRUE)); -}, $priority = 10, $accepted_args = 2); -``` - -### `mollie-payments-for-woocommerce_payment_created` -Add this action if you want to receive the arguments that are used for creating a new payment. This can be useful if you want to log this during development. - -``` -add_action('mollie-payments-for-woocommerce_payment_created', function(Mollie_API_Object_Payment $payment, WC_Order $order) { - log("Order {$order->id} payment created: " . print_r($payment, TRUE)); -}, $priority = 10, $accepted_args = 2); -``` - -### `mollie-payments-for-woocommerce_create_refund` -Add this action if you want to receive the payment that is being refunded. This can be useful if you want to log this during development. - -``` -add_action('mollie-payments-for-woocommerce_create_refund', function(Mollie_API_Object_Payment $payment, WC_Order $order) { - log("Refund order {$order->id}, payment: {$payment->id}"); -}, $priority = 10, $accepted_args = 2); -``` - -### `mollie-payments-for-woocommerce_refund_created` -Add this action if you want to receive the payment that is being refunded. This can be useful if you want to log this during development. - -``` -add_action('mollie-payments-for-woocommerce_create_refund', function(Mollie_API_Object_Payment_Refund $refund, WC_Order $order) { - log("Order {$order->id} refunded, refund: {$refund->id}"); -}, $priority = 10, $accepted_args = 2); -``` - -## Development WordPress plugin - -You can add [this WordPress plugin](https://github.com/lvgunst/woocommerce-mollie-payments-development) which implements some of these filters and actions. diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index b19b63560..000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,113 +0,0 @@ -version: '3.4' -services: - wp_dev: - build: - context: ./ - dockerfile: docker/Dockerfile_wp - target: dev - args: - PHP_BUILD_VERSION: $PHP_BUILD_VERSION - PHP_TEST_VERSION: $PHP_TEST_VERSION - PHP_DEPS_VERSION: $PHP_DEPS_VERSION - PROJECT_MOUNT_PATH: $PROJECT_MOUNT_PATH - BUILD_ROOT_PATH: $BUILD_ROOT_PATH - DOCROOT_PATH: $DOCROOT_PATH - WP_DOMAIN: ${WP_DOMAIN} - container_name: "${PROJECT_NAME}_wp_dev" - depends_on: - - db - restart: unless-stopped - environment: - WORDPRESS_DB_HOST: db:3306 - WORDPRESS_DB_NAME: $DB_NAME - WORDPRESS_DB_USER: $DB_USER_NAME - WORDPRESS_DB_PASSWORD: $DB_USER_PASSWORD - WORDPRESS_DEBUG: 1 - DOCROOT_PATH: ${DOCROOT_PATH} - PLUGIN_NAME: ${PLUGIN_NAME} - ADMIN_USER: ${ADMIN_USER} - ADMIN_PASS: ${ADMIN_PASS} - ADMIN_EMAIL: ${ADMIN_EMAIL} - WP_DOMAIN: ${WP_DOMAIN} - WP_TITLE: ${WP_TITLE} - volumes: - - wordpress:${DOCROOT_PATH} - - ${BASE_PATH}:${PROJECT_MOUNT_PATH} - ports: - - 80:80 - - db: - image: mariadb:latest - container_name: "${PROJECT_NAME}_db" - restart: unless-stopped - environment: - MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD - MYSQL_DATABASE: $DB_NAME - MYSQL_USER: $DB_USER_NAME - MYSQL_PASSWORD: $DB_USER_PASSWORD - ports: - - 3306:3306 - volumes: - - db:/var/lib/mysql - - db_admin: - image: phpmyadmin/phpmyadmin:latest - container_name: "${PROJECT_NAME}_db_admin" - restart: unless-stopped - environment: - MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD - depends_on: - - db - ports: - - 1234:80 - # volumes: - # - db_admin - - composer: - build: - context: ./ - dockerfile: docker/Dockerfile_wp - target: composer - args: - PHP_DEPS_VERSION: $PHP_DEPS_VERSION - BUILD_ROOT_PATH: $BUILD_ROOT_PATH - container_name: "${PROJECT_NAME}_composer" - working_dir: ${BUILD_ROOT_PATH} - volumes: - - ${BASE_PATH}:${BUILD_ROOT_PATH} - - build: - build: - context: ./ - dockerfile: docker/Dockerfile_wp - target: build - args: - PHP_DEPS_VERSION: $PHP_DEPS_VERSION - PHP_BUILD_VERSION: $PHP_BUILD_VERSION - BUILD_ROOT_PATH: $BUILD_ROOT_PATH - container_name: "${PROJECT_NAME}_build" - working_dir: ${BUILD_ROOT_PATH} - volumes: - - ${BASE_PATH}:${BUILD_ROOT_PATH} - - test: - extra_hosts: - - "host.docker.internal:${HOST_IP_ADDRESS}" - build: - context: ./ - dockerfile: docker/Dockerfile_wp - target: test - args: - PHP_DEPS_VERSION: $PHP_DEPS_VERSION - BUILD_ROOT_PATH: $BUILD_ROOT_PATH - PHP_BUILD_VERSION: $PHP_BUILD_VERSION - PHP_TEST_VERSION: $PHP_TEST_VERSION - container_name: "${PROJECT_NAME}_test" - working_dir: ${BUILD_ROOT_PATH} - volumes: - - ${BASE_PATH}:${BUILD_ROOT_PATH} - -volumes: - wordpress: - db: - db_admin: diff --git a/docker-sync.yml b/docker-sync.yml deleted file mode 100644 index d37056de5..000000000 --- a/docker-sync.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: "2" - -syncs: - docker-sync: - src: './' - sync_userid: '501' - sync_excludes: ['.gitignore', '.git/', '.idea/'] -# docker-sync-another-project: -# src: '/absolute/path/to/project/codebase' -# sync_userid: '501' -# sync_excludes: ['.gitignore', '.git/', '.idea/'] diff --git a/docker.mk b/docker.mk deleted file mode 100644 index e259b37b7..000000000 --- a/docker.mk +++ /dev/null @@ -1,62 +0,0 @@ -include .env - -.PHONY: up down stop prune ps shell wp logs - -default: up - -WP_ROOT ?= /var/www/html/ - -## help : Print commands help. -help : docker.mk - @sed -n 's/^##//p' $< - -## up : Start up containers. -up: - @echo "Starting up containers for for $(PROJECT_NAME)..." - docker-compose pull - docker-compose up -d --remove-orphans - -## down : Stop containers. -down: stop - -## start : Start containers without updating. -start: - @echo "Starting containers for $(PROJECT_NAME) from where you left off..." - @docker-compose start - -## stop : Stop containers. -stop: - @echo "Stopping containers for $(PROJECT_NAME)..." - @docker-compose stop - -## prune : Remove containers and their volumes. -## You can optionally pass an argument with the service name to prune single container -## prune mariadb : Prune `mariadb` container and remove its volumes. -## prune mariadb solr : Prune `mariadb` and `solr` containers and remove their volumes. -prune: - @echo "Removing containers for $(PROJECT_NAME)..." - @docker-compose down -v $(filter-out $@,$(MAKECMDGOALS)) - -## ps : List running containers. -ps: - @docker ps --filter name='$(PROJECT_NAME)*' - -## shell : Access `php` container via shell. -shell: - docker exec -ti -e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") sh - -## wp : Executes `wp cli` command in a specified `WP_ROOT` directory (default is `/var/www/html/`). -## Doesn't support --flag arguments. -wp: - docker exec $(shell docker ps --filter name='^/$(PROJECT_NAME)_php' --format "{{ .ID }}") wp --path=$(WP_ROOT) $(filter-out $@,$(MAKECMDGOALS)) - -## logs : View containers logs. -## You can optinally pass an argument with the service name to limit logs -## logs php : View `php` container logs. -## logs nginx php : View `nginx` and `php` containers logs. -logs: - @docker-compose logs -f $(filter-out $@,$(MAKECMDGOALS)) - -# https://stackoverflow.com/a/6273809/1826109 -%: - @: \ No newline at end of file diff --git a/docker/Dockerfile_wp b/docker/Dockerfile_wp deleted file mode 100644 index 5bcb1e788..000000000 --- a/docker/Dockerfile_wp +++ /dev/null @@ -1,149 +0,0 @@ -ARG PHP_BUILD_VERSION -ARG PHP_TEST_VERSION -ARG PHP_DEPS_VERSION - -# Composer on correct PHP version -FROM php:${PHP_DEPS_VERSION}-cli as composer - -RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" -RUN echo 'memory_limit = 128M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini; - -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ - php composer-setup.php --install-dir=/usr/bin --filename=composer && \ - php -r "unlink('composer-setup.php');" - -RUN apt-get update -RUN apt-get install -y \ - zip \ - unzip \ - curl \ - git \ - # These are for extensions - zlib1g-dev \ - libicu-dev - -RUN docker-php-ext-install intl json && \ - docker-php-ext-enable intl json - -# Composer on correct PHP version -FROM php:${PHP_BUILD_VERSION}-cli as build - -ARG BUILD_ROOT_PATH - -RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" -RUN echo 'memory_limit = 256M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini; - -RUN apt-get update -RUN apt-get install -y gnupg apt-transport-https ca-certificates - -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list - -RUN apt-get update -RUN apt-get install -y \ - zip \ - unzip \ - curl \ - git \ - yarn \ - # These are for extensions - zlib1g-dev \ - libicu-dev \ - g++ \ - # For installing things from URL - wget - -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ - php composer-setup.php --install-dir=/usr/bin --filename=composer && \ - php -r "unlink('composer-setup.php');" - -RUN docker-php-ext-install intl json && \ - docker-php-ext-enable intl json - -# Install Node -RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - -RUN apt-get install -y nodejs - -# Install Phive -RUN wget -O phive.phar "https://phar.io/releases/phive.phar" -RUN wget -O phive.phar.asc "https://phar.io/releases/phive.phar.asc" -RUN gpg --keyserver hkps.pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79 -RUN gpg --verify phive.phar.asc phive.phar -RUN rm phive.phar.asc && \ - chmod +x phive.phar && \ - mv phive.phar /usr/local/bin/phive - -WORKDIR ${BUILD_ROOT_PATH} -COPY . ./ - - -FROM php:${PHP_TEST_VERSION}-cli as test - -ARG BUILD_ROOT_PATH - -RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" -RUN apt-get update -RUN apt-get install -y \ - # These are for extensions - zlib1g-dev \ - libicu-dev \ - g++ -RUN pecl install xdebug-2.5.5 -RUN docker-php-ext-install pcntl posix intl json - -WORKDIR ${BUILD_ROOT_PATH} -COPY --from=build ${BUILD_ROOT_PATH} ${BUILD_ROOT_PATH} - - -# Install PHP dev dependencies -FROM build as vendor-dev - -ARG BUILD_ROOT_PATH - -WORKDIR ${BUILD_ROOT_PATH} -RUN composer install - - -# WordPress for development -FROM wordpress:5-php${PHP_TEST_VERSION}-apache as dev - -ARG PROJECT_MOUNT_PATH -ARG BUILD_ROOT_PATH -ARG DOCROOT_PATH -ARG WP_DOMAIN - -COPY docker/wp-entrypoint.sh /usr/local/bin -COPY docker/wait-for-it.sh /usr/local/bin - -RUN chmod +x /usr/local/bin/wp-entrypoint.sh /usr/local/bin/wait-for-it.sh - -RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ - && chmod +x wp-cli.phar \ - && mv wp-cli.phar /usr/local/bin/wp -RUN sed -i "s|#ServerName www.example.com|ServerName ${WP_DOMAIN}|" /etc/apache2/sites-available/*.conf -RUN sed -i "s|#ServerName www.example.com|ServerName ${WP_DOMAIN}|" /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf - - -RUN apt-get update -RUN apt-get install -y \ - zip \ - unzip \ - curl \ - # These are for extensions - zlib1g-dev \ - libicu-dev \ - g++ - -RUN docker-php-ext-install pcntl posix intl json - -RUN apt-get remove -y \ - # These are for extensions - zlib1g-dev \ - libicu-dev \ - g++ - -WORKDIR ${DOCROOT_PATH} -COPY --from=vendor-dev ${BUILD_ROOT_PATH} ${PROJECT_MOUNT_PATH} - -ENTRYPOINT ["wp-entrypoint.sh"] -CMD ["apache2-foreground"] diff --git a/docker/wait-for-it.sh b/docker/wait-for-it.sh deleted file mode 100644 index 5e8679e54..000000000 --- a/docker/wait-for-it.sh +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/env bash -# Use this script to test if a given TCP host/port are available - -WAITFORIT_cmdname=${0##*/} - -echoerr() { if [[ $WAITFORIT_QUIET -ne 1 ]]; then echo "$@" 1>&2; fi } - -usage() -{ - cat << USAGE >&2 -Usage: - $WAITFORIT_cmdname host:port [-s] [-t timeout] [-- command args] - -h HOST | --host=HOST Host or IP under test - -p PORT | --port=PORT TCP port under test - Alternatively, you specify the host and port as host:port - -s | --strict Only execute subcommand if the test succeeds - -q | --quiet Don't output any status messages - -t TIMEOUT | --timeout=TIMEOUT - Timeout in seconds, zero for no timeout - -- COMMAND ARGS Execute command with args after the test finishes -USAGE - exit 1 -} - -wait_for() -{ - if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then - echoerr "$WAITFORIT_cmdname: waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT" - else - echoerr "$WAITFORIT_cmdname: waiting for $WAITFORIT_HOST:$WAITFORIT_PORT without a timeout" - fi - WAITFORIT_start_ts=$(date +%s) - while : - do - if [[ $WAITFORIT_ISBUSY -eq 1 ]]; then - nc -z $WAITFORIT_HOST $WAITFORIT_PORT - WAITFORIT_result=$? - else - (echo > /dev/tcp/$WAITFORIT_HOST/$WAITFORIT_PORT) >/dev/null 2>&1 - WAITFORIT_result=$? - fi - if [[ $WAITFORIT_result -eq 0 ]]; then - WAITFORIT_end_ts=$(date +%s) - echoerr "$WAITFORIT_cmdname: $WAITFORIT_HOST:$WAITFORIT_PORT is available after $((WAITFORIT_end_ts - WAITFORIT_start_ts)) seconds" - break - fi - sleep 1 - done - return $WAITFORIT_result -} - -wait_for_wrapper() -{ - # In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692 - if [[ $WAITFORIT_QUIET -eq 1 ]]; then - timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --quiet --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT & - else - timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT & - fi - WAITFORIT_PID=$! - trap "kill -INT -$WAITFORIT_PID" INT - wait $WAITFORIT_PID - WAITFORIT_RESULT=$? - if [[ $WAITFORIT_RESULT -ne 0 ]]; then - echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT" - fi - return $WAITFORIT_RESULT -} - -# process arguments -while [[ $# -gt 0 ]] -do - case "$1" in - *:* ) - WAITFORIT_hostport=(${1//:/ }) - WAITFORIT_HOST=${WAITFORIT_hostport[0]} - WAITFORIT_PORT=${WAITFORIT_hostport[1]} - shift 1 - ;; - --child) - WAITFORIT_CHILD=1 - shift 1 - ;; - -q | --quiet) - WAITFORIT_QUIET=1 - shift 1 - ;; - -s | --strict) - WAITFORIT_STRICT=1 - shift 1 - ;; - -h) - WAITFORIT_HOST="$2" - if [[ $WAITFORIT_HOST == "" ]]; then break; fi - shift 2 - ;; - --host=*) - WAITFORIT_HOST="${1#*=}" - shift 1 - ;; - -p) - WAITFORIT_PORT="$2" - if [[ $WAITFORIT_PORT == "" ]]; then break; fi - shift 2 - ;; - --port=*) - WAITFORIT_PORT="${1#*=}" - shift 1 - ;; - -t) - WAITFORIT_TIMEOUT="$2" - if [[ $WAITFORIT_TIMEOUT == "" ]]; then break; fi - shift 2 - ;; - --timeout=*) - WAITFORIT_TIMEOUT="${1#*=}" - shift 1 - ;; - --) - shift - WAITFORIT_CLI=("$@") - break - ;; - --help) - usage - ;; - *) - echoerr "Unknown argument: $1" - usage - ;; - esac -done - -if [[ "$WAITFORIT_HOST" == "" || "$WAITFORIT_PORT" == "" ]]; then - echoerr "Error: you need to provide a host and port to test." - usage -fi - -WAITFORIT_TIMEOUT=${WAITFORIT_TIMEOUT:-15} -WAITFORIT_STRICT=${WAITFORIT_STRICT:-0} -WAITFORIT_CHILD=${WAITFORIT_CHILD:-0} -WAITFORIT_QUIET=${WAITFORIT_QUIET:-0} - -# Check to see if timeout is from busybox? -WAITFORIT_TIMEOUT_PATH=$(type -p timeout) -WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH) - -WAITFORIT_BUSYTIMEFLAG="" -if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then - WAITFORIT_ISBUSY=1 - # Check if busybox timeout uses -t flag - # (recent Alpine versions don't support -t anymore) - if timeout &>/dev/stdout | grep -q -e '-t '; then - WAITFORIT_BUSYTIMEFLAG="-t" - fi -else - WAITFORIT_ISBUSY=0 -fi - -if [[ $WAITFORIT_CHILD -gt 0 ]]; then - wait_for - WAITFORIT_RESULT=$? - exit $WAITFORIT_RESULT -else - if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then - wait_for_wrapper - WAITFORIT_RESULT=$? - else - wait_for - WAITFORIT_RESULT=$? - fi -fi - -if [[ $WAITFORIT_CLI != "" ]]; then - if [[ $WAITFORIT_RESULT -ne 0 && $WAITFORIT_STRICT -eq 1 ]]; then - echoerr "$WAITFORIT_cmdname: strict mode, refusing to execute subprocess" - exit $WAITFORIT_RESULT - fi - exec "${WAITFORIT_CLI[@]}" -else - exit $WAITFORIT_RESULT -fi diff --git a/docker/wp-entrypoint.sh b/docker/wp-entrypoint.sh deleted file mode 100644 index 8424383ef..000000000 --- a/docker/wp-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -e - -chown -R $(id -u):$(id -g) ./ - -if wait-for-it.sh "${WORDPRESS_DB_HOST}" -t 60; then - docker-entrypoint.sh apache2 -v - wp core install \ - --allow-root \ - --title="${WP_TITLE}" \ - --admin_user="${ADMIN_USER}" \ - --admin_password="${ADMIN_PASS}" \ - --url="${WP_DOMAIN}" \ - --admin_email="${ADMIN_EMAIL}" \ - --skip-email - wp plugin is-installed akismet --allow-root && wp plugin uninstall akismet --allow-root --path="${DOCROOT_PATH}" - wp plugin is-installed hello --allow-root && wp plugin uninstall hello --allow-root --path="${DOCROOT_PATH}" - wp plugin activate "${PLUGIN_NAME}" --allow-root --path="${DOCROOT_PATH}" - wp plugin install "woocommerce" --version="3.5.8" --activate --allow-root --path="${DOCROOT_PATH}" - - # Custom setup instructions -fi - -exec "$@" diff --git a/gulpfile.js b/gulpfile.js index 9bd9fa6d4..5a1f63410 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -217,7 +217,8 @@ function _archive({baseDir, buildDir, distDir, packageVersion, packageName}) { pump( gulp.src([ 'inc/**/*.*', - 'languages/**/*.*', + 'languages/**/*.mo', + 'languages/**/*.pot', 'pluginEnvironmentChecker/**/*.*', 'public/**/*.*', 'src/**/*.*', @@ -226,6 +227,7 @@ function _archive({baseDir, buildDir, distDir, packageVersion, packageName}) { '!node_modules/.package.lock.json', 'license.txt', 'mollie-payments-for-woocommerce.php', + 'uninstall.php', // Cleanup '!**/README', diff --git a/inc/settings/mollie_advanced_settings.php b/inc/settings/mollie_advanced_settings.php index bdf532c44..9b0339cf8 100644 --- a/inc/settings/mollie_advanced_settings.php +++ b/inc/settings/mollie_advanced_settings.php @@ -2,6 +2,7 @@ use Mollie\WooCommerce\Payment\PaymentService; use Mollie\WooCommerce\Settings\Settings; +use Mollie\WooCommerce\Shared\SharedDataDictionary; $pluginName = 'mollie-payments-for-woocommerce'; $nonce_mollie_cleanDb = wp_create_nonce('nonce_mollie_cleanDb'); @@ -9,11 +10,11 @@ ['cleanDB-mollie' => 1, 'nonce_mollie_cleanDb' => $nonce_mollie_cleanDb] ); $api_payment_description_labels = [ - '{orderNumber}' => _x( 'Order number', 'Label {orderNumber} description for payment description options', 'mollie-payments-for-woocommerce' ), - '{storeName}' => _x( 'Site Title', 'Label {storeName} description for payment description options', 'mollie-payments-for-woocommerce' ), - '{customer.firstname}' => _x( 'Customer\'s first name', 'Label {customer.firstname} description for payment description options', 'mollie-payments-for-woocommerce' ), - '{customer.lastname}' => _x( 'Customer\'s last name', 'Label {customer.lastname} description for payment description options', 'mollie-payments-for-woocommerce' ), - '{customer.company}' => _x( 'Customer\'s company name', 'Label {customer.company} description for payment description options', 'mollie-payments-for-woocommerce' ) + '{orderNumber}' => _x('Order number', 'Label {orderNumber} description for payment description options', 'mollie-payments-for-woocommerce'), + '{storeName}' => _x('Site Title', 'Label {storeName} description for payment description options', 'mollie-payments-for-woocommerce'), + '{customer.firstname}' => _x('Customer\'s first name', 'Label {customer.firstname} description for payment description options', 'mollie-payments-for-woocommerce'), + '{customer.lastname}' => _x('Customer\'s last name', 'Label {customer.lastname} description for payment description options', 'mollie-payments-for-woocommerce'), + '{customer.company}' => _x('Customer\'s company name', 'Label {customer.company} description for payment description options', 'mollie-payments-for-woocommerce'), ]; return [ @@ -35,15 +36,15 @@ 'default' => 'pending', ], [ - 'id' => $pluginName . '_' . Settings::SETTING_NAME_PAYMENT_LOCALE, + 'id' => $pluginName . '_' . SharedDataDictionary::SETTING_NAME_PAYMENT_LOCALE, 'title' => __('Payment screen language', 'mollie-payments-for-woocommerce'), 'type' => 'select', 'options' => [ - Settings::SETTING_LOCALE_WP_LANGUAGE => __( + SharedDataDictionary::SETTING_LOCALE_WP_LANGUAGE => __( 'Automatically send WordPress language', 'mollie-payments-for-woocommerce' ) . ' (' . __('default', 'mollie-payments-for-woocommerce') . ')', - Settings::SETTING_LOCALE_DETECT_BY_BROWSER => __( + SharedDataDictionary::SETTING_LOCALE_DETECT_BY_BROWSER => __( 'Detect using browser language', 'mollie-payments-for-woocommerce' ), @@ -74,7 +75,7 @@ '', '' ), - 'default' => Settings::SETTING_LOCALE_WP_LANGUAGE, + 'default' => SharedDataDictionary::SETTING_LOCALE_WP_LANGUAGE, ], [ 'id' => $pluginName . '_customer_details', @@ -101,7 +102,7 @@ 'type' => 'select', 'options' => [ PaymentService::PAYMENT_METHOD_TYPE_ORDER => ucfirst( - PaymentService::PAYMENT_METHOD_TYPE_ORDER + PaymentService::PAYMENT_METHOD_TYPE_ORDER ) . ' (' . __('default', 'mollie-payments-for-woocommerce') . ')', PaymentService::PAYMENT_METHOD_TYPE_PAYMENT => ucfirst( @@ -137,10 +138,9 @@

%3$s', - - _x( 'Available variables', 'Payment description options', 'mollie-payments-for-woocommerce' ), - implode( '', array_map( - function ($label, $label_description) { + _x('Available variables', 'Payment description options', 'mollie-payments-for-woocommerce'), + implode('', array_map( + static function ($label, $label_description) { return sprintf( '