src/Contao/View/Contao2BackendView/ContaoWidgetManager.php
protected function cleanErrors(Widget $widget, $ignoreErrors = false)
    {
        if (!$ignoreErrors) {
            return;
        }

        // Clean the errors array and fix up the CSS class.
        $reflectionPropError = new \ReflectionProperty(\get_class($widget), 'arrErrors');
        $reflectionPropError->setAccessible(true);
        $reflectionPropError->setValue($widget, []);

        $reflectionPropClass = new \ReflectionProperty(\get_class($widget), 'strClass');
        $reflectionPropClass->setAccessible(true);
        $reflectionPropClass->setValue($widget, \str_replace('error', '', $reflectionPropClass->getValue($widget)));
    }
protected function cleanErrors(Widget $widget, $ignoreErrors = false)
    {
        if (!$ignoreErrors) {
            return;
        }

        // Clean the errors array and fix up the CSS class.
        $reflectionPropError = new \ReflectionProperty(\get_class($widget), 'arrErrors');
        $reflectionPropError->setAccessible(true);
        $reflectionPropError->setValue($widget, []);

        $reflectionPropClass = new \ReflectionProperty(\get_class($widget), 'strClass');
        $reflectionPropClass->setAccessible(true);
        $reflectionPropClass->setValue($widget, \str_replace('error', '', $reflectionPropClass->getValue($widget)));
    }
protected function cleanErrors ( Widget $ widget , $ ignoreErrors = false ) { if ( ! $ ignoreErrors ) { return ; } // Clean the errors array and fix up the CSS class. $ reflectionPropError = new \ ReflectionProperty ( \ get_class ( $ widget ) , 'arrErrors' ) ; $ reflectionPropError -> setAccessible ( true ) ; $ reflectionPropError -> setValue ( $ widget , [ ] ) ; $ reflectionPropClass = new \ ReflectionProperty ( \ get_class ( $ widget ) , 'strClass' ) ; $ reflectionPropClass -> setAccessible ( true ) ; $ reflectionPropClass -> setValue ( $ widget , \ str_replace ( 'error' , '' , $ reflectionPropClass -> getValue ( $ widget ) ) ) ; }
Clean errors for widget.

@param Widget $widget       The widget.
@param bool   $ignoreErrors The flag for errors cleared.

@return void
Clean errors for widget .