{@inheritdoc}
@throws \Teknoo\States\Proxy\Exception\StateNotFound
425506
public function isValid(): AssertionInterface
    {
        if (!$this->proxy instanceof AutomatedInterface) {
            throw new \RuntimeException('Error, the proxy is not a valid AutomatedInterface instance');
        }

        foreach ($this->statesList as $state) {
            $this->proxy->enableState($state);
        }

        return $this;
    }
449458
public static function call($hookName, $args = array(), $alternativePath = NULL) {
        $hookImplementer = self::hasImplementer($hookName);

        if (!empty($hookImplementer)) {
            $implementerClass = '\\Hooks\\' . $hookImplementer;
            $implementer = new $implementerClass();
            $implementer->$hookName($args);
        } else {
            $defaultImplementer = self::hasDefaultImplementer($hookName, $alternativePath);
           
            if ($defaultImplementer) {
                return $defaultImplementer::$hookName($args);
            } else {
                throw new \Exception(_message(ExceptionMessages::UNDECLARED_HOOK_NAME, $hookName));
            }
        }
    }
151438
public function unregisterState(string $stateName): ProxyInterface
    {
        $this->validateName($stateName);

        if (!isset($this->states[$stateName])) {
            throw new Exception\StateNotFound(\sprintf('State "%s" is not available', $stateName));
        }

        unset($this->states[$stateName]);

        if (isset($this->activesStates[$stateName])) {
            unset($this->activesStates[$stateName]);
        }

        if (isset($this->classesByStates[$stateName])) {
            unset($this->classesByStates[$stateName]);
        }

        return $this;
    }
1155166
@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// Eliminamos de la URI el contexto
		String url = request.getRequestURI().substring(request.getContextPath().length());
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("url => {}", url);
			LOGGER.debug("HTTP_METHOD => {}", request.getMethod());
			LOGGER.debug("queryString => {}", request.getQueryString());
			LOGGER.debug("Context [{}]", request.getContextPath());
		}

		HttpMethod requestMethod = HttpMethod.valueOf(request.getMethod());
		if (requestMethod == HttpMethod.POST) {
			String httpMethodParam = request.getParameter(HTTP_METHOD_PARAM);
			LOGGER.debug("param: http_method => {}", httpMethodParam);
			if (httpMethodParam != null) {
				requestMethod = HttpMethod.valueOf(httpMethodParam);
			}
		}
		// Getting all the information from the URL
		UrlInfo urlInfo = urlInspector.getUrlInfo(url, requestMethod);
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("URL info {}", urlInfo.toString());
		}
		// Calling the controller's action
		ResponseHelper responseHelper = new ResponseHelper(this.getServletContext(), request, response, urlInfo, config.getString(Config.VIEWS_DIRECTORY));
		helper.invokeAction(urlInfo, responseHelper);
		responseHelper.doResponse();
	}
340287
protected function proxy() {
        if (!$this->context) {
            $this->context = new AvailableAddOnContext($this->version, $this->solution['sid']);
        }

        return $this->context;
    }
646445
public static void waitWhileState(final DeviceProxy proxy, final DevState waitState, final long timeout)
	    throws DevFailed, TimeoutException {
	waitWhileState(proxy, waitState, timeout, 300);
    }
996208
public static function tryParse(string $scheme): ?SchemeInterface
    {
        if (!self::myParse($scheme, $result, $type, $defaultPort)) {
            return null;
        }

        return new self($result, $type, $defaultPort);
    }
280728
protected function proxy() {
        if (!$this->context) {
            $this->context = new DefaultsContext($this->version, $this->solution['assistantSid']);
        }

        return $this->context;
    }
729505
public function fetch($style = null, $orientation = null, $offset = null)
    {
        set_error_handler(array($this->_pdooci,"errorHandler"));
        try {
            $style = is_null($style) ? $this->_fetch_sty : $style;
            $this->_fetch_sty = $style;
            $rst   = null;

            switch ($style)
            {
            case \PDO::FETCH_BOTH:
            case \PDO::FETCH_BOUND:
                $rst = \oci_fetch_array($this->_stmt, \OCI_BOTH + \OCI_RETURN_NULLS);
                break;
            case \PDO::FETCH_ASSOC:
                $rst = \oci_fetch_array($this->_stmt, \OCI_ASSOC + \OCI_RETURN_NULLS);
                $rst = $this->_fixResultKeys($rst);
                break;
            case \PDO::FETCH_NUM:
                $rst = \oci_fetch_array($this->_stmt, \OCI_NUM + \OCI_RETURN_NULLS);
                break;
            case \PDO::FETCH_OBJ:
                $rst = \oci_fetch_object($this->_stmt);
                break;
            }
            $this->_current = $rst;
            $this->_checkBinds();
        } catch (\Exception $e) {
            throw new \PDOException($e->getMessage());
        }
        restore_error_handler();
        return $rst;
    }
1320156
public function find( $table, $fields = null, $where = null, $order = null, $limit = null, $offset = null, $array = array (), $fetchMode = \PDO::FETCH_ASSOC )
     {
         // TODO: Implement find() method.
     }
168253
protected function proxy() {
        if (!$this->context) {
            $this->context = new SyncMapContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
488225
public function request($method = null)
    {
        if (! $this->uri instanceof Zend_Uri_Http) {
            /**
 * @see Zend_Http_Client_Exception 
*/
            include_once 'Zend/Http/Client/Exception.php';
            throw new Zend_Http_Client_Exception('No valid URI has been passed to the client');
        }

        if ($method) { $this->setMethod($method);
        }
        $this->redirectCounter = 0;
        $response = null;

        // Make sure the adapter is loaded
        if ($this->adapter == null) { $this->setAdapter($this->config['adapter']);
        }

        // Send the first request. If redirected, continue.
        do {
            // Clone the URI and add the additional GET parameters to it
            $uri = clone $this->uri;
            if (! empty($this->paramsGet)) {
                $query = $uri->getQuery();
                if (! empty($query)) { $query .= '&';
                }
                $query .= http_build_query($this->paramsGet, null, '&');

                $uri->setQuery($query);
            }

            $body = $this->_prepareBody();
            $headers = $this->_prepareHeaders();

            // Open the connection, send the request and read the response
            $this->adapter->connect(
                $uri->getHost(), $uri->getPort(),
                ($uri->getScheme() == 'https' ? true : false)
            );

            $this->last_request = $this->adapter->write(
                $this->method,
                $uri, $this->config['httpversion'], $headers, $body
            );

            $response = $this->adapter->read();
            if (! $response) {
                /**
 * @see Zend_Http_Client_Exception 
*/
                include_once 'Zend/Http/Client/Exception.php';
                throw new Zend_Http_Client_Exception('Unable to read response, or response is empty');
            }

            $response = Zend_Http_Response::fromString($response);
            if ($this->config['storeresponse']) { $this->last_response = $response;
            }

            // Load cookies into cookie jar
            if (isset($this->cookiejar)) { $this->cookiejar->addCookiesFromResponse($response, $uri);
            }

            // If we got redirected, look for the Location header
            if ($response->isRedirect() && ($location = $response->getHeader('location'))) {

                // Check whether we send the exact same request again, or drop the parameters
                // and send a GET request
                if ($response->getStatus() == 303 
                    || ((! $this->config['strictredirects']) && ($response->getStatus() == 302 
                    || $response->getStatus() == 301))
                ) {

                    $this->resetParameters();
                    $this->setMethod(self::GET);
                }

                // If we got a well formed absolute URI
                if (Zend_Uri_Http::check($location)) {
                    $this->setHeaders('host', null);
                    $this->setUri($location);

                } else {

                    // Split into path and query and set the query
                    if (strpos($location, '?') !== false) {
                        list($location, $query) = explode('?', $location, 2);
                    } else {
                        $query = '';
                    }
                    $this->uri->setQuery($query);

                    // Else, if we got just an absolute path, set it
                    if(strpos($location, '/') === 0) {
                        $this->uri->setPath($location);

                        // Else, assume we have a relative path
                    } else {
                        // Get the current path directory, removing any trailing slashes
                        $path = $this->uri->getPath();
                        $path = rtrim(substr($path, 0, strrpos($path, '/')), "/");
                        $this->uri->setPath($path . '/' . $location);
                    }
                }
                ++$this->redirectCounter;

            } else {
                // If we didn't get any location, stop redirecting
                break;
            }

        } while ($this->redirectCounter < $this->config['maxredirects']);

        return $response;
    }
531221
function loadWaiterConfig(state) {
    if (!this.service.api.waiters[state]) {
      throw new AWS.util.error(new Error(), {
        code: 'StateNotFoundError',
        message: 'State ' + state + ' not found.'
      });
    }

    this.config = AWS.util.copy(this.service.api.waiters[state]);
  }
470001
public function retrieveAuthorizationState($service)
	{
		if ($this->hasAuthorizationState($service)) {
			return $this->getSession()->get(self::SESSION_STATE_PREFIX . $service);
		}
		throw new AuthorizationStateNotFoundException('State not found in session, are you sure you stored it?');
	}
156433
protected function proxy() {
        if (!$this->context) {
            $this->context = new PhoneNumberContext(
                $this->version,
                $this->solution['trunkSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
574636
function popLoadingState(xhrEvent, stateName, modelOrCollection, context) {
        var currentLoads = getState(stateName, context);
        if (_.isArray(currentLoads)) {
            var i = currentLoads.indexOf(xhrEvent);
            while (i >= 0) {
                currentLoads.splice(i, 1);
                i = currentLoads.indexOf(xhrEvent);
            }
            if (!currentLoads.length) {
                var toSet = {};
                toSet[stateName] = undefined;
                setState(toSet, context);
            }
        }
    }
100341
public function getTransitionsByFinalState($stateName)
    {
        return array_filter(
            $this->transitions,
            function (Transition $transition) use ($stateName) {
                return $transition
                    ->getFinal()
                    ->getName() === $stateName;
            }
        );
    }