$target = &$this->fields;
while ($segments) {
- if (!is_array($target)) {
+ if (!\is_array($target)) {
$target = array();
}
$path = array_shift($segments);
{
$segments = $this->getSegments($name);
$target = &$this->fields;
- while (count($segments) > 1) {
+ while (\count($segments) > 1) {
$path = array_shift($segments);
if (!array_key_exists($path, $target)) {
return;
public function set($name, $value)
{
$target = &$this->get($name);
- if ((!is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) {
+ if ((!\is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) {
$target->setValue($value);
- } elseif (is_array($value)) {
+ } elseif (\is_array($value)) {
$fields = self::create($name, $value);
foreach ($fields->all() as $k => $v) {
$this->set($k, $v);
{
foreach ($array as $k => $v) {
$path = empty($base) ? $k : sprintf('%s[%s]', $base, $k);
- if (is_array($v)) {
+ if (\is_array($v)) {
$this->walk($v, $path, $output);
} else {
$output[$path] = $v;
/**
* Splits a field name into segments as a web browser would do.
*
- * <code>
* getSegments('base[foo][3][]') = array('base', 'foo, '3', '');
- * </code>
*
* @param string $name The name of the field
*