Skip to content

Commit 8f624ab

Browse files
committed
Do not use heredoc/nowdoc (PCP requirement).
1 parent 952a416 commit 8f624ab

File tree

46 files changed

+181
-126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+181
-126
lines changed

.tests/php/integration/AAAMainTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ static function ( $name ) {
869869

870870
$hcaptcha->form_shown = true;
871871

872-
$expected_scripts = <<<JS
872+
$expected_scripts = "
873873
( () => {
874874
'use strict';
875875
@@ -925,9 +925,9 @@ function scrollHandler() {
925925
window.addEventListener( 'scroll', scrollHandler );
926926
} );
927927
} )();
928-
JS;
928+
";
929929

930-
$expected_scripts = "<script>\n$expected_scripts\n</script>\n";
930+
$expected_scripts = "<script>$expected_scripts</script>\n";
931931

932932
$site_key = 'some site key';
933933
$secret_key = 'some secret key';

.tests/php/integration/Jetpack/BaseTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,15 @@ public function test_error_message(): void {
142142
$this->set_protected_property( $subject, 'error_message', $error_message );
143143
$this->set_protected_property( $subject, 'error_form_hash', $error_form_hash );
144144

145-
$expected = $hcaptcha_content . '<div class="contact-form__input-error">
145+
$expected = $hcaptcha_content . '
146+
<div class="contact-form__input-error">
146147
<span class="contact-form__warning-icon">
147148
<span class="visually-hidden">Warning.</span>
148149
<i aria-hidden="true"></i>
149150
</span>
150151
<span>' . $error_message . '</span>
151-
</div>';
152+
</div>
153+
';
152154

153155
self::assertSame( $expected, $subject->error_message( $hcaptcha_content ) );
154156

.tests/php/integration/WPForms/FormTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public function test_wpforms_settings_fields(): void {
296296

297297
$general_page_url = esc_url( admin_url( 'options-general.php?page=hcaptcha&tab=general' ) );
298298

299-
$notice_content = <<<HTML
299+
$notice_content = '
300300
<div
301301
id="wpforms-setting-row-hcaptcha-heading"
302302
class="wpforms-setting-row wpforms-setting-row-content wpforms-clear section-heading specific-note">
@@ -309,12 +309,12 @@ class="wpforms-setting-row wpforms-setting-row-content wpforms-clear section-hea
309309
</div>
310310
<div class="wpforms-specific-note-content">
311311
<p><strong>hCaptcha plugin is active</strong></p>
312-
<p>When hCaptcha plugin is active and integration is on, hCaptcha settings must be modified on the <a href="$general_page_url" target="_blank">General settings page</a>.</p>
312+
<p>When hCaptcha plugin is active and integration is on, hCaptcha settings must be modified on the <a href="' . $general_page_url . '" target="_blank">General settings page</a>.</p>
313313
</div>
314314
</div>
315315
</span>
316316
</div>
317-
HTML;
317+
';
318318

319319
$hcap_form = $this->get_hcap_form();
320320
$expected = [

.tests/php/integration/Wordfence/GeneralTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ static function ( $name ) {
154154
);
155155

156156
$expected = <<<CSS
157-
#loginform[style="position: relative;"] > .h-captcha {
158-
visibility: hidden !important;
159-
}
157+
#loginform[style="position: relative;"] > .h-captcha {
158+
visibility: hidden !important;
159+
}
160160
CSS;
161161
$expected = "<style>\n$expected\n</style>\n";
162162

.tests/php/unit/MainTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ class MainTest extends HCaptchaTestCase {
2222
* Test declare_wc_compatibility().
2323
*
2424
* @return void
25-
* @noinspection UnusedFunctionResultInspection
2625
*/
2726
public function test_declare_wc_compatibility(): void {
2827
$mock = Mockery::mock( 'alias:Automattic\WooCommerce\Utilities\FeaturesUtil' );
2928
$mock->shouldReceive( 'declare_compatibility' )
30-
->with( 'custom_order_tables', HCAPTCHA_TEST_FILE, true )
29+
->with( 'custom_order_tables', HCAPTCHA_TEST_FILE )
3130
->andReturn( true );
3231

3332
FunctionMocker::replace(

src/php/Affiliates/Login.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ public function add_affiliates_captcha( $content, array $args ): string {
5656
* @noinspection CssUnusedSymbol
5757
*/
5858
public function print_inline_styles(): void {
59-
$css = <<<CSS
59+
/* language=CSS */
60+
$css = '
6061
.affiliates-dashboard .h-captcha {
6162
margin-top: 2rem;
6263
}
63-
CSS;
64+
';
6465

6566
HCaptcha::css_display( $css );
6667
}

src/php/Asgaros/Base.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public function verify( $verified ) {
103103
* @noinspection CssUnusedSymbol
104104
*/
105105
public function print_inline_styles(): void {
106-
$css = <<<CSS
106+
/* language=CSS */
107+
$css = '
107108
#af-wrapper div.editor-row.editor-row-hcaptcha {
108109
display: flex;
109110
flex-direction: row-reverse;
@@ -112,7 +113,7 @@ public function print_inline_styles(): void {
112113
#af-wrapper div.editor-row.editor-row-hcaptcha .h-captcha {
113114
margin-bottom: 0;
114115
}
115-
CSS;
116+
';
116117

117118
HCaptcha::css_display( $css );
118119
}

src/php/Brizy/Base.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,12 @@ public function print_inline_styles(): void {
131131

132132
$style_shown = true;
133133

134-
$css = <<<CSS
134+
/* language=CSS */
135+
$css = '
135136
.brz-forms2.brz-forms2__item .h-captcha {
136137
margin-bottom: 0;
137138
}
138-
CSS;
139+
';
139140

140141
HCaptcha::css_display( $css );
141142
}

src/php/BuddyPress/CreateGroup.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ public function verify( $bp_group ): bool {
9999
* @noinspection CssUnusedSymbol
100100
*/
101101
public function print_inline_styles(): void {
102-
$css = <<<'CSS'
102+
/* language=CSS */
103+
$css = '
103104
#buddypress .h-captcha {
104105
margin-top: 15px;
105106
}
106-
CSS;
107+
';
107108
HCaptcha::css_display( $css );
108109
}
109110
}

src/php/CF7/CF7.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ public function enqueue_scripts(): void {
291291
* @noinspection CssUnusedSymbol
292292
*/
293293
public function print_inline_styles(): void {
294-
$css = <<<CSS
294+
/* language=CSS */
295+
$css = '
295296
span[data-name="hcap-cf7"] .h-captcha {
296297
margin-bottom: 0;
297298
}
@@ -300,7 +301,7 @@ public function print_inline_styles(): void {
300301
span[data-name="hcap-cf7"] ~ button[type="submit"] {
301302
margin-top: 2rem;
302303
}
303-
CSS;
304+
';
304305

305306
HCaptcha::css_display( $css );
306307
}

0 commit comments

Comments
 (0)