@param bool $checked

@return static
777218
public function setChecked(bool $checked)
    {
        if ($checked) {
            $this->getTag()->setAttribute('checked', 'checked');
        } else {
            $this->getTag()->removeAttribute('checked');
        }

        return $this;
    }
1300071
public static function extension($check, $extensions = ['gif', 'jpeg', 'png', 'jpg'])
    {
        if ($check instanceof UploadedFileInterface) {
            return static::extension($check->getClientFilename(), $extensions);
        }
        if (is_array($check)) {
            $check = isset($check['name']) ? $check['name'] : array_shift($check);

            return static::extension($check, $extensions);
        }
        $extension = strtolower(pathinfo($check, PATHINFO_EXTENSION));
        foreach ($extensions as $value) {
            if ($extension === strtolower($value)) {
                return true;
            }
        }

        return false;
    }
582981
public function setChecked(array $checked)
    {
        foreach ($this->checkboxes as $checkbox) {
            /* @var $checkbox Checkbox */
            $checkbox->setChecked(in_array($checkbox->getName(), $checked));
        }

        return $this;
    }
138029
public function setSelected(bool $selected) : Option
    {
        if ($selected) {
            $this->tag->setAttribute('selected', 'selected');
        } else {
            $this->tag->removeAttribute('selected');
        }

        return $this;
    }
884031
public function asJoined(bool $joined = true)
    {
        $node = clone $this;
        $node->joined = $joined;

        return $node;
    }
1190757
public static function makeIf($condition, $options)
    {
        if (value($condition)) {
            return static::make($options);
        }

        return static::make()->authorized(false);
    }
218944
public function render($checked = null)
    {
        $this->tag->addAttribute('type', 'radio');

        $nameAttribute = $this->getName();
        $valueAttribute = $this->getValueAttribute(true);

        $propertyValue = null;
        if ($this->hasMappingErrorOccurred()) {
            $propertyValue = $this->getLastSubmittedFormData();
        }
        if ($checked === null && $propertyValue === null) {
            $propertyValue = $this->getPropertyValue();
        }

        if ($propertyValue !== null) {
            // no type-safe comparison by intention
            $checked = $propertyValue == $valueAttribute;
        }

        $this->registerFieldNameForFormTokenGeneration($nameAttribute);
        $this->tag->addAttribute('name', $nameAttribute);
        $this->tag->addAttribute('value', $valueAttribute);
        if ($checked === true) {
            $this->tag->addAttribute('checked', 'checked');
        }

        $this->addAdditionalIdentityPropertiesIfNeeded();
        $this->setErrorClassAttribute();

        return $this->tag->render();
    }
481466
public function removeCheck($check)
    {
        if (in_array($check, $this->checks)) {
            $this->checks = array_diff($this->checks, [$check]);
        }
    }
837631
public function csrf($check = false, $force = false)
    {
        if ($this->config['csrf'] !== true) {
            return !empty($check) ? true : '';
        }

        if (session_id() == '' && $this->config['auto_session'] === true) {
            @session_start();
        }

        if ($check === false) {
            $current_token = $this->get_csrf_token();

            if (($current_token !== false && $force) || $current_token === false) {
                $token = sha1(uniqid(microtime(true), true));

                $_SESSION['phery'] = array(
                    'csrf' => $token
                );

                $token = base64_encode($token);
            } else {
                $token = base64_encode($_SESSION['phery']['csrf']);
            }

            return "<meta id=\"csrf-token\" name=\"csrf-token\" content=\"{$token}\" />\n";
        } else {
            if (empty($_SESSION['phery']['csrf'])) {
                return false;
            }

            return $_SESSION['phery']['csrf'] === base64_decode($check, true);
        }
    }
931945
public function checkbox($name = null, $checked = false, $value = '1')
    {
        return $this->input('checkbox', $name, $value)
            ->attributeIf(! is_null($value), 'value', $value)
            ->attributeIf((bool) $this->old($name, $checked), 'checked');
    }
1097117
protected function onInvalidEventCustomValidity($key, $check = [])
    {
        $this->vMethodMessages .= $this->setCustomValidity($key, $check) . ' ';

        return $this;
    }
260190
public function addCheck($check, $top = false)
    {
        if (!in_array($check, $this->checks)) {
            if ($top) {
                array_unshift($this->checks, $check);
            } else {
                $this->checks[] = $check;
            }
        }
    }
98158
public T checked(boolean checked) {

        if (view instanceof CompoundButton) {
            CompoundButton cb = (CompoundButton) view;
            cb.setChecked(checked);
        }

        return self();
    }
1022468
public function formatCode($code, $checked = false, $noTransformation = false)
    {
        return $this->getFormatInstance()->formatCode($code, $checked, $noTransformation);
    }
456718
protected function controller($check = null) {
        $controller = Util::camelToHyphen($this->view->getController()->getClassName());
        return $check ? ($check == $controller) : $controller;
    }
834280
public function checkbox($name, $value = 1, $checked = null, $options = array())
    {
        return $this->checkable('checkbox', $name, $value, $checked, $options);
    }
360050
public function check(bool $value = true)
    {
        if ($value == false) {
            unset($this->attributes['checked']);
        } else {
            $this->attributes['checked'] = $value;
        }
    }