src/Registry/Recursive.php
protected function setScope(&$key, $create = false)
    {
        $this->scope = &$this->fullScope;
        if (false === strpos($key, $this->delimiter)) {

            return;
        }
        /** @noinspection PhpInternalEntityUsedInspection */
        $this->key = $key;
        $keys = explode($this->delimiter, $key);
        $lastKey = array_pop($keys);
        $lastIndex = sizeof($keys) - 1;
        foreach ($keys as $index => $key) {
            if (!isset($this->scope[$key]) || !is_array($this->scope[$key])) {
                if ($create) {
                    $this->scope[$key] = [];
                } else if (!isset($this->scope[$key]) && $index == $lastIndex) {
                    return;
                }
            }
            if (
                $this->checkRefs &&
                $this->isRef($this->scope[$key],false)
            ) {
                $key = $this->scope[$key];
                $this->isRef($key);
                $this->setScope($key, $create);
            }
            $this->scope = &$this->scope[$key];
        }
        $key = $lastKey;
    }
protected function setScope(&$key, $create = false)
    {
        $this->scope = &$this->fullScope;
        if (false === strpos($key, $this->delimiter)) {

            return;
        }
        /** @noinspection PhpInternalEntityUsedInspection */
        $this->key = $key;
        $keys = explode($this->delimiter, $key);
        $lastKey = array_pop($keys);
        $lastIndex = sizeof($keys) - 1;
        foreach ($keys as $index => $key) {
            if (!isset($this->scope[$key]) || !is_array($this->scope[$key])) {
                if ($create) {
                    $this->scope[$key] = [];
                } else if (!isset($this->scope[$key]) && $index == $lastIndex) {
                    return;
                }
            }
            if (
                $this->checkRefs &&
                $this->isRef($this->scope[$key],false)
            ) {
                $key = $this->scope[$key];
                $this->isRef($key);
                $this->setScope($key, $create);
            }
            $this->scope = &$this->scope[$key];
        }
        $key = $lastKey;
    }
protected function setScope ( & $ key , $ create = false ) { $ this -> scope = & $ this -> fullScope ; if ( false === strpos ( $ key , $ this -> delimiter ) ) { return ; } /** @noinspection PhpInternalEntityUsedInspection */ $ this -> key = $ key ; $ keys = explode ( $ this -> delimiter , $ key ) ; $ lastKey = array_pop ( $ keys ) ; $ lastIndex = sizeof ( $ keys ) - 1 ; foreach ( $ keys as $ index => $ key ) { if ( ! isset ( $ this -> scope [ $ key ] ) || ! is_array ( $ this -> scope [ $ key ] ) ) { if ( $ create ) { $ this -> scope [ $ key ] = [ ] ; } else if ( ! isset ( $ this -> scope [ $ key ] ) && $ index == $ lastIndex ) { return ; } } if ( $ this -> checkRefs && $ this -> isRef ( $ this -> scope [ $ key ] , false ) ) { $ key = $ this -> scope [ $ key ] ; $ this -> isRef ( $ key ) ; $ this -> setScope ( $ key , $ create ) ; } $ this -> scope = & $ this -> scope [ $ key ] ; } $ key = $ lastKey ; }
Shifts scope according to complex key.

@param    string $key    <b>[by ref]</b>
@param    bool   $create
@return   void
@internal
Shifts scope according to complex key .