Flow\JSONPath\JSONPath::first PHP Méthode

first() public méthode

public first ( ) : mixed
Résultat mixed
    public function first()
    {
        $keys = AccessHelper::collectionKeys($this->data);
        if (empty($keys)) {
            return null;
        }
        $value = isset($this->data[$keys[0]]) ? $this->data[$keys[0]] : null;
        return AccessHelper::isCollectionType($value) ? new static($value, $this->options) : $value;
    }