protected function deReferenceArray(
        array &$dataArray,
        /*# bool */ $clearCache = false
    ) {
        // reference feature disabled
        if ('' === $this->getPattern()) {
            return;
        }

        // clear old cache
        if ($clearCache) {
            $this->loop_detect = [];
        }

        try {
            foreach ($dataArray as $idx => &$data) {
                // go deeper if is array
                if (is_array($data)) {
                    $this->dereferenceArray($data);

                // $data is string
                } elseif (is_string($data)) {
                    $key = $data;
                    if (isset($this->loop_detect[$key])) {
                        $data = $this->loop_detect[$key];
                    } else {
                        $data = $this->deReference($data);
                        if (is_array($data)) {
                            $this->dereferenceArray($data);
                        }
                        $this->loop_detect[$key] = $data;
                    }
                }
            }
        } catch (\Exception $e) {
            throw new LogicException($e->getMessage(), $e->getCode(), $e);
        }
    }
protected function deReferenceArray(
        array &$dataArray,
        /*# bool */ $clearCache = false
    ) {
        // reference feature disabled
        if ('' === $this->getPattern()) {
            return;
        }

        // clear old cache
        if ($clearCache) {
            $this->loop_detect = [];
        }

        try {
            foreach ($dataArray as $idx => &$data) {
                // go deeper if is array
                if (is_array($data)) {
                    $this->dereferenceArray($data);

                // $data is string
                } elseif (is_string($data)) {
                    $key = $data;
                    if (isset($this->loop_detect[$key])) {
                        $data = $this->loop_detect[$key];
                    } else {
                        $data = $this->deReference($data);
                        if (is_array($data)) {
                            $this->dereferenceArray($data);
                        }
                        $this->loop_detect[$key] = $data;
                    }
                }
            }
        } catch (\Exception $e) {
            throw new LogicException($e->getMessage(), $e->getCode(), $e);
        }
    }
protected function deReferenceArray ( array & $ dataArray , /*# bool */ $ clearCache = false ) { // reference feature disabled if ( '' === $ this -> getPattern ( ) ) { return ; } // clear old cache if ( $ clearCache ) { $ this -> loop_detect = [ ] ; } try { foreach ( $ dataArray as $ idx => & $ data ) { // go deeper if is array if ( is_array ( $ data ) ) { $ this -> dereferenceArray ( $ data ) ; // $data is string } elseif ( is_string ( $ data ) ) { $ key = $ data ; if ( isset ( $ this -> loop_detect [ $ key ] ) ) { $ data = $ this -> loop_detect [ $ key ] ; } else { $ data = $ this -> deReference ( $ data ) ; if ( is_array ( $ data ) ) { $ this -> dereferenceArray ( $ data ) ; } $ this -> loop_detect [ $ key ] = $ data ; } } } } catch ( \ Exception $ e ) { throw new LogicException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } }
Derefence all references in an array

@param  array &$dataArray
@param  bool $clearCache clear dereference cache
@throws LogicException if malformed reference found
@access protected
Derefence all references in an array