src/View/WidgetManager.php
private function hijackPost(PropertyValueBag $valueBag)
    {
        $post  = $_POST;
        $_POST = [];
        Input::resetCache();

        // Set all POST data, these get used within the Widget::validate() method.
        foreach ($valueBag as $property => $value) {
            $_POST[$property] = $value;
        }

        return $post;
    }
private function hijackPost(PropertyValueBag $valueBag)
    {
        $post  = $_POST;
        $_POST = [];
        Input::resetCache();

        // Set all POST data, these get used within the Widget::validate() method.
        foreach ($valueBag as $property => $value) {
            $_POST[$property] = $value;
        }

        return $post;
    }
Remember current POST data and overwrite it with the values from the value bag.

The previous values are returned and can be restored via a call to restorePost().

@param PropertyValueBag $valueBag The value bag to retrieve the new post data from.

@return array

@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName)