{@inheritDoc}
@see \MyArtJaub\Webtrees\Module\DependentInterface::validatePrerequisites()
187603
public function validatePrerequisites() {
        try {
            Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
            return true;
        }
        catch (\Exception $ex) { }
        return false;
    }
906736
public static function spec(
        $constraints,
        $defaults = [],
        $required = [],
        $messages = []
    ) {
        return new static(
            Spec::define($constraints, $defaults, $required),
            $messages
        );
    }
1104089
private function validateClassicDependencies(array $subject, string $propertyName, array $dependentProperties): bool
    {
        if (\is_string($propertyName) && \is_array($dependentProperties)) {
            if (\array_key_exists($propertyName, $subject)) {
                foreach ($dependentProperties as $propertyName) {
                    if (\is_string($propertyName)
                        && !\array_key_exists($propertyName, $subject)
                    ) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
859089
private static function predefine() {
    if (!self::$predefined) {
      $message = ObjectFactory::getInstance('message');
      define('GENERAL_WARNING', serialize(['GENERAL_WARNING', ApplicationError::LEVEL_WARNING, 400,
        $message->getText('An unspecified warning occurred.')
      ]));
      define('GENERAL_ERROR', serialize(['GENERAL_ERROR', ApplicationError::LEVEL_ERROR, 500,
        $message->getText('An unspecified error occurred.')
      ]));
      define('GENERAL_FATAL', serialize(['GENERAL_FATAL', ApplicationError::LEVEL_FATAL, 500,
        $message->getText('An unspecified fatal error occurred.')
      ]));

      define('ACTION_INVALID', serialize(['ACTION_INVALID', ApplicationError::LEVEL_ERROR, 404,
        $message->getText('The requested action is unknown.')
      ]));
      define('SESSION_INVALID', serialize(['SESSION_INVALID', ApplicationError::LEVEL_ERROR, 401,
        $message->getText('The session is invalid.')
      ]));
      define('PARAMETER_MISSING', serialize(['PARAMETER_MISSING', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('One or more parameters are missing.')
      ]));
      define('PARAMETER_INVALID', serialize(['PARAMETER_INVALID', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('One or more parameters are invalid.')
      ]));
      define('OID_INVALID', serialize(['OID_INVALID', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('One or more object ids are invalid.')
      ]));
      define('CLASS_NAME_INVALID', serialize(['CLASS_NAME_INVALID', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('One or more classes are invalid.')
      ]));

      define('AUTHENTICATION_FAILED', serialize(['AUTHENTICATION_FAILED', ApplicationError::LEVEL_ERROR, 401,
        $message->getText('Authentication failed.')
      ]));
      define('PERMISSION_DENIED', serialize(['PERMISSION_DENIED', ApplicationError::LEVEL_ERROR, 403,
        $message->getText('The user does not have the permission to perform this action.')
      ]));

      define('LIMIT_NEGATIVE', serialize(['LIMIT_NEGATIVE', ApplicationError::LEVEL_WARNING, 400,
        $message->getText('The passed limit is a negative number.')
      ]));
      define('OFFSET_OUT_OF_BOUNDS', serialize(['OFFSET_OUT_OF_BOUNDS', ApplicationError::LEVEL_WARNING, 400,
        $message->getText('The passed offset is negative or greater than the number of entries matching the parameters.')
      ]));
      define('SORT_FIELD_UNKNOWN', serialize(['SORT_FIELD_UNKNOWN', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('The passed sortFieldName is no valid attribute of the passed class.')
      ]));
      define('SORT_DIRECTION_UNKNOWN', serialize(['SORT_DIRECTION_UNKNOWN', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('The passed sortDirection has an invalid value.')
      ]));

      define('DEPTH_INVALID', serialize(['DEPTH_INVALID', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('The passed depth is a negative number other than -1.')
      ]));

      define('ATTRIBUTE_NAME_INVALID', serialize(['ATTRIBUTE_NAME_INVALID', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('The attribute name passed cannot be found in the selected class.')
      ]));
      define('ATTRIBUTE_VALUE_INVALID', serialize(['ATTRIBUTE_VALUE_INVALID', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('The attribute value passed is invalid for the attribute.')
      ]));
      define('CONCURRENT_UPDATE', serialize(['CONCURRENT_UPDATE', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('The server detected a concurrent update.')
      ]));

      define('ROLE_INVALID', serialize(['ROLE_INVALID', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('The role passed cannot be found in the selected source class.')
      ]));
      define('ASSOCIATION_INVALID', serialize(['ASSOCIATION_INVALID', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('There is no association between the source and the target class.')
      ]));
      define('ASSOCIATION_NOT_FOUND', serialize(['ASSOCIATION_NOT_FOUND', ApplicationError::LEVEL_WARNING, 400,
        $message->getText('No current association matching the input parameters can be found.')
      ]));

      define('SEARCH_NOT_SUPPORTED', serialize(['SEARCH_NOT_SUPPORTED', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('There selected class does not support searching.')
      ]));

      define('ORDER_UNDEFINED', serialize(['ORDER_UNDEFINED', ApplicationError::LEVEL_WARNING, 400,
        $message->getText('There is no order defined for the root object.')
      ]));

      define('REFERENCE_INVALID', serialize(['REFERENCE_INVALID', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('There reference object cannot be found in the container object.')
      ]));
      define('ORDER_NOT_SUPPORTED', serialize(['ORDER_NOT_SUPPORTED', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('The container class does not support ordered references.')
      ]));

      define('CLASSES_DO_NOT_MATCH', serialize(['CLASSES_DO_NOT_MATCH', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('The classes of insertOid and referenceOid do not match.')
      ]));

      define('HISTORY_NOT_SUPPORTED', serialize(['HISTORY_NOT_SUPPORTED', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('There selected class does not support history.')
      ]));

      define('OBJECT_IS_LOCKED', serialize(['OBJECT_IS_LOCKED', ApplicationError::LEVEL_ERROR, 400,
        $message->getText('The object is currently locked by another user.')
      ]));

      self::$predefined = true;
    }
  }
778302
public function prereqAction()
    {
        $prereqs = $this->plugin('Install/Prerequisites')->check();

        $model = $this->createViewModel(array('prerequisites' => $prereqs), true);
        $model->setTemplate('install/index/prerequisites.ajax.phtml');

        return $model;
    }
272992
static function checkRequiredParametersAreSet(array $given, array $required)
    {
        foreach ($required as $key) {
            if (empty($given[$key])) {
                throw new MissingRequiredParameterException(
                        "Missing required parameter '$key'"
                );
            }
        }
    }
924718
public function requirements()
    {
        if (!$this->_step('language')) {
            $this->redirect(['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'language']);
        }

        $tests = $this->_getTester();
        $errors = $tests->errors();

        if (empty($errors)) {
            $this->_step();
        }

        $this->title(__d('installer', 'Server Requirements'));
        $this->set('errors', $errors);
    }
328764
public function checkDependencies(array $requiredBundles, ContainerBuilder $container)
    {
        if (false === ($this instanceof Bundle)) {
            throw new RuntimeException('It is a bundle trait, you shouldn\'t have to use in other instances');
        }

        $enabledBundles = $container->getParameter('kernel.bundles');
        foreach ($requiredBundles as $requiredBundle) {
            if (!isset($enabledBundles[$requiredBundle])) {
                throw new RuntimeException(
                    sprintf(
                        'In order to use "%s" you also need to enable and configure the "%s"',
                        $this->getName(),
                        $requiredBundle
                    )
                );
            }
        }
    }
486441
public function addRequirements(array $requirements)
    {
        foreach ($requirements as $key => $regex) {
            $this->requirements[$key] = $this->sanitizeRequirement($key, $regex);
        }
        $this->compiled = null;

        return $this;
    }
240947
public function checkDependentModules($module_id, array $modules)
    {
        unset($modules[$module_id]);

        $required_by = array();

        foreach ($modules as $info) {

            if (empty($info['dependencies'])) {
                continue;
            }

            foreach (array_keys($info['dependencies']) as $dependency) {
                if ($dependency === $module_id && !empty($info['status'])) {
                    $required_by[] = $info['name'];
                }
            }
        }

        if (empty($required_by)) {
            return true;
        }

        throw new UnexpectedValueException($this->translation->text('Required by') . ': ' . implode(', ', $required_by));
    }
305290
public function verifyRequirements()
    {
        $this->findRequiredFiles($this->requirements->getRequiredFiles());
        $this->findRequiredTokens(new FunctionFinder(), $this->requirements->getRequiredFunctions());
        $this->findRequiredTokens(new ClassFinder(), $this->requirements->getRequiredClasses());
        $this->findRequiredTokens(new LangFinder(), [$this->requirements->getRequiredStrings()]);
        $this->findRequiredTokens(new CapabilityFinder(), [$this->requirements->getRequiredCapabilities()]);
        $this->findRequiredTokens(new TableFinder(), [$this->requirements->getRequiredTables()]);
        $this->findRequiredTokens(new TablePrefixFinder(), [$this->requirements->getRequiredTablePrefix()]);
        $this->findRequiredTokens(new BehatTagFinder(), $this->requirements->getRequiredBehatTags());
    }
89954
public static function validateRequirements()
    {

        $requirements = array(
            'version' => '',
            'spl' => '',
            'curl' => '',
            'dom' => ''
        );

        $version = str_replace('.', '', phpversion());

        if ($version < 5427) {
            $requirements['version'] = 'PagSeguroLibrary: PHP version 5.4.27 or greater is required.';
        }

        if (!function_exists('spl_autoload_register')) {
            $requirements['spl'] = 'PagSeguroLibrary: Standard PHP Library (SPL) is required.';
        }

        if (!function_exists('curl_init')) {
            $requirements['curl'] = 'PagSeguroLibrary: cURL library is required.';
        }

        if (!class_exists('DOMDocument')) {
            $requirements['dom'] = 'PagSeguroLibrary: DOM XML extension is required.';
        }

        return $requirements;
    }
1127372
public function setRequiredProperties(array $required)
    {
        if (empty($required)) {
            return $this;
        }

        if (isset($required[0]) && $required[0] === '*') {
            $this->required = get_object_vars($this);
            $this->allRequired = true;
        } else {
            $this->required = $required;
        }

        unset($this->required['required'],
              $this->required['requiredTypes'],
              $this->required['ignored'],
              $this->required['requiredParsed'],
              $this->required['allRequired']);

        return $this;
    }
1106705
private function validateShippedDependencies(
        PluginEntity $plugin,
        array $pluginRequirements,
        RequirementExceptionStack $exceptionStack
    ): array {
        if ($plugin->getManagedByComposer()) {
            return $pluginRequirements;
        }

        $vendorDir = $this->pluginComposer->getConfig()->get('vendor-dir');
        if (!is_dir($vendorDir)) {
            return $pluginRequirements;
        }

        $pluginRequirements = $this->checkComposerDependencies(
            $pluginRequirements,
            $exceptionStack,
            $this->pluginComposer
        );

        return $pluginRequirements;
    }
1249263
public function determineDependents($input, array &$required)
    {
        if ($this->hasError()) {
            return;
        }
        $this->lastValue = $input;

        // check all simple dependents
        $foundRequired = false;
        foreach ($this->dependent as $onInput => $requiredNames) {
            if ($onInput === '*') {
                continue;
            }
            elseif ($input === $onInput) {
                $foundRequired = true;
                foreach ($requiredNames as $attribName) {
                    $required[$attribName] = true;
                }
            }
        }

        // the default dependent does apply if no simple were found and input is given (not empty)
        if ($input && !$foundRequired && isset($this->dependent['*'])) {
            foreach ($this->dependent['*'] as $attribName) {
                $required[$attribName] = true;
            }
        }

        // apply regex dependent
        foreach ($this->dependentRegex as $onRegex => $requiredNames) {
            if (preg_match($onRegex, $input)) {
                foreach ($requiredNames as $attribName) {
                    $required[$attribName] = true;
                }
            }
        }
    }
44508
protected function verifyConditionalRequirements()
    {
        if (!isset($this->requiredFieldsConditional)) {
            return;
        }

        $fields = $this->requiredFieldsConditional->getArrayCopy();

        foreach ($fields as $fieldName => $fieldDependencies) {
            if (!isset($this->$fieldName)) {
                continue;
            }

            foreach ($fieldDependencies as $fieldValue => $fieldDependency) {
                if (is_array($fieldDependency)) {
                    if ($this->$fieldName != $fieldValue) {
                        continue;
                    }

                    foreach ($fieldDependency as $field) {
                        if (empty($this->$field)) {
                            $fieldValue =
                                is_bool($this->$fieldName)
                                    ? var_export($this->$fieldName, true)
                                    : $this->$fieldName;

                            throw new \Genesis\Exceptions\ErrorParameter(
                                sprintf(
                                    '%s with value %s is depending on: %s, which is empty (null)!',
                                    $fieldName,
                                    $fieldValue,
                                    $field
                                )
                            );
                        }
                    }
                } elseif (empty($this->$fieldDependency)) {
                    throw new \Genesis\Exceptions\ErrorParameter(
                        sprintf(
                            '%s is depending on: %s, which is empty (null)!',
                            $fieldName,
                            $fieldDependency
                        )
                    );
                }
            }
        }
    }
110583
public function setRequired($required)
    {
        if (!in_array(
            $required,
            [
                \Parable\Console\Parameter::PARAMETER_REQUIRED,
                \Parable\Console\Parameter::PARAMETER_OPTIONAL,
            ]
        )) {
            throw new \Parable\Console\Exception('Required must be one of the PARAMETER_* constants.');
        }
        $this->required = $required;
        return $this;
    }