Should be called after answering the request to allow the Target
to check if all required registry values have been set correctly.

@return boolean False if required are missing.
507808
public function checkRegistryRequestsAnswers()
    {
        if ($this->db && (! $this->_gemsSurvey)) {
            $result = $this->db->fetchRow("SELECT * FROM gems__surveys WHERE gsu_id_survey = ?", $this->_surveyId);
            if ($result) {
                $this->_gemsSurvey = $result;
                $this->exists = true;
            } else {
                //Row not present, try with empty array? or should we throw an error?
                $this->_gemsSurvey = array(
                    'gsu_code'             => null,
                    'gsu_valid_for_length' => 6,
                    'gsu_valid_for_unit'   => 'M',
                    );
                $this->exists = false;
            }
        }

        return (boolean) $this->_gemsSurvey;
    }
271725
public function validate(): bool
    {
        if (! $this->requestIsValid()) {
            return false;
        }

        $requestOptions = $this->getDefaultRequestOptions();
        $customOptions = $this->getCustomRequestOptions();

        if (! empty($customOptions) && is_array($customOptions)) {
            $requestOptions = array_merge($requestOptions, $customOptions);
        }

        $response = $this->guzzleClient->request('POST', self::OPENID_URL, $requestOptions);

        $results = $this->parseResults($response->getBody()->getContents());

        $this->parseSteamID();
        $this->parseInfo();

        return $results->is_valid == 'true';
    }
1318585
public function isValid()
    {
        $data = $this->toArray();

        $missing = array_diff(self::$REQUIRED_FIELDS, array_keys($data));

        if ($missing) {
            throw new \InvalidArgumentException('Config is missing the following keys: ' . implode(', ', $missing));
        }

        return true;
    }
399915
public function afterRegistry()
    {
        parent::afterRegistry();

        if (! $this->menuActionController) {
            $this->menuActionController = $this->request->getControllerName();
        }
    }
117987
public function checkRequiredTables() {
        if ($this->requiredTables) {
            $this->out(sprintf('The following tables are required: <info>%s</info>', implode(', ', $this->requiredTables)));
            $this->out('<success>Checking tables...</success>');

            $tables = $this->db->listSources();
            $missing = array();

            foreach ($this->requiredTables as $table) {
                if (!in_array($this->db->config['prefix'] . $table, $tables)) {
                    $missing[] = $table;
                }
            }

            if ($missing) {
                $this->err(sprintf('<error>Missing tables %s; can not proceed</error>', implode(', ', $missing)));
                return false;
            }
        }

        $this->out('<success>Table status good, proceeding...</success>');
        return true;
    }
953963
public function isAppReadyToInstall() {
		$checkPHPversion = $this->checkPhpVersion();
		if ($checkPHPversion === false) {
			return false;
		}

		$checkPHPextensions = $this->checkPhpExtensions(true);
		if ($checkPHPextensions === false) {
			return false;
		}

		return true;
	}
669876
public function hasPhpConfigIssue()
    {
        foreach ($this->requirements as $req) {
            if (!$req->isFulfilled() && $req instanceof PhpConfigRequirement) {
                return true;
            }
        }

        return false;
    }
812452
public function needsToBeCaptured()
    {
        if (!$this->shouldBeCaptured()) {
            return false;
        }

        // computes the most recently completed period
        $mostRecentPeriod = $this->nthPreviousPeriod(1);

        // computes the start date for the most recently completed period
        $latestStartDate = date('Y-m-d', $mostRecentPeriod[ 'start' ]);

        // check if the metric has been saved before
        return Statistic::totalRecords([
            'metric' => $this->key(),
            'day' => $latestStartDate, ]) == 0;
    }
195582
public static function are_requirements_met() {
        if (self::$requirementsmet === null) {
            $requirementsmet = self::test_unoconv_path()->status === self::UNOCONVPATH_OK;
            $requirementsmet = $requirementsmet && self::is_minimum_version_met();
            self::$requirementsmet = $requirementsmet;
        }

        return self::$requirementsmet;
    }
493773
protected function areRequirementsMet(): bool
    {
        return (bool) $this->uses = ClassHelper::getTraitUsePointers($this->getFile(), $this->getStackPos());
    }
91085
public function check() {
		foreach ( $this->requirements as $requirement ) {
			// Match against config.
			$requirementFulfilled = $this->requirementIsFulfilled( $requirement );

			if ( $requirementFulfilled ) {
				continue;
			}

			$this->addMissingRequirementMessage( $requirement );
		}
	}
178091
protected function checkRequired()
    {
        $errors = new Exceptions();
        foreach ($this->getRequiredKeys() as $required) {
            if (!isset($this->$required)) {
                $errors->add(new Exception('Required property "' . $required . '" is missing'));
            }
        }
        if (!$errors->empty()) {
            throw $errors;
        }
        return true;
    }
1280049
protected function isRegistrationEnabled()
    {
        $router = $this->container->get('router');

        if (get_class($router) == 'JMS\I18nRoutingBundle\Router\I18nRouter') {
            $routes = $router->getOriginalRouteCollection();
        } else {
            $routes = $router->getRouteCollection();
        }

        return (null !== $routes->get('fos_user_registration_register'));
    }
827669
public function verify()
    {
        if (!$this->_config['enable']) {
            return true;
        }

        $controller = $this->_registry->getController();
        if ($controller->request->getData('g-recaptcha-response')) {
            $response = json_decode($this->apiCall());

            if (isset($response->success)) {
                return $response->success;
            }
        }

        return false;
    }
718860
public function afterRegistry()
    {
        parent::afterRegistry();

        $this->addColumn($this->util->getTokenData()->getStatusExpression(), 'status');

        if (! $this->request instanceof \Zend_Controller_Request_Abstract) {
            $this->request = \Zend_Controller_Front::getInstance()->getRequest();
        }
    }
73020
public function checkRegistryRequestsAnswers()
    {

        if (! $this->organizationId) {
            if ($this->respondent) {
                $this->organizationId = $this->respondent->getOrganizationId();
            }
            if (! $this->organizationId) {
                $this->organizationId = $this->request->getParam(\MUtil_Model::REQUEST_ID2);
            }
        }

        if ($this->organizationId && (! $this->respondentId)) {
            if ($this->respondent) {
                $this->respondentId = $this->respondent->getId();
            }
            if (! $this->respondentId) {
                $this->respondentId = $this->util->getDbLookup()->getRespondentId(
                        $this->request->getParam(\MUtil_Model::REQUEST_ID1),
                        $this->organizationId
                        );
            }
        }

        return $this->organizationId && $this->respondentId && $this->db && $this->model;
    }
155284
public function checkRegistryRequestsAnswers()
    {
        if ((! $this->userId) && $this->currentUser) {
            $this->userId = $this->currentUser->getUserId();
        }
        return $this->loader && $this->request && parent::checkRegistryRequestsAnswers();
    }