<commit_before><?php

namespace Oxygen\Core\Html\Form;

use Oxygen\Core\Action\Action;
use Oxygen\Core\Html\RenderableInterface;
use Oxygen\Core\Html\RenderableTrait;
use Oxygen\Core\Http\Method;

class Form implements RenderableInterface {

    use RenderableTrait;

    /**
     * An array of form rows
     *
     * @var array
     */
    protected $content;

    /**
     * The action for the form.
     *
     * @var Action
     */
    protected $action;

    /**
     * Should be true if the form facilitates file uploads
     *
     * @var bool
     */
    protected $useMultiPartFormData;

    /**
     * Should the form be submitted with AJAX?
     *
     * @var bool
     */
    protected $asynchronous;

    /**
     * Should the user be warned before changing page with the form unsaved?
     *
     * @var bool
     */
    protected $warnBeforeExit;

    /**
     * Should the form be submitted when the 'save' shortcut is invoked?
     *
     * @var bool
     */
    protected $submitOnShortcutKey;

    /**
     * Custom classes to add to the form.
     *
     * @var array
     */
    protected $extraClasses;

    /**
     * The arguments that will be passed to $action->getRouteParameters() later on
     *
     * @var array
     */
    protected $routeParameters;

    /**
     * Constructs the Form instance
     *
     * @param \Oxygen\Core\Action\Action $action         the Oxygen action
     */
    public function __construct(Action $action) {
        $this->action = $action;
        $this->routeParameters = [];
    }

    /**
     * Sets the arguments that will be passed to $action->getRouteParameters() later on
     *
     * @param $arguments
     */
    public function setRouteParameters($arguments) {
        $this->routeParameters = $arguments;
    }

    /**
     * @return array
     */
    public function getRouteParameters() {
        return $this->routeParameters;
    }

    /**
     * Adds a single row to the form.
     *
     * @param \Oxygen\Core\Html\RenderableInterface|string $row
     * @return $this
     */
    public function addContent($row) {
        $this->content[] = $row;
        return $this;
    }

    /**
     * Returns the action of the form.
     *
     * @return Action
     */
    public function getAction() {
        return $this->action;
    }

    /**
     * @return boolean
     */
    public function useMultiPartFormData() {
        return $this->useMultiPartFormData;
    }

    /**
     * @param boolean $useMultiPartFormData
     * @return $this
     */
    public function setUseMultiPartFormData($useMultiPartFormData) {
        $this->useMultiPartFormData = $useMultiPartFormData;
        return $this;
    }

    /**
     * @return boolean
     */
    public function isAsynchronous() {
        return $this->asynchronous;
    }<commit_msg>Added getRows method to form<commit_after><?php

namespace Oxygen\Core\Html\Form;

use Oxygen\Core\Action\Action;
use Oxygen\Core\Html\RenderableInterface;
use Oxygen\Core\Html\RenderableTrait;
use Oxygen\Core\Http\Method;

class Form implements RenderableInterface {

    use RenderableTrait;

    /**
     * An array of form rows
     *
     * @var array
     */
    protected $content;

    /**
     * The action for the form.
     *
     * @var Action
     */
    protected $action;

    /**
     * Should be true if the form facilitates file uploads
     *
     * @var bool
     */
    protected $useMultiPartFormData;

    /**
     * Should the form be submitted with AJAX?
     *
     * @var bool
     */
    protected $asynchronous;

    /**
     * Should the user be warned before changing page with the form unsaved?
     *
     * @var bool
     */
    protected $warnBeforeExit;

    /**
     * Should the form be submitted when the 'save' shortcut is invoked?
     *
     * @var bool
     */
    protected $submitOnShortcutKey;

    /**
     * Custom classes to add to the form.
     *
     * @var array
     */
    protected $extraClasses;

    /**
     * The arguments that will be passed to $action->getRouteParameters() later on
     *
     * @var array
     */
    protected $routeParameters;

    /**
     * Constructs the Form instance
     *
     * @param \Oxygen\Core\Action\Action $action         the Oxygen action
     */
    public function __construct(Action $action) {
        $this->action = $action;
        $this->routeParameters = [];
    }

    /**
     * Sets the arguments that will be passed to $action->getRouteParameters() later on
     *
     * @param $arguments
     */
    public function setRouteParameters($arguments) {
        $this->routeParameters = $arguments;
    }

    /**
     * @return array
     */
    public function getRouteParameters() {
        return $this->routeParameters;
    }

    /**
     * Adds a single row to the form.
     *
     * @param \Oxygen\Core\Html\RenderableInterface|string $row
     * @return $this
     */
    public function addContent($row) {
        $this->content[] = $row;
        return $this;
    }

    /**
     * Returns all the rows in the form.
     *
     * @return array
     */
    public function getRows() {
        return $this->content;
    }

    /**
     * Returns the action of the form.
     *
     * @return Action
     */
    public function getAction() {
        return $this->action;
    }

    /**
     * @return boolean
     */
    public function useMultiPartFormData() {
        return $this->useMultiPartFormData;
    }

    /**
     * @param boolean $useMultiPartFormData
     * @return $this
     */
    public function setUseMultiPartFormData($useMultiPartFormData) {
        $this->useMultiPartFormData = $useMultiPartFormData;
        return $this;
    }

    /**
     * @return boolean
     */
    public function isAsynchronous() {
        return $this->asynchronous;
    }
{'fraction_non_alphanumeric': 0.10843373493975904, 'fraction_numerical': 0.0, 'mean_word_length': 1.9452610238215915, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '477081', 'n_tokens_mistral': 1708, 'n_tokens_neox': 1669, 'n_words': 448}