Skip to content
Snippets Groups Projects
Verified Commit db3830fb authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

style: misc style fixes


Signed-off-by: default avatarBart Jaskulski <bjaskulski@protonmail.com>
parent 4af284cd
No related branches found
No related tags found
No related merge requests found
Showing
with 10 additions and 20 deletions
......@@ -45,4 +45,10 @@
<exclude name="Squiz.Commenting.ClassComment.Missing"/>
</rule>
<rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames">
<exclude-pattern>*src/Field/Traits/HtmlAttributes.php$</exclude-pattern>
<exclude-pattern>*src/Sanitizer/CallableSanitizer.php$</exclude-pattern>
<exclude-pattern>*src/Field.php$</exclude-pattern>
</rule>
</ruleset>
......@@ -26,4 +26,3 @@ interface ContainerForm {
*/
public function put_data( PersistentContainer $container );
}
......@@ -7,7 +7,7 @@ use WPDesk\Forms\Sanitizer\TextFieldSanitizer;
class DateField extends BasicField {
public function __construct() {
$this->set_placeholder('YYYY-MM-DD');
$this->set_placeholder( 'YYYY-MM-DD' );
}
public function get_type(): string {
......@@ -17,5 +17,4 @@ class DateField extends BasicField {
public function get_template_name(): string {
return 'input-text';
}
}
......@@ -7,6 +7,4 @@ class WPEditorField extends BasicField {
public function get_template_name(): string {
return 'wp-editor';
}
}
......@@ -63,4 +63,3 @@ interface Form {
*/
public function get_form_id(): string;
}
......@@ -149,7 +149,7 @@ class FormWithFields implements Form, ContainerForm, FieldProvider {
}
public function render_form( Renderer $renderer ): string {
$content = $renderer->render(
$content = $renderer->render(
'form-start',
[
'form' => $this,
......
......@@ -23,5 +23,4 @@ class DefaultFormFieldResolver implements Resolver {
public function resolve( $name, Renderer $renderer = null ): string {
return $this->dir_resolver->resolve( $name, $renderer );
}
}
......@@ -16,5 +16,4 @@ class CallableSanitizer implements Sanitizer {
public function sanitize( $value ): string {
return call_user_func( $this->callable, $value );
}
}
......@@ -9,5 +9,4 @@ class EmailSanitizer implements Sanitizer {
public function sanitize( $value ): string {
return sanitize_email( $value );
}
}
......@@ -9,5 +9,4 @@ class NoSanitize implements Sanitizer {
public function sanitize( $value ) {
return $value;
}
}
......@@ -9,9 +9,8 @@ class TextFieldSanitizer implements Sanitizer {
/** @return string|string[] */
public function sanitize( $value ) {
if ( is_array( $value ) ) {
return array_map('sanitize_text_field', $value);
return array_map( 'sanitize_text_field', $value );
}
return sanitize_text_field( $value );
}
}
......@@ -29,5 +29,4 @@ class ProductSelectSerializer implements Serializer {
public function unserialize( string $value ) {
return $value;
}
}
<?php
// phpcs:disable WordPress.PHP.DiscouragedPHPFunctions
namespace WPDesk\Forms\Serializer;
......@@ -13,5 +14,4 @@ class SerializeSerializer implements Serializer {
public function unserialize( string $value ) {
return unserialize( $value );
}
}
......@@ -45,5 +45,4 @@ class ChainValidator implements Validator {
public function get_messages(): array {
return $this->messages;
}
}
......@@ -13,5 +13,4 @@ class NoValidateValidator implements Validator {
public function get_messages(): array {
return [];
}
}
......@@ -21,5 +21,4 @@ class NonceValidator implements Validator {
public function get_messages(): array {
return [];
}
}
......@@ -13,5 +13,4 @@ class RequiredValidator implements Validator {
public function get_messages(): array {
return [];
}
}
......@@ -22,4 +22,3 @@ $editor_settings = wp_parse_args( $field->get_attributes(), $default_settings )
$editor_id = uniqid( 'wyswig_' );
wp_editor( wp_kses_post( $value ), $editor_id, $editor_settings );
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment