Creates a new Git data from the specified JSON map.
@param object $map A JSON map representing a Git data.
@return static The instance corresponding to the specified JSON map.
160252
static function fromJson(object $map): self {
    return new static(
      isset($map->head) && is_object($map->head) ? GitCommit::fromJson($map->head) : null,
      isset($map->branch) && is_string($map->branch) ? $map->branch : '',
      isset($map->remotes) && is_array($map->remotes) ? array_map([GitRemote::class, 'fromJson'], $map->remotes) : []
    );
  }
508803
public function createOutputWithMap(array $values, array $map) {
		$output = '';
		foreach ($map as $outputLine) {
			if ($outputLine['type'] == 'empty') {
				$output .= PHP_EOL;
			} elseif($outputLine['type'] == 'comment') {
				$output .= $outputLine['value'] . PHP_EOL;
			} else {
				$output .= $this->createLine($outputLine['key'], $values[$outputLine['key']], $outputLine) . PHP_EOL;
				unset($values[$outputLine['key']]);
			}
		}

		// Add values which are not mapped at the end
		$output .= $this->createOutput($values);

		return $output;
	}
1351295
protected function getReplacementKeys(array $map = [])
    {
        $keys = empty($map) ? array_keys($this->model->new_value) : array_keys($map);
        return array_map(function($current) {
            return '{' . $current . '}';
        }, $keys);
    }
330769
public static function map(array $object, array $map)
    {
        $result = [];

        foreach ($map as $from => $to) {
            if ( ! isset($object[$from])) {
                continue;
            }

            $result[$to] = $object[$from];
        }

        return $result;
    }
1014574
public function buildMarshalMap($marshaller, $map, $options)
    {
        if (isset($options['translations']) && !$options['translations']) {
            return [];
        }

        return [
            '_translations' => function ($value, $entity) use ($marshaller, $options) {
                /* @var \Cake\Datasource\EntityInterface $entity */
                $translations = $entity->get('_translations');
                foreach ($this->_config['fields'] as $field) {
                    $options['validate'] = $this->_config['validator'];
                    $errors = [];
                    if (!is_array($value)) {
                        return null;
                    }
                    foreach ($value as $language => $fields) {
                        if (!isset($translations[$language])) {
                            $translations[$language] = $this->_table->newEntity();
                        }
                        $marshaller->merge($translations[$language], $fields, $options);
                        if ((bool)$translations[$language]->getErrors()) {
                            $errors[$language] = $translations[$language]->getErrors();
                        }
                    }
                    // Set errors into the root entity, so validation errors
                    // match the original form data position.
                    $entity->setErrors($errors);
                }

                return $translations;
            }
        ];
    }
912264
public function map($map = null) {
		if ($map !== null) {
			$this->_map = $map;
			return $this;
		}
		return $this->_map;
	}
954701
public function transformNames(array $map) {
    $new = new StaticAttributesMap();
    foreach ($this->attributes as $name => $attributes) {
      if (isset($map[$name])) {
        $new->attributes[$map[$name]] = $attributes;
      }
    }
    foreach ($this->classes as $name => $classes) {
      if (isset($map[$name])) {
        $new->classes[$map[$name]] = $classes;
      }
    }
    return $new;
  }
175944
public function create($key, $data) {
        $data = Values::of(array('Key' => $key, 'Data' => Serialize::jsonObject($data), ));

        $payload = $this->version->create(
            'POST',
            $this->uri,
            array(),
            $data
        );

        return new SyncMapItemInstance(
            $this->version,
            $payload,
            $this->solution['serviceSid'],
            $this->solution['mapSid']
        );
    }
331202
public function render(Map $map)
    {
        $this->getEventDispatcher()->dispatch(StaticMapEvents::HTML, $event = new StaticMapEvent($map));

        $query = preg_replace('/(%5B[0-9]+%5D)+=/', '=', http_build_query($event->getParameters(), '', '&'));
        $url = 'https://maps.googleapis.com/maps/api/staticmap?'.$query;

        if ($this->hasSecret()) {
            $url = UrlSigner::sign($url, $this->secret, $this->clientId, $this->channel);
        }

        return $url;
    }
755427
public function render(Map $map)
    {
        $formatter = $this->getFormatter();
        $jsonBuilder = $this->getJsonBuilder();

        $options = $map->getMapOptions();
        unset($options['mapTypeId']);

        if (!$map->isAutoZoom()) {
            if (!isset($options['zoom'])) {
                $options['zoom'] = 3;
            }
        } else {
            unset($options['zoom']);
        }

        $this->controlManagerRenderer->render($map->getControlManager(), $jsonBuilder);

        $jsonBuilder
            ->setValue(
                '[mapTypeId]',
                $this->mapTypeIdRenderer->render($map->getMapOption('mapTypeId') ?: MapTypeId::ROADMAP),
                false
            )
            ->setValues($options);

        return $formatter->renderObjectAssignment($map, $formatter->renderObject('Map', [
            $formatter->renderCall(
                $formatter->renderProperty('document', 'getElementById'),
                [$formatter->renderEscape($map->getHtmlId())]
            ),
            $jsonBuilder->build(),
        ]));
    }
986296
public function addTo(Map $map)
    {
        $this->map = $map;
        $map->addLayer($this);

        return $this->addMethod('addTo', array($map));
    }
861308
public static function create($mapping): Mapping
    {
        if (\is_array($mapping)) {
            $mappingObject = new self();
            $mappingObject->setProperties($mapping);

            return $mappingObject;
        }

        if ($mapping instanceof self) {
            return $mapping;
        }

        throw new InvalidException('Invalid object type');
    }
372552
public static function fromJson(string $json): self
    {
        $input = json_decode($json, true);
        $data = reset($input);
        $locale = key($input);
        
        return new self($locale, $data);
    }
544641
public static JSONObject toJsonObject(Map<String, ?> map) {
    JSONObject jsonObject = new JSONObject();
    for (Map.Entry<String, ?> entry : map.entrySet()) {
      Object value = wrap(entry.getValue());
      try {
        jsonObject.put(entry.getKey(), value);
      } catch (JSONException ignored) {
        // Ignore values that JSONObject doesn't accept.
      }
    }
    return jsonObject;
  }
930077
static function fromJson(object $map): self {
    return new static(
      isset($map->sourceFile) && is_string($map->sourceFile) ? $map->sourceFile : '',
      isset($map->functions) && is_object($map->functions) ? FunctionCoverage::fromJson($map->functions) : null,
      isset($map->branches) && is_object($map->branches) ? BranchCoverage::fromJson($map->branches) : null,
      isset($map->lines) && is_object($map->lines) ? LineCoverage::fromJson($map->lines) : null
    );
  }
161661
public static function create($values = null, $map = null, $prefix = null)
    {
        $object = new static();
        if ($values) {
            $object->fillSchemaFields($values, $map, $prefix);
        }

        return $object;
    }
136066
public static JsonObject toJsonObject(Map<String, ?> map) {
        JsonObject properties = new JsonObject();
        for (Map.Entry<String, ?> property : map.entrySet()) {
            properties.add(property.getKey(), Json.value(property.getValue().toString()));
        }
        return properties;
    }