src/Core/Extension.php
public function withOwner($owner, callable $callback, $args = [])
    {
        try {
            $this->setOwner($owner);
            return $callback(...$args);
        } finally {
            $this->clearOwner();
        }
    }
public function withOwner($owner, callable $callback, $args = [])
    {
        try {
            $this->setOwner($owner);
            return $callback(...$args);
        } finally {
            $this->clearOwner();
        }
    }
public function withOwner ( $ owner , callable $ callback , $ args = [ ] ) { try { $ this -> setOwner ( $ owner ) ; return $ callback ( ... $ args ) ; } finally { $ this -> clearOwner ( ) ; } }
Temporarily modify the owner. The original owner is ensured to be restored

@param mixed $owner Owner to set
@param callable $callback Callback to invoke
@param array $args Args to pass to callback
@return mixed
Temporarily modify the owner . The original owner is ensured to be restored