public function recurseThroughResult(array $pathSegments): Result
    {
        if (count($pathSegments) === 0) {
            return $this;
        }

        $propertyName = array_shift($pathSegments);

        if (!isset($this->propertyResults[$propertyName])) {
            $newResult = new Result();
            $newResult->setParent($this);
            $this->propertyResults[$propertyName] = $newResult;
        }

        /** @var Result $result */
        $result = $this->propertyResults[$propertyName];
        return $result->recurseThroughResult($pathSegments);
    }
public function recurseThroughResult(array $pathSegments): Result
    {
        if (count($pathSegments) === 0) {
            return $this;
        }

        $propertyName = array_shift($pathSegments);

        if (!isset($this->propertyResults[$propertyName])) {
            $newResult = new Result();
            $newResult->setParent($this);
            $this->propertyResults[$propertyName] = $newResult;
        }

        /** @var Result $result */
        $result = $this->propertyResults[$propertyName];
        return $result->recurseThroughResult($pathSegments);
    }
public function recurseThroughResult ( array $ pathSegments ) : Result { if ( count ( $ pathSegments ) === 0 ) { return $ this ; } $ propertyName = array_shift ( $ pathSegments ) ; if ( ! isset ( $ this -> propertyResults [ $ propertyName ] ) ) { $ newResult = new Result ( ) ; $ newResult -> setParent ( $ this ) ; $ this -> propertyResults [ $ propertyName ] = $ newResult ; } /** @var Result $result */ $ result = $ this -> propertyResults [ $ propertyName ] ; return $ result -> recurseThroughResult ( $ pathSegments ) ; }
Internal use only!

@param array $pathSegments
@return Result
Internal use only!