<commit_before><?php
namespace WFV;
defined( 'ABSPATH' ) || die();

use WFV\Abstraction\Composable;
use WFV\Contract\ArtisanInterface;
use WFV\Contract\ValidateInterface;

/**
 * Form Composition
 *
 * @since 0.10.0
 */
class FormComposite extends Composable {

	/**
	 *
	 *
	 * @since 0.11.0
	 * @access protected
	 * @var Validator
	 */
	protected $validator;

	/**
	 *
	 *
	 * @since 0.10.0
	 *
	 * @param ArtisanInterface $builder
	 * @param string $action
	 */
	public function __construct( ArtisanInterface $builder, $action ) {
		$this->alias = $action;
		$this->install( $builder->collection );
		$this->validator = $builder->validator;
	}

	/**
	 * Convenience method to repopulate checkbox input
	 *
	 * @since 0.10.0
	 *
	 * @param string $field Field name.
	 * @param string $value Value to compare against.
	 * @return string|null
	 */
	public function checked_if( $field = null, $value = null ) {
		return $this->string_or_null( 'checked', $field, $value );
	}

	/**
	 * Echo the encoded value of given field from a callback
	 * Default callback is esc_html()<commit_msg>FormComposite - change type hint on construct<commit_after><?php
namespace WFV;
defined( 'ABSPATH' ) || die();

use WFV\Abstraction\Composable;
use WFV\Artisan\FormArtisan;
use WFV\Contract\ValidateInterface;

/**
 * Form Composition
 *
 * @since 0.10.0
 */
class FormComposite extends Composable {

	/**
	 *
	 *
	 * @since 0.11.0
	 * @access protected
	 * @var Validator
	 */
	protected $validator;

	/**
	 *
	 *
	 * @since 0.10.0
	 *
	 * @param ArtisanInterface $builder
	 * @param string $action
	 */
	public function __construct( FormArtisan $builder, $action ) {
		$this->alias = $action;
		$this->install( $builder->collection );
		$this->validator = $builder->validator;
	}

	/**
	 * Convenience method to repopulate checkbox input
	 *
	 * @since 0.10.0
	 *
	 * @param string $field Field name.
	 * @param string $value Value to compare against.
	 * @return string|null
	 */
	public function checked_if( $field = null, $value = null ) {
		return $this->string_or_null( 'checked', $field, $value );
	}

	/**
	 * Echo the encoded value of given field from a callback
	 * Default callback is esc_html()
{'fraction_non_alphanumeric': 0.13920584208124145, 'fraction_numerical': 0.01460520310360566, 'mean_word_length': 3.384, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5178378', 'n_tokens_mistral': 786, 'n_tokens_neox': 701, 'n_words': 196}