@param array  $attributesList
@param string $name
@param string $id

@return mixed
545006
protected function getAttribute($attributesList, $name, $id)
    {
        foreach ($attributesList as $attributes) {
            if (isset($attributes[$name])) {
                return $attributes[$name];
            }
        }
        throw new \RuntimeException(
            sprintf('Missing attribute %s on tag %s in %s definition', $name, $this->tagName, $id)
        );
    }
295054
public static function radio($name, $value, $attributes = array())
    {
        $attributes['value'] = $value;
        return self::input('radio', $name, $attributes);
    }
272814
public static function select($name, $list = [], $selected = null, $options = [])
    {
        self::exclure($options, ['name']);
        //
        $options['name'] = $name;
        //
        $sub = '';
        //
        if (!empty($list)) {
            foreach ($list as $value) {
                $sub .= self::option($value, (!is_null($selected) && $value == $selected));
            }
        }
        //
        $options = Html::attributes($options);
        //
        return '<select'.$options.">\n".$sub."</select>\n";
    }
1110597
public static function select(string $name = '', array $values = [], array $selected = [],
                                  array $attributes = []): string
    {
        $defaultAttributes = ['method-get' => false, 'class' => 'form-select'];
        $userAttributes = \array_merge($defaultAttributes, $attributes);
        $attributes = [];
        $attributes['name'] = $userAttributes['method-get'] === false ? \sprintf('MFVARS[%s]', $name) : $name;
        $attributes['id'] = isset($userAttributes['id']) ? $userAttributes['id'] : $name;
        $attributes['data-selected'] = \implode(',', $selected);
        $wrapperClass = ['select-wrapper'];

        if (\array_key_exists('multiple', $userAttributes) && $userAttributes['multiple'] === true) {
            $attributes['multiple'] = 'multiple';
            $attributes['name'] = \sprintf('%s[]', $attributes['name']);
            $wrapperClass[] = 'multiple';
        }
        if (\array_key_exists('wrapper-class', $userAttributes)) {
            $wrapperClass[] = $userAttributes['wrapper-class'];
        }
        if (\array_key_exists('disabled', $userAttributes)) {
            $wrapperClass[] = 'disabled';
        }
        $clearAttributes = ['method-get', 'id', 'multiple', 'wrapper-class'];
        $userAttributes = static::clearAttributes($userAttributes, $clearAttributes);
        $select = Tags::select(self::getOptions($values, $selected, 0), \array_merge($attributes, $userAttributes));

        return Tags::div($select, ['class' => \implode(' ', $wrapperClass)]);
    }
1227674
public function select($name, $list = [], $selected = null, array $selectAttributes = [], array $optionsAttributes = [], array $optgroupsAttributes = [])
    {
        $selectAttributes = $this->appendClassToOptions('form-control', $selectAttributes);

        if ($this->hasErrors($name)) {
            $selectAttributes = $this->appendClassToOptions('is-invalid', $selectAttributes);
        }

        return parent::select($name, $list, $selected, $selectAttributes, $optionsAttributes, $optgroupsAttributes);
    }
369119
public static function select($name, $options, $attributes = array())
    {
        // Extract the value
        $value = isset($attributes['value']) ? $attributes['value'] : null;
        unset($attributes['value']);

        // Set the name
        $attributes['name'] = $name;

        // Set the id to the name if one
        // is not already set.
        if (!isset($attributes['id'])) {
            $attributes['id'] = $name;
        }

        // Opening tag
        $select = array();
        $select[] = "<select " . HTML::buildAttributes($attributes) . ">";

        // Options
        foreach ($options as $index => $option) {
            if (!is_numeric($index)) {
                $select[] = '<optgroup label="' . $index . '">';
                foreach ($option as $opt) {
                    $select[] = static::selectOption($opt, $value);
                }
                $select[] = '</optgroup>';
            } else {
                $select[] = static::selectOption($option, $value);
            }
        }

        // Closing tags
        $select[] = '</select>';

        return implode(PHP_EOL, $select);
    }
1355552
public static function getIdAttribute($name, $attributes)
    {
        if (array_has($attributes, 'id')) {
            return $attributes['id'];
        }

        if (!is_null(self::$labels)) {
            if (in_array($name, self::$labels)) {
                return $name;
            }
        }
    }
837376
public function attach($id, array $attributes = [])
    {
        $query = $this->newPivotStatement();

        $query->insert($this->createAttachRecords((array) $id, $attributes));
    }
1333011
public static function create($name, $attributes)
    {
        // Not supported is type=image, <button>, list, output, select-optgroup
        $types = [

            // Standard HTML 4.01
            'text'              => '\Anax\HTMLForm\FormElementText',
            'file'              => '\Anax\HTMLForm\FormElementFile',
            'password'          => '\Anax\HTMLForm\FormElementPassword',
            'hidden'            => '\Anax\HTMLForm\FormElementHidden',
            'textarea'          => '\Anax\HTMLForm\FormElementTextarea',
            'radio'             => '\Anax\HTMLForm\FormElementRadio',
            'checkbox'          => '\Anax\HTMLForm\FormElementCheckbox',
            'select'            => '\Anax\HTMLForm\FormElementSelect',
            'select-multiple'   => '\Anax\HTMLForm\FormElementSelectMultiple',
            'submit'            => '\Anax\HTMLForm\FormElementSubmit',
            'reset'             => '\Anax\HTMLForm\FormElementReset',
            'button'            => '\Anax\HTMLForm\FormElementButton',

            // HTML5
            'color'             => '\Anax\HTMLForm\FormElementColor',
            'date'              => '\Anax\HTMLForm\FormElementDate',
            'number'            => '\Anax\HTMLForm\FormElementNumber',
            'range'             => '\Anax\HTMLForm\FormElementRange',
            'tel'               => '\Anax\HTMLForm\FormElementTel',
            'email'             => '\Anax\HTMLForm\FormElementEmail',
            'url'               => '\Anax\HTMLForm\FormElementUrl',
            'search'            => '\Anax\HTMLForm\FormElementSearch',
            'file-multiple'     => '\Anax\HTMLForm\FormElementFileMultiple',
            'datetime'          => '\Anax\HTMLForm\FormElementDatetime',
            'datetime-local'    => '\Anax\HTMLForm\FormElementDatetimeLocal',
            'month'             => '\Anax\HTMLForm\FormElementMonth',
            'time'              => '\Anax\HTMLForm\FormElementTime',
            'week'              => '\Anax\HTMLForm\FormElementWeek',

            // Custom
            'search-widget'     => '\Anax\HTMLForm\FormElementSearchWidget',
            'checkbox-multiple' => '\Anax\HTMLForm\FormElementCheckboxMultiple',
            // Address
        ];

        // $attributes['type'] must contain a valid type creating an object
        // to succeed.
        $type = isset($attributes['type']) ? $attributes['type'] : null;
        if (!($type && isset($types[$type]))) {
            throw new Exception("Form element does not exists and can not be created: $name - $type");
        }
        return new $types[$type]($name, $attributes);
    }
467683
public function dl(array $list, array $attributes = [])
    {
        $attributes = $this->attributes($attributes);

        $html = "<dl{$attributes}>";

        foreach ($list as $key => $value) {
            $value = (array) $value;

            $html .= "<dt>$key</dt>";

            foreach ($value as $v_key => $v_value) {
                $html .= "<dd>$v_value</dd>";
            }
        }

        $html .= '</dl>';

        return $this->toHtmlString($html);
    }
856955
public static function link($name, $url, array $attributes = [])
    {
        return static::openTag('link', array_merge($attributes, ['href' => $url])).
            $name.
            static::closeTag('link');
    }
701147
public function multiselect(String $name = NULL, Array $options = [], $selected = NULL, Array $_attributes = [])
    {
        return $this->select($name, $options, $selected, $_attributes, true);
    }
279120
public function getAttribute($attribute_name)
    {
        $params = [
            ':name' => $attribute_name,
            ':id' => $this->id,
        ];

        return $this->executor->execute(
            DriverCommand::GET_ELEMENT_ATTRIBUTE,
            $params
        );
    }
926863
protected final <T> T[] getIds(String name, Class<T> clazz) {
    T[] datas = Params.getAll(name + ".id", clazz);
    if (null == datas) {
      String datastring = Params.get(name + ".ids");
      if (null == datastring) datastring = Params.get(name + "Ids");
      if (null == datastring) Array.newInstance(clazz, 0);
      else return Params.converter.convert(Strings.split(datastring, ","), clazz);
    }
    return datas;
  }
115627
static public function jiraGetIssueList(array $configuration, array $keyList, array $parameterList = [])
    {
        $issueList = [];

        if (empty($keyList)) {
            return $issueList;
        }

        foreach (array_chunk($keyList, 50) as $chunk) {
            $parameterList['jql'] = 'key IN(' . implode(', ', $chunk) . ')';

            $json = self::jiraGet(
                $configuration['host'] . $configuration['endpoint']['search'],
                $configuration['loginHash'],
                $parameterList
            );

            if (!isset($json->issues)) {
                throw new ContextRuntimeException(
                    'No issues found',
                    StatusCode::INTERNAL_SERVER_ERROR,
                    ['response' => $json]
                );
            }

            foreach ($json->issues as $issue) {
                $issueList[] = $issue;
            }
        }

        return $issueList;
    }
234503
public function updateSection($id, $name, $identifier)
    {
        try {
            return $this->innerGateway->updateSection($id, $name, $identifier);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
692134
public function update($id, array $attributes = [])
    {
        // Find the given instance
        $updated  = false;
        $instance = $id instanceof Model ? $id : $this->find($id);

        if ($instance) {
            // Fill instance with data
            $instance->fill($attributes);

            // Save the instance
            $updated = $instance->save();

            // Fire the updated event
            $this->getContainer('events')->fire($this->getRepositoryId().'.entity.updated', [$this, $instance]);
        }

        return [
            $updated,
            $instance,
        ];
    }