Locates object inside proxy.

@return void
356507
protected function locateObject()
	{
		if ( $this->locatorUsed ) {
			return;
		}

		// NodeElement + TargetElement = Proxy.
		$this->locatorUsed = true;

		$object = call_user_func(
			array($this->className, 'fromNodeElements'),
			$this->locateElements(),
			null,
			$this->pageFactory
		);

		\ArrayObject::offsetSet(null, $object);
	}
1204293
protected function locateMethod()
    {

        # When no request string, use default route.
        if ($this->request_uri === '')
        {
            $callback = $this->route_rules['/'];
            $this->located_controller = $callback['controller'];
            $this->located_method = $callback['method'];
            return TRUE;
        }

        # Finding matched route.
        foreach ($this->route_rules as $rule => $callback)
        {
            preg_match('#^' . $rule . '#', $this->request_uri, $matches);
            if ($matches)
            {
                $controller = $callback['controller'];
                $method = $callback['method'];
                $index = 0;

                # Locating controller class.
                if (strpos($controller, '@') !== FALSE)
                {
                    $at = substr($controller, 1);
                    if ($at == 0 || !isset($matches[$at]))
                    {
                        throw new Exception('@' . $at . ' not found in regex.');
                    }

                    $controller = $matches[$at];
                    $index = ++$at;
                }

                # Locating controller method name.
                if (strpos($method, '@') !== FALSE)
                {
                    $at = substr($method, 1);
                    if ($at == 0 || !isset($matches[$at]))
                    {
                        throw new Exception('@' . $at . ' not found in regex.');
                    }
                    $method = $matches[$at];
                    $index = ++$at;
                }

                # Setting located controller class,method and remaining part
                # which are going to be method parameter to this class property.
                $this->located_controller = $controller;
                $this->located_method = $method;
                $this->remaining_uri = array_slice(explode('/', $this->request_uri), $index);
                break;
            }
        }
    }
935637
protected function proxy() {
        if (!$this->context) {
            $this->context = new SessionContext($this->version, $this->solution['sid']);
        }

        return $this->context;
    }
734408
protected function locateObject()
	{
		if ( is_object($this->object) ) {
			return;
		}

		$nodes = $this->locator->findAll();

		if ( !$nodes ) {
			throw new ElementNotFoundException('Block not found by selector: ' . (string)$this->locator);
		}

		$this->object = new $this->className($this->getName(), $nodes, $this->pageFactory, $this->locator);
	}
1314611
protected function proxy() {
        if (!$this->context) {
            $this->context = new RoomRecordingContext(
                $this->version,
                $this->solution['roomSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
879578
protected function findByExternalID()
    {
        $sModelClass = $this->getModelClass();
        if ($this->bWithTrashed) {
            $this->obModel = $sModelClass::withTrashed()->getByExternalID($this->sExternalID)->first();
        } else {
            $this->obModel = $sModelClass::getByExternalID($this->sExternalID)->first();
        }
    }
220300
public function findOne()
    {
        $this->updateMap();

        return $this->entityRepository->findOne()->with('id', Operator::IN, $this->map);
    }
312602
protected function locateObject()
	{
		if ( is_object($this->object) ) {
			return;
		}

		$web_element = WebElement::fromNodeElement($this->locateElement(), $this->pageFactory);

		$this->object = new $this->className($this->getName(), $web_element);
	}
156433
protected function proxy() {
        if (!$this->context) {
            $this->context = new PhoneNumberContext(
                $this->version,
                $this->solution['trunkSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
203923
protected function initLocator()
    {
        $services = $this->options->get('services');

        if (is_array($services) && !$this->isServicesInited) {
            $this->isServicesInited = true;
            foreach ($services as $serviceName => $serviceDescription) {
                $instance = $this->instantiateFromArray($serviceDescription);
                $this->locator->set($serviceName, $instance);
            }
        }

        return $this->locator;
    }
1082637
protected function proxy() {
        if (!$this->context) {
            $this->context = new SampleContext(
                $this->version,
                $this->solution['assistantSid'],
                $this->solution['taskSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
1316842
protected function proxy() {
        if (!$this->context) {
            $this->context = new EntityContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['identity']
            );
        }

        return $this->context;
    }
878192
protected function replaceProxy($offset)
    {
        $object = $this->getObject();

        /**
         * 0: LazyProxy::replaceProxy()
         * 1: LazyProxy::__get($name) / LazyProxy::__set($name, $value)
         *    2: Frame that accesses $name
         * 1: LazyProxy::__call($method, $arguments)
         * 2: LazyProxy::$method()
         *    3: Frame that invokes $method
         */
        $trace = debug_backtrace();

        if (isset($trace[$offset]['object'])) {
            $reflector = new \ReflectionObject($trace[$offset]['object']);

            foreach ($reflector->getProperties() as $property) {
                $property->setAccessible(true);

                if ($property->getValue($trace[$offset]['object']) === $this) {
                    $property->setValue($trace[$offset]['object'], $object);
                    break;
                }
            }
        }

        return $object;
    }
720828
private function parseProxy()
    {
        if($this->request->getAttribute('useProxy', false))
        {
            $type = $this->request->getAttribute('proxy.type');
            switch($type)
            {
                case 'http':
                    $this->settings['http_proxy_host'] = $this->request->getAttribute('proxy.server');
                    $this->settings['http_proxy_port'] = $this->request->getAttribute('proxy.port');
                    $this->settings['http_proxy_user'] = $this->request->getAttribute('proxy.username', '');
                    $this->settings['http_proxy_password'] = $this->request->getAttribute('proxy.password', '');
                    break;
                case 'socks5':
                    $this->settings['socks5_host'] = $this->request->getAttribute('proxy.server');
                    $this->settings['socks5_port'] = $this->request->getAttribute('proxy.port');
                    $this->settings['socks5_username'] = $this->request->getAttribute('proxy.username', '');
                    $this->settings['socks5_password'] = $this->request->getAttribute('proxy.password', '');
                    break;
            }
        }
    }
1308844
protected function proxy() {
        if (!$this->context) {
            $this->context = new SettingsContext($this->version);
        }

        return $this->context;
    }
1243782
private function parseProxy()
    {
        if($this->request->getAttribute('useProxy', false))
        {
            $type = $this->request->getAttribute('proxy.type', 'http');
            curl_setopt_array($this->handler, array(
                CURLOPT_PROXYAUTH    => self::$proxyAuths[$this->request->getAttribute('proxy.auth', 'basic')],
                CURLOPT_PROXY        => $this->request->getAttribute('proxy.server'),
                CURLOPT_PROXYPORT    => $this->request->getAttribute('proxy.port'),
                CURLOPT_PROXYUSERPWD => $this->request->getAttribute('proxy.username', '') . ':' . $this->request->getAttribute('proxy.password', ''),
                CURLOPT_PROXYTYPE    => 'socks5' === $type ? (defined('CURLPROXY_SOCKS5_HOSTNAME') ? CURLPROXY_SOCKS5_HOSTNAME : self::$proxyType[$type]) : self::$proxyType[$type],
            ));
        }
    }
495929
public function updateProxy(ProxyGenerator &$proxy)
    {
        $proxy = $proxy->addMethod('manipulate', function ($args, $next) {
            $manipulation = $args[0];
            SearchUpdater::handle_manipulation($manipulation);
            return $next(...$args);
        });
    }