Skip to content

Commit d10dc18

Browse files
committed
Fix phpcs errors after wpcs update
1 parent 8ef0e0c commit d10dc18

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

classes/class-cpt-wplf-form.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static function init() {
1818
/**
1919
* Hook our actions, filters and such
2020
*/
21-
private function __construct() {
21+
public function __construct() {
2222
// init custom post type
2323
add_action( 'init', array( $this, 'register_cpt' ) );
2424

@@ -385,7 +385,7 @@ function meta_box_title_format( $post ) {
385385
$format = isset( $meta['_wplf_title_format'] ) ? $meta['_wplf_title_format'][0] : $default;
386386
?>
387387
<p><?php esc_html_e( 'Submissions from this form will use this formatting in their title.', 'wp-libre-form' ); ?></p>
388-
<p><?php esc_html_e( 'You may use any field values enclosed in "%" markers.', 'wp-libre-form' );?></p>
388+
<p><?php esc_html_e( 'You may use any field values enclosed in "%" markers.', 'wp-libre-form' ); ?></p>
389389
<p>
390390
<input
391391
type="text"
@@ -540,10 +540,10 @@ class="libre-form libre-form-<?php echo esc_attr( $id . ' ' . $xclass ); ?>"
540540
?>
541541
<p style="background:#f5f5f5;border-left:4px solid #dc3232;padding:6px 12px;">
542542
<strong style="color:#dc3232;">
543-
<?php esc_html_e( 'This form preview URL is not public and cannot be shared.', 'wp-libre-form' ) ?>
543+
<?php esc_html_e( 'This form preview URL is not public and cannot be shared.', 'wp-libre-form' ); ?>
544544
</strong>
545545
<br />
546-
<?php esc_html_e( 'Non-logged in visitors will see a 404 error page instead.', 'wp-libre-form' ) ?>
546+
<?php esc_html_e( 'Non-logged in visitors will see a 404 error page instead.', 'wp-libre-form' ); ?>
547547
</p>
548548
<?php endif; ?>
549549
<?php endif; ?>
@@ -554,7 +554,7 @@ class="libre-form libre-form-<?php echo esc_attr( $id . ' ' . $xclass ); ?>"
554554
// @codingStandardsIgnoreEnd
555555
?>
556556
<input type="hidden" name="referrer" value="<?php the_permalink(); ?>">
557-
<input type="hidden" name="_referrer_id" value="<?php echo esc_attr( get_the_id() ) ?>">
557+
<input type="hidden" name="_referrer_id" value="<?php echo esc_attr( get_the_id() ); ?>">
558558
<input type="hidden" name="_form_id" value="<?php echo esc_attr( $id ); ?>">
559559
</form>
560560
<?php

classes/class-cpt-wplf-submission.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static function init() {
1818
/**
1919
* Hook our actions, filters and such
2020
*/
21-
private function __construct() {
21+
public function __construct() {
2222
// init custom post type
2323
add_action( 'init', array( $this, 'register_cpt' ) );
2424

classes/class-wplf-polylang.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static function init() {
1818
/**
1919
* Hook our actions, filters and such
2020
*/
21-
private function __construct() {
21+
public function __construct() {
2222
add_filter( 'wplf_form', array( $this, 'render_form' ) );
2323
add_filter( 'save_post_wplf-form', array( $this, 'save_form' ), 10, 3 );
2424
add_action( 'after_setup_theme', array( $this, 'register_strings' ) );

phpcs.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@
100100
-->
101101
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
102102

103+
<!-- <?php doesn't have to be on its own line -->
104+
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd" />
105+
<exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterOpen" />
106+
107+
<!-- Squiz.PHP.EmbeddedPhp.ContentBeforeEnd -->
108+
<exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed" />
109+
103110
<!-- These indentation rules are just wrong :) -->
104111
<exclude name="PEAR.Functions.FunctionCallSignature.Indent" />
105112

@@ -118,5 +125,8 @@
118125
<!-- This would be nice to enforce, but plugin main file shouldn't be called class-something -->
119126
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
120127

128+
<!-- This one is just weird. -->
129+
<exclude name="WordPress.Arrays.ArrayIndentation" />
130+
121131
</rule>
122132
</ruleset>

0 commit comments

Comments
 (0)