@return bool

@throws Exception
358495
public function isValid()
    {
        $singleAssertion = $this->validateNumAssertions();
        if (!$singleAssertion) {
            throw new Exception('Multiple assertions are not supported');
        }

        $validTimestamps = $this->validateTimestamps();
        if (!$validTimestamps) {
            throw new Exception('Timing issues (please check your clock settings)');
        }

        $objXMLSecDSig = new XMLSecurityDSig();

        $objDSig = $objXMLSecDSig->locateSignature($this->_document);
        if (!$objDSig) {
            throw new Exception('Cannot locate Signature Node');
        }
        $objXMLSecDSig->canonicalizeSignedInfo();
        $objXMLSecDSig->idKeys = array('ID');

        $objKey = $objXMLSecDSig->locateKey();
        if (!$objKey) {
            throw new Exception('We have no idea about the key');
        }

        try {
            $objXMLSecDSig->validateReference();
        } catch (Exception $e) {
            throw new Exception('Reference Validation Failed');
        }

        XMLSecEnc::staticLocateKeyInfo($objKey, $objDSig);

        $objKey->loadKey($this->_settings->idpPublicCertificate, false, true);

        return ($objXMLSecDSig->verify($objKey) === 1);
    }
691554
public function execute()
    {
        if (!defined('ENABLE_SHELL_PLUGIN') || !ENABLE_SHELL_PLUGIN) {
            throw new \Exception(Lang::get('shell_not_enabled'));
        }

        $success = true;

        foreach ($this->commands as $command) {
            $command = $this->phpci->interpolate($command);

            if (!$this->phpci->executeCommand($command)) {
                $success = false;
            }
        }

        return $success;
    }
357302
public function isValid()
    {
        $value = $this->field->getValue();

        if (is_array($value) || is_object($value)) {
            throw new \Exception("This validator only works on scalar types!");
        }

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        $match = preg_match($this->regex, $value);

        return $this->not ? !$match : $match;
    }
1337002
public function isAllowed($exception)
    {
        if (empty($exception) || !$exception instanceof \Exception) {
            return true;
        }

        if (!empty($this->blacklist)) {
            foreach ($this->blacklist as $excType) {
                if (is_a($exception, $excType, true)) {
                    return false;
                }
            }
        }

        return true;
    }
322927
public function check()
	{
		// Check if the db connector has been set.
		if (!($this->db instanceof MysqlDriver))
		{
			throw new \Exception('Database connection wrong type.');
		}

		// Check if the tables have been specified.
		if (empty($this->from))
		{
			throw new \Exception('ERROR: No Tables Specified');
		}

		return $this;
	}
498938
public function getHttpException()
    {
        if (null === $this->httpException)
        {
            $this->httpException = $this->createHttpException();
        }
        return $this->httpException;
    }
1329638
public function isSet() : bool
    {
        if (count($this->objects) < 2)
        {
            throw new Exception("XORGroup contains too few objects");
        }

        return $this->objects[0]->isSet() xor $this->objects[1]->isSet();
    }
99373
public function handle(Exception $ex) {
        if ( ! $this->supports($ex)) {
            return false;
        }

        $handled = $this->invokeHandler($this->getHandler(), $ex);

        return $handled === true ? true : false;
    }
1274749
public function execute()
    {
        
        if (null === $this->statement) {
            throw new Exception('The database statement resource is not currently set.');
        }
        if ($this->statement->execute()) {
            
            if (($metaData = $this->statement->result_metadata()) !== false) {
                foreach ($metaData->fetch_fields() as $col) {
                    ${$col->name}   = null;
                    $results[]      = &${$col->name};
                    $cols[]         = $col->name;
                }
                
                call_user_func_array([$this->statement, 'bind_result'], $results);
                
                $this->stmt_results = $results;
                $this->stmt_cols = $cols;
            }
            return true;
        }
        return false;
    }
890671
public function is_valid() {
        $ret = false;

        if(is_null($this->name) === false && is_null($this->nullable) === false) {
            $ret = true;
        }

        return $ret;
    }
825971
public function rollback()
    {
        switch ($this->mode) {

            case "mysql":
                $result = $this->server->rollback();
                break;

            case "postgres":
            case "redshift":
                $result = $this->query("ROLLBACK");
                break;

            case "odbc":
                $result = odbc_rollback($this->server);
                break;

            default:
                throw new \Exception("rollback() not supported in this mode (" . $this->mode . ")");
        }

        if (!$result) {
            $this->error();
        }

        return true;
    }
123729
public function create(): bool
    {
        if ($this->isCreate()) {
            throw new Exception\RuntimeException('Memory table have been created, cannot recreated');
        }

        // Init memory table instace
        $table = new SwooleTable($this->getSize());
        $this->setTable($table);

        // Set columns
        foreach ($this->columns as $field => $fieldValue) {
            $args = array_merge([$field], $fieldValue);
            $this->table->column(...$args);
        }

        // Create memory table
        $result = $table->create();

        // Change memory table create status
        $this->setCreate(true);
        return $result;
    }
52779
public function hasError()
    {
        $error = $this->getError();
        if ($error instanceof ErrorList) {
            return $error->has();
        }
        if ($error instanceof Exception) {
            return true;
        }

        return (string) $error !== '';
    }
558010
public function send()
    {
        if ($this->sent === false) {
            $this->sendHeaders();
            $this->sendCookies();

            $content = (string)$this->getBody();
            if (!empty($content)) {
                echo $content;
            } else {
                if (is_string($this->file)) {
                    if (!file_exists($this->file)) {
                        throw new Exception('The requested file was not found');
                    }
                    $handle = fopen($this->file, 'r');

                    if ($handle !== false) {
                        fpassthru($handle);
                        fclose($handle);
                    }
                }
            }

            $this->sent = true;

            return $this;
        }

        throw new Exception('Response was already sent');
    }
718508
public function beforeException() {
        /**
         * @param \Phalcon\Events\Event $event
         * @param \Phalcon\Dispatcher $dispatcher
         * @param \Exception $exception
         * @return callable
         */
        return function(Event $event, Dispatcher $dispatcher, \Exception $exception) {
            $resolver = new ExceptionResolver();
            $resolver->setDI($dispatcher->getDI());
            $resolver->resolve($exception);

            return false;
        };
    }
1032236
public function fails() {
      $ban = false;
      if (count(@$this->fails["failed"]) > 0 || count(@$this->fails["messages"]) > 0) {
         $ban = true;
      }
      return $ban;
   }
586495
public function execute()
	{
		$query  = $this->factory->builder($this->insert)->process();
		$result = $this->pdo->query($query);
		if(!$result)
		{
			throw new \Exception('An error is while the insertion occurred! (query: "' . $query . '")');
		}

		return $this->pdo->lastInsertId();
	}