Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SP-699 WooCommerce 5.1.0 - svn pre-commit hook failed #53

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Install Composer Dependencies
run: composer install --dev
- name: Run WordPress code standard
run: |
./vendorPrefixed/vendor/bin/phpcs -v --ignore=vendor,vendorPrefixed,wpcs,scoper.inc.php --standard=./phpcs.xml ./
2 changes: 1 addition & 1 deletion BitPayLib/class-bitpayclientfactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ private function get_environment(): string {
return Env::PROD;
}

throw new \RuntimeException( 'Wrong environment ' . $environment );
throw new \RuntimeException( 'Wrong environment ' . esc_html( $environment ) );
}
}
4 changes: 2 additions & 2 deletions BitPayLib/class-bitpayipnprocess.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private function validate_bitpay_status_in_available_statuses( Invoice $bitpay_i
if ( ! in_array( $status, $available_statuses, true ) ) {
$message = 'Wrong BitPay status. Status: ' . $status . ' available statuses: '
. print_r( $available_statuses, true ); // phpcs:ignore
throw new \RuntimeException( $message );
throw new \RuntimeException( esc_html( $message ) );
}
}

Expand All @@ -136,7 +136,7 @@ private function get_bitpay_dashboard_link( string $invoice_id ): string {
return '//test.bitpay.com/dashboard/payments/' . $invoice_id;
}

throw new \RuntimeException( 'Wrong BitPay Environment ' . $env );
throw new \RuntimeException( 'Wrong BitPay Environment ' . esc_html( $env ) );
}

private function process_confirmed( Invoice $bitpay_invoice, WC_Order $order ): void {
Expand Down
2 changes: 1 addition & 1 deletion BitPayLib/class-bitpaylogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function execute( $msg, string $type, bool $is_array = false, $error = fa
$log_directory = plugin_dir_path( __FILE__ ) . '..' . DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . 'logs/';
if ( ! file_exists( $log_directory ) && ! mkdir( $log_directory ) && ! is_dir( $log_directory ) ) {
throw new \RuntimeException( sprintf( 'Directory "%s" was not created', $log_directory ) );
throw new \RuntimeException( sprintf( 'Directory "%s" was not created', esc_html( $log_directory ) ) );
}

$transaction_log = $log_directory . date( 'Ymd' ) . '_transactions.log'; // phpcs:ignore
Expand Down
2 changes: 1 addition & 1 deletion BitPayLib/class-wcgatewaybitpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ private function get_processing_link(): string {

$test = 'https://test.bitpay.com/dashboard/settings/edit/order';

return match ($bitpay_checkout_endpoint) {
return match ( $bitpay_checkout_endpoint ) {
'production' => 'https://www.bitpay.com/dashboard/settings/edit/order',
default => $test
};
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
],
"require": {
"php": "^8",
"bitpay/sdk": "^8.0.0",
"humbug/php-scoper": "^0.18.3"
"bitpay/sdk": "^8.0.0"
},
"require-dev": {
"wp-coding-standards/wpcs": "dev-develop"
Expand All @@ -20,7 +19,7 @@
},
"scripts": {
"add-prefix": [
"php ./vendor/bin/php-scoper add-prefix --force --quiet",
"php php-scoper.phar add-prefix --force --quiet",
"composer dump-autoload --working-dir vendorPrefixed"
],
"dump-prefixed-vendor": "composer dump-autoload --working-dir vendorPrefixed --classmap-authoritative",
Expand Down
Loading