Get value from data.

@param mixed[] $data
@param string $key Uses dot notation.
@param mixed $defaultValue Default null.
@return mixed|null
510589
public static function get(array $data, string $key, $defaultValue = null)
    {
        $data = self::dataByPath($data, $key);
        if ($data === null) {
            $data = $defaultValue;
        }
        return $data;
    }
1077744
public function getValueFromData($data, $default = null)
    {
        $fieldName = $this->valueFrom ?: $this->fieldName;
        return $this->getFieldNameFromData($fieldName, $data, $default);
    }
377896
public Object get(String key, Object defaultValue) {
        Object value = get(key);
        return value == null ? defaultValue : value;
    }
688623
public static function get(array $data, $key, $default = null)
	{
		if ($key === null) {
			return $data;
		}

		if (is_array($key)) {
			return static::getArray($data, $key, $default);
		}

		foreach (explode('.', $key) as $segment) {
			if (!is_array($data)) {
				return $default;
			}

			if (!array_key_exists($segment, $data)) {
				return $default;
			}

			$data = $data[$segment];
		}

		return $data;
	}
656646
public function get($key, $default = null) {
        if (strpos($key, '.') === false) {
            $value = isset($this->_data[$key]) ? $this->_data[$key] : null;
        } else {
            $value = Hash::get($this->_data, $key);
        }

        if ($value === null) {
            return $default;
        }

        return $value;
    }
538101
public function getOptional($key, $defaultValue = null)
  {
    if (array_key_exists($key, $this->data)) {
      return $this->data[$key];
    }
    return $defaultValue;
  }
273357
public function get($key, $default = null)
    {
        $key = $this->resolveAlias($key);

        $accessor = 'get' . $this->toCamelCase($key) . 'Value';

        $value = isset($this->data[$key]) ? $this->data[$key] : null;

        if (is_callable([$this, $accessor])) {
            return $this->$accessor($value);
        }

        if ($cast = $this->getCast($key)) {
            $value = $this->castValue($key, $value);
        }

        if ($value === null) {
            return $default;
        }

        return $value;
    }
1256634
public function getValue($name, $default = null)
    {
        return isset($this->data[$name]) ? $this->data[$name] : $default;
    }
10005
public function getProperty($key, $defaultValue = null)
    {
        if (empty($this->properties[$key])) {
            return $defaultValue;
        }

        return $this->properties[$key];
    }
1139775
private function _get( $key, $data, $default ) {
		if ( ! is_array( $data ) || ! array_key_exists( 'value', $data ) ) {
			return $default;
		}
		if ( $this->_expired( $data ) ) {
			$this->_delete( $key );

			return $default;
		}

		return $data['value'];
	}
402380
private function getParameter($values, $key, $defaultValue = null)
    {
        return array_key_exists($key, $values) ? $values[$key] : $defaultValue;
    }
617491
public static function get(string $key, $defaultValue = null, string $storage = 'global')
    {
        if (!self::has($key)) {
            return $defaultValue;
        }

        // Get content.
        $fileKey = self::key($key);
        $content = null;
        if (file_exists(self::$path . '/' . $storage . '/' . $fileKey)) {
            $content = file_get_contents(self::$path . '/' . $storage . '/' . $fileKey);
        }

        // Extract expiration.
        $markerPos = strpos($content, self::$marker);
        $expiration = null;
        if ($markerPos !== false) {
            $expiration = substr($content, 0, $markerPos);
        }

        // Extract content.
        if ($expiration < time()) {
            self::forget($key);
        } else {
            return unserialize(substr($content, $markerPos + strlen(self::$marker)));
        }

        return $defaultValue;
    }
296045
public function get($key, $default = null)
    {
        $value = parent::get($key, $default);
        if (is_array($value)) {
            $value = array_shift($value);
        }
        return $value;
    }
1143959
public function getSafeArray(string $key, array & $data, string $default = null)
    {
        $value = $this->getFromArray($key, $data, $default);

        return \htmlspecialchars($value);
    }
1169742
public function get($keyName, $defaultValue = null)
    {
        $this->initList();
        $keyName = strtolower($keyName);
        if (empty($this->list[$keyName])) {
            return $defaultValue;
        }
        return $this->list[$keyName];
    }
937668
public function get($key, $default = null)
    {
        $key = strtolower($key);

        if (!array_key_exists($key, $this->data)) {
            if (null === $default) {
                return null;
            }

            return $default;
        }

        return $this->data[$key];
    }
397532
public function getData($key = null, $default = null)
    {
        if (is_null($key)) {
            return $this->data;
        }
        if (! $this->hasData($key)) {
            return $default;
        }

        return $this->data[$key];
    }