@param object|array $current
@param object|array $parent

@return void
516836
private function unresolveRecursively(&$current, &$parent = null)
    {
        foreach ($current as $key => &$value) {
            if ($value !== null && !is_scalar($value)) {
                $this->unresolveRecursively($value, $current);
            }
            if ($key === 'x-ref-id') {
                $parent = (object)['$ref' => $value];
            }
        }
    }
232333
def parent_machine
      current = parent
      current = current.parent while current && !current.is_a?(VM)
      current
    end
502319
protected function register_ticks($parent=true) {

        if ($parent) {
            $this->log("Registering signals for parent", GearmanManager::LOG_LEVEL_DEBUG);
            pcntl_signal(SIGTERM, array($this, "signal"));
            pcntl_signal(SIGINT,  array($this, "signal"));
            pcntl_signal(SIGUSR1,  array($this, "signal"));
            pcntl_signal(SIGUSR2,  array($this, "signal"));
            pcntl_signal(SIGCONT,  array($this, "signal"));
            pcntl_signal(SIGHUP,  array($this, "signal"));
        } else {
            $this->log("Registering signals for child", GearmanManager::LOG_LEVEL_DEBUG);
            $res = pcntl_signal(SIGTERM, array($this, "signal"));
            if (!$res) {
                exit();
            }
        }
    }
1351041
public function setCurrent($current) {
        if(!$this->routeKeyPrefix)
            $current = str_replace($this->routeKeyPrefix,'',$current);
        if(!is_numeric($current)) return;
        if($current <= $this->getMax()) $this->current_page = $current;
        else $this->current_page = $this->getMax();
    }
968510
public function handleHeaderRow(array $current, $key)
    {
        if ($key == $this->csvFormat->getHeaderRow() - 1) {
            if (count($current) > 1 || strlen($current[0]) > 0) {
                $this->headerRow = $current;
            }
        }
        return true;
    }
348873
public function actionAdd($id, $parent_id, $add = 1)
    {
        $parent = $this->findParentModel($parent_id);
        $model = $this->findParentModel();
        $model->type = Item::TYPE_PERMISSION;
        $model->name = $id;
        if ((!$child = $model::findOne($id)) && $add) {
            $child = $model;
        }
        if ($add) {
            $parent->addChild($child);
        } else if ($child){
            $parent->removeChild($child);
        }
    }
924057
private function storeCurrentItem() : void
    {
        $key = $this->iterator->key();

        if ($key === null) {
            return;
        }

        $this->items[$key] = $this->iterator->current();
    }
65623
private function traverse($currentNode)
    {
        $this->collectDiagnostics($currentNode);

        // Only update/descend into Nodes, Tokens are leaves
        if ($currentNode instanceof Node) {
            $this->collectDefinitionsAndReferences($currentNode);

            foreach ($currentNode::CHILD_NAMES as $name) {
                $child = $currentNode->$name;

                if ($child === null) {
                    continue;
                }

                if (\is_array($child)) {
                    foreach ($child as $actualChild) {
                        if ($actualChild !== null) {
                            $this->traverse($actualChild);
                        }
                    }
                } else {
                    $this->traverse($child);
                }
            }
        }
    }
936082
function Insert($item, $parent = null, $previous = null)
    {
        if ($previous)
        {
            $parent = $this->provider->ParentOf($previous);
        }
        $oldNext = $this->provider->NextOf($item);
        $oldPrev = $this->provider->PreviousOf($item);
        $oldFirst = $this->provider->FirstChildOf($parent);
        if (!($oldPrev && $previous && $this->provider->Equals($oldPrev, $previous)))
        {
            $this->CloseCutGap($oldPrev, $oldNext, $item);
        }
        $this->UpdateInsertItem($item, $parent, $previous);
        
        if (!$previous)
        {
            $this->AssureFirstChild($item, $oldFirst);
        }
    }
636920
private void setCurrent(Map<String, Object> current) {
        if (current instanceof Context) {
            throw new IllegalArgumentException("Don't using the " + Context.class.getName()
                    + " object as a parameters, it's implicitly delivery by thread-local. parameter context: "
                    + ((Context) current).thread.getName() + ", current context: " + thread.getName());
        }
        this.current = current;
    }
462975
public function setParent($parent)
    {
        if ($parent !== null && !$parent instanceof self) {
            throw new \InvalidArgumentException('An entry may only have another entry as parent');
        }

        $this->parent = $parent;
    }
534178
public function setParent($parent)
    {
        if (empty($parent) || $this->getRefId() == $parent->getRefId() ||
            $parent->hasAncestor($this) || $this->hasReachedAncestorLimit()) {
            return false;
        }
        unset($this->parent);
        unset($parent->children);
        $this->trigger(static::$eventParentChanged);
        $parent->trigger(static::$eventChildAdded);
        return $this->{$this->parentAttribute} = $parent->getRefId();
    }
448419
public function setParent($parent)
    {
        if (null === $parent) {
            $this->parent = null;

            return $this;
        }

        if (is_string($parent)) {
            $this->parent = new Role($parent);

            return $this;
        }

        if ($parent instanceof RoleInterface) {
            $this->parent = $parent;

            return $this;
        }

        throw Exception\InvalidRoleException::invalidRoleInstance($parent);
    }
265083
public function current() {

		$current = parent :: current();

		if(null !== $current) {

			if(false === is_string($current) && false === is_numeric($current) && true === $this -> is_multidimensional($current)) {

				if($this -> convert !== self :: TYPE_ARRAY) {
					return trigger_error(sprintf('Multidimensional Array can not be converted to "%s" type in "%s"', $this -> convert, __METHOD__), E_USER_ERROR);	
				}

				return $current;
			}

			switch($this -> convert) {

				case self :: TYPE_ARRAY: 
					return $current;

				case self :: TYPE_OBJECT: 
					return (object) $current;

				case self :: TYPE_JSON: 
					return json_encode($current);

				default : 

					if(false === class_exists($this -> entity)) {
						return trigger_error(sprintf('"%s" is not a valid type or Entity class file in %s', $type, __METHOD__), E_USER_ERROR);
					}

					$entity = new $this -> entity();

					$entity -> setAdapter($this -> adapter);
					$entity -> fromArray($current);

					return $entity;
			}
		}
	}
608944
protected function inheritFromParent(BaseQuery $parent)
    {
        $this->macros = $parent->macros;
        $this->flags = $parent->flags;
        $this->resultFetcher = $parent->resultFetcher;   
    }
585409
public function clear(bool $current = false): void
    {
        if ($current) {
            $this->curr->clear();
        }
        $this->next->clear();
    }
992597
public function current()
    {
        $callback = $this->_callback;

        return $callback(parent::current(), $this->key(), $this->_innerIterator);
    }