protected function getValueForPath($path)
    {
        $data = $this->data;
        if (!$data) {
            return null;
        }

        $steps = $this->getPath($path);
        if (!$steps) {
            return null;
        }

        if (\is_array($steps)) {
            if (1 === \count($steps)) {
                return $this->getValue(current($steps), $data);
            }

            $value = [];
            foreach ($steps as $step) {
                $value[] = $this->getValue($step, $data);
            }

            return trim(implode(' ', $value)) ?: null;
        }

        return $this->getValue($steps, $data);
    }
protected function getValueForPath($path)
    {
        $data = $this->data;
        if (!$data) {
            return null;
        }

        $steps = $this->getPath($path);
        if (!$steps) {
            return null;
        }

        if (\is_array($steps)) {
            if (1 === \count($steps)) {
                return $this->getValue(current($steps), $data);
            }

            $value = [];
            foreach ($steps as $step) {
                $value[] = $this->getValue($step, $data);
            }

            return trim(implode(' ', $value)) ?: null;
        }

        return $this->getValue($steps, $data);
    }
protected function getValueForPath ( $ path ) { $ data = $ this -> data ; if ( ! $ data ) { return null ; } $ steps = $ this -> getPath ( $ path ) ; if ( ! $ steps ) { return null ; } if ( \ is_array ( $ steps ) ) { if ( 1 === \ count ( $ steps ) ) { return $ this -> getValue ( current ( $ steps ) , $ data ) ; } $ value = [ ] ; foreach ( $ steps as $ step ) { $ value [ ] = $ this -> getValue ( $ step , $ data ) ; } return trim ( implode ( ' ' , $ value ) ) ? : null ; } return $ this -> getValue ( $ steps , $ data ) ; }
Extracts a value from the response for a given path.

@param string $path Name of the path to get the value for

@return string|null
Extracts a value from the response for a given path .