Skip to content
Snippets Groups Projects
Select Git revision
  • 6528aa5f7f11856940f8fd131d3dbb877a14d594
  • master default protected
  • bugfix/wordpress-review
  • bugfix/prevent-error-notice
  • remove-arrow
  • feature/update-message
  • feature/minimum-plugin-version-check-demo1
  • feature/plugin-name
  • 3.7.1
  • 3.7.0
  • 3.6.3
  • 3.6.2
  • 3.6.1
  • 3.6.0
  • 3.6.0-beta3
  • 3.6.0-beta2
  • 3.6.0-beta1
  • 3.5.2
  • 3.5.1
  • 3.5.0
  • 3.4.0
  • 3.3.0
  • 3.2.8
  • 3.2.7
  • 3.2.6
  • 3.2.5
  • 3.2.4
  • 3.2.3
28 results

Basic_Requirement_Checker.php

Blame
  • Field.php 2.25 KiB
    <?php
    
    namespace WPDesk\Forms;
    
    /**
     * The idea is that from the moment the factory returns this interface it's values cannot be changed.
     * And that is why here are only the getters.
     *
     * The: Validation, Serialization, Sanitization features are provided trough delegated classes (get_validator, get_serializer ...)
     *
     * @package WPDesk\Forms
     */
    interface Field {
    	public function get_name(): string;
    
    	/** @return mixed */
    	public function get_default_value();
    
    	public function get_template_name(): string;
    
    	/** When this field is used on form this field will force it's own template. */
    	public function should_override_form_template(): bool;
    
    	/** HTML label. */
    	public function get_label(): string;
    
    	public function has_label(): bool;
    
    	public function get_description(): string;
    
    	/** Additional field description that should be shown in optional hover tip. */
    	public function get_description_tip(): string;
    
    	public function has_description_tip(): bool;
    
    	public function has_description(): bool;
    
    	public function is_readonly(): bool;
    
    	public function is_disabled(): bool;
    
    	public function get_id(): string;
    
    	public function is_required(): bool;
    
    	public function has_placeholder(): bool;
    
    	public function get_placeholder(): string;
    
    	/**
    	 * @param string[] $except
    	 *
    	 * @return string[] name->value
    	 */
    	public function get_attributes( array $except = [] ): array;
    
    	public function get_attribute( string $name, string $default = null ): string;
    
    	public function is_attribute_set( string $name ): bool;
    
    	public function get_meta_value( string $name ): string;
    
    	public function is_meta_value_set( string $name ): bool;
    
    	public function get_classes(): string;
    
    	public function has_classes(): bool;
    
    	public function is_class_set( string $name ): bool;
    
    	public function has_data(): bool;
    
    	/** @return array<string,int> */
    	public function get_data(): array;
    
    	public function add_data( string $data_name, string $data_value ): self;
    
    	public function unset_data( string $data_name ): self;
    
    	/** @return mixed */
    	public function get_possible_values();
    
    	public function is_multiple(): bool;
    
    	public function get_validator(): Validator;
    
    	public function get_sanitizer(): Sanitizer;
    
    	public function get_serializer(): Serializer;
    
    	public function get_priority(): int;
    }