Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Aug 5, 2021
2 parents 0e54c1e + 9d235bf commit 70b8ce1
Show file tree
Hide file tree
Showing 20 changed files with 537 additions and 307 deletions.
35 changes: 23 additions & 12 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run

coverage:
tests:
override:
- command: ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
coverage:
file: build/logs/clover.xml
format: clover

environment:
php: 7.3.0
variables:
WP_TESTS_DB_NAME: 'wp_phpunit_tests'
WP_TESTS_DB_USER: 'root'
WP_TESTS_DB_PASS: ''
WP_TESTS_DB_HOST: 'localhost'
project_setup:
before:
- mysql -e "CREATE DATABASE wp_phpunit_tests"
WP_TESTS_DB_HOST: '127.0.0.1'

services:
mysql: 5.7

dependencies:
override:
- composer install --ignore-platform-reqs --no-interaction
nodes:
coverage:
tests:
override:
- command: ./vendor/bin/phpunit
coverage:
file: build/logs/clover.xml
format: clover

project_setup:
before:
- mysql -e "CREATE DATABASE wp_phpunit_tests"

filter:
excluded_paths:
Expand Down
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ install:
- composer self-update
# Install Composer packages.
- composer install
# PHPStan
- if [ "$PHPSTAN" == "1" ]; then composer bin phpstan install; fi
# Psalm
- if [ "$PSALM" == "1" ]; then composer bin psalm install; fi
# Test on specific WordPress version.
- composer require --dev --update-with-dependencies roots/wordpress:${WP_VERSION} wp-phpunit/wp-phpunit:${WP_VERSION}
# List available packages.
Expand All @@ -89,9 +93,9 @@ script:
# PHP Mess Detector
- if [ "$PHPMD" == "1" ]; then composer run-script phpmd; fi
# PHPStan
- if [ "$PHPSTAN" == "1" ]; then phpstan analyze; fi
- if [ "$PHPSTAN" == "1" ]; then composer run-script phpstan; fi
# Psalm
- if [ "$PSALM" == "1" ]; then psalm; fi
- if [ "$PSALM" == "1" ]; then composer run-script psalm; fi

after_success:
- if [ "$COVERAGE" == "1" ]; then composer run-script coveralls; fi
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## [Unreleased][unreleased]
-

## [3.0.0] - 2021-08-05
- Updated to `pronamic/wp-pay-core` version `3.0.0`.
- Updated to `pronamic/wp-money` version `2.0.0`.
- Changed `TaxedMoney` to `Money`, no tax info.
- Switched to `pronamic/wp-coding-standards`.

## [2.3.2] - 2021-01-19
- Fixed using unknown classes.

Expand Down Expand Up @@ -50,7 +56,8 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## 1.0.0 - 2015-01-20
- First release.

[unreleased]: https://github.com/wp-pay-extensions/event-espresso-legacy/compare/2.3.2...HEAD
[unreleased]: https://github.com/wp-pay-extensions/event-espresso-legacy/compare/3.0.0...HEAD
[3.0.0]: https://github.com/wp-pay-extensions/event-espresso-legacy/compare/2.3.1...3.0.0
[2.3.2]: https://github.com/wp-pay-extensions/event-espresso-legacy/compare/2.3.1...2.3.2
[2.3.1]: https://github.com/wp-pay-extensions/event-espresso-legacy/compare/2.3.0...2.3.1
[2.3.0]: https://github.com/wp-pay-extensions/event-espresso-legacy/compare/2.2.1...2.3.0
Expand Down
16 changes: 6 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,21 @@
},
"require": {
"php": ">=5.6.20",
"wp-pay/core": "^2.4"
"wp-pay/core": "^3.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"php-coveralls/php-coveralls": "^2.1",
"phpcompatibility/php-compatibility": "^9.1",
"phpcompatibility/phpcompatibility-wp": "^2.0",
"php-coveralls/php-coveralls": "^2.4",
"phpmd/phpmd": "^2.7",
"phpunit/phpunit": "^5.7 || ^6.0",
"roots/wordpress": "^5.6",
"squizlabs/php_codesniffer": "^3.4",
"wp-coding-standards/wpcs": "^2.3",
"wp-phpunit/wp-phpunit": "^5.6"
"pronamic/wp-coding-standards": "^1.0",
"roots/wordpress": "^5.8",
"wp-phpunit/wp-phpunit": "^5.8"
},
"scripts": {
"coveralls": "vendor/bin/php-coveralls -v",
"phpcbf": "vendor/bin/phpcbf",
"phpcs": "vendor/bin/phpcs -s -v",
"phpcs": "XDEBUG_MODE=off vendor/bin/phpcs -s -v",
"phplint": "find src tests -name '*.php' | xargs -n 1 -P 4 php -l",
"phpmd": "vendor/bin/phpmd src,tests text phpmd.ruleset.xml --suffixes php",
"phpstan": "vendor/bin/phpstan analyse",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "event-espresso-legacy",
"version": "2.3.2",
"version": "3.0.0",
"description": "Event Espresso (legacy 3.1) driver for the WordPress payment processing library",
"repository": {
"type": "git",
Expand Down
25 changes: 5 additions & 20 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
<?xml version="1.0"?>

<ruleset name="WordPress Pay Event Espresso legacy rules">
<config name="minimum_supported_wp_version" value="4.7" />

<config name="testVersion" value="5.6-" />

<file>.</file>

<arg name="colors"/>
<arg name="extensions" value="php" />
<arg value="sp" />

<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
<exclude-pattern>tests/wp-config.php</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>wordpress/*</exclude-pattern>
<exclude-pattern type="relative">^wp-content/*</exclude-pattern>

<rule ref="PHPCompatibilityWP" />

<rule ref="WordPress">
<exclude name="Generic.Files.LowercasedFilename.NotFound" />

<rule ref="PronamicWP">
<exclude name="Squiz.Commenting" />

<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />

<exclude name="WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize" />

<exclude name="WordPress.Security.NonceVerification.Recommended" />
Expand All @@ -36,6 +17,10 @@
<exclude name="WordPress.VIP.FileSystemWritesDisallow.FileWriteDetected" />
<exclude name="WordPress.VIP.RestrictedFunctions.wp_redirect_wp_redirect" />
<exclude name="WordPress.VIP.SuperGlobalInputUsage.AccessDetected" />

<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_touch" />

<exclude name="WordPressVIPMinimum.Hooks.AlwaysReturnInFilter.MissingReturnStatement" />
</rule>

<rule ref="WordPress.Security.NonceVerification.NoNonceVerification">
Expand Down
6 changes: 4 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
includes:
- vendor-bin/phpstan/vendor/szepeviktor/phpstan-wordpress/extension.neon
parameters:
customRulesetUsed: false
level: max
bootstrapFiles:
- tests/bootstrap.php
- tests/phpstan/bootstrap.php
paths:
- src
- src/
4 changes: 0 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
</whitelist>
</filter>

<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>

<php>
<env name="WP_PHPUNIT__TESTS_CONFIG" value="tests/wp-config.php"/>
</php>
Expand Down
1 change: 0 additions & 1 deletion psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<MissingReturnType errorLevel="info" />
<MissingPropertyType errorLevel="info" />
<InvalidDocblock errorLevel="info" />
<MisplacedRequiredParam errorLevel="info" />

<PropertyNotSetInConstructor errorLevel="info" />
<MissingConstructor errorLevel="info" />
Expand Down
2 changes: 1 addition & 1 deletion src/EventEspresso.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Title: Event Espresso
* Description:
* Copyright: 2005-2020 Pronamic
* Copyright: 2005-2021 Pronamic
* Company: Pronamic
*
* @author Remco Tolsma
Expand Down
2 changes: 1 addition & 1 deletion src/EventEspressoDependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Event Espresso Dependency
*
* @author Pronamic <[email protected]>
* @copyright 2005-2020 Pronamic
* @copyright 2005-2021 Pronamic
* @license GPL-3.0-or-later
* @package Pronamic\WordPress\Pay\Extensions\EventEspressoLegacy
*/
Expand Down
2 changes: 1 addition & 1 deletion src/EventEspressoHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Event Espresso Helper
*
* @author Pronamic <[email protected]>
* @copyright 2005-2020 Pronamic
* @copyright 2005-2021 Pronamic
* @license GPL-3.0-or-later
* @package Pronamic\WordPress\Pay\Extensions\EventEspressoLegacy
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Pronamic\WordPress\Pay\Extensions\EventEspressoLegacy;

use Pronamic\WordPress\Money\Currency;
use Pronamic\WordPress\Money\TaxedMoney;
use Pronamic\WordPress\Money\Money;
use Pronamic\WordPress\Pay\AbstractPluginIntegration;
use Pronamic\WordPress\Pay\Admin\AdminModule;
use Pronamic\WordPress\Pay\Core\PaymentMethods;
Expand All @@ -14,7 +14,7 @@
/**
* Title: WordPress pay Event Espresso legacy extension
* Description:
* Copyright: 2005-2020 Pronamic
* Copyright: 2005-2021 Pronamic
* Company: Pronamic
*
* @author Remco Tolsma
Expand Down Expand Up @@ -140,7 +140,7 @@ public static function process_gateway() {
$currency = Currency::get_instance( 'EUR' );

// Amount.
$payment->set_total_amount( new TaxedMoney( $data['total_cost'], $currency ) );
$payment->set_total_amount( new Money( $data['total_cost'], $currency ) );

// Configuration.
$payment->config_id = $config_id;
Expand Down Expand Up @@ -187,7 +187,7 @@ public static function display_gateway( $payment_data ) {
</h3>

<div class="event_espresso_form_wrapper">
<form method="post" action="<?php echo esc_attr( EventEspressoHelper::get_notify_url( $payment_data ) ); ?>">
<form method="post" action="<?php echo \esc_url( EventEspressoHelper::get_notify_url( $payment_data ) ); ?>">
<?php

// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Bootstrap tests
*
* @author Pronamic <[email protected]>
* @copyright 2005-2020 Pronamic
* @copyright 2005-2021 Pronamic
* @license GPL-3.0-or-later
* @package Pronamic\WordPress\Pay\Extensions\EventEspressoLegacy
*/
Expand Down
11 changes: 11 additions & 0 deletions tests/phpstan/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* Definitions for PHPStan.
*
* @author Pronamic <[email protected]>
* @copyright 2005-2021 Pronamic
* @license GPL-3.0-or-later
* @package Pronamic\WordPress\Pay
*/

define( 'SCRIPT_DEBUG', true );
2 changes: 1 addition & 1 deletion tests/src/EventEspressoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Title: WordPress pay AppThemes test
* Description:
* Copyright: 2005-2020 Pronamic
* Copyright: 2005-2021 Pronamic
* Company: Pronamic
*
* @author Reüel van der Steege
Expand Down
7 changes: 4 additions & 3 deletions vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"require-dev": {
"phpstan/phpstan": "^0.12.17"
}
"require-dev": {
"phpstan/phpstan": "^0.12",
"szepeviktor/phpstan-wordpress": "^0.7"
}
}
Loading

0 comments on commit 70b8ce1

Please sign in to comment.