src/Post.php
private function setValue($item) : void
    {
        if (is_string($item)) {
            return;
        }
        $element = $item->getElement();
        $name = $element->name();
        if ($element instanceof File) {
            if (array_key_exists($name, $_FILES)) {
                $element->setValue($_FILES[$name]);
                $element->valueSuppliedByUser(true);
            }
        } elseif (array_key_exists($name, $_POST)) {
            if ($element instanceof Radio) {
                if ($_POST[$name] == $element->getValue()
                    || (is_array($_POST[$name])
                        && in_array($element->getValue(), $_POST[$name])
                    )
                ) {
                    $element->check();
                } else {
                    $element->check(false);
                }
            } else {
                $element->setValue($_POST[$name]);
            }
            $element->valueSuppliedByUser(true);
        } elseif ($element instanceof Radio) {
            $element->check(false);
        }
    }
private function setValue($item) : void
    {
        if (is_string($item)) {
            return;
        }
        $element = $item->getElement();
        $name = $element->name();
        if ($element instanceof File) {
            if (array_key_exists($name, $_FILES)) {
                $element->setValue($_FILES[$name]);
                $element->valueSuppliedByUser(true);
            }
        } elseif (array_key_exists($name, $_POST)) {
            if ($element instanceof Radio) {
                if ($_POST[$name] == $element->getValue()
                    || (is_array($_POST[$name])
                        && in_array($element->getValue(), $_POST[$name])
                    )
                ) {
                    $element->check();
                } else {
                    $element->check(false);
                }
            } else {
                $element->setValue($_POST[$name]);
            }
            $element->valueSuppliedByUser(true);
        } elseif ($element instanceof Radio) {
            $element->check(false);
        }
    }
private function setValue ( $ item ) : void { if ( is_string ( $ item ) ) { return ; } $ element = $ item -> getElement ( ) ; $ name = $ element -> name ( ) ; if ( $ element instanceof File ) { if ( array_key_exists ( $ name , $ _FILES ) ) { $ element -> setValue ( $ _FILES [ $ name ] ) ; $ element -> valueSuppliedByUser ( true ) ; } } elseif ( array_key_exists ( $ name , $ _POST ) ) { if ( $ element instanceof Radio ) { if ( $ _POST [ $ name ] == $ element -> getValue ( ) || ( is_array ( $ _POST [ $ name ] ) && in_array ( $ element -> getValue ( ) , $ _POST [ $ name ] ) ) ) { $ element -> check ( ) ; } else { $ element -> check ( false ) ; } } else { $ element -> setValue ( $ _POST [ $ name ] ) ; } $ element -> valueSuppliedByUser ( true ) ; } elseif ( $ element instanceof Radio ) { $ element -> check ( false ) ; } }
Internal helper method to set the value of whatever we are dealing with.

@param mixed $item
@return void
Internal helper method to set the value of whatever we are dealing with .