checks for the minimum required credentials

@return bool
175620
private function hasMinimumCredentials(): bool {
        if (!isset($this->credentials["servername"])) {
            return false;
        }
        if (!isset($this->credentials["username"])) {
            return false;
        }
        if (!isset($this->credentials["password"])) {
            return false;
        }
        if (!isset($this->credentials["dbname"])) {
            return false;
        }
        return true;
    }
1173488
private function validateRequirements()
    {
        // enough options to proceed
        if(!$this->option('all')) {
            $enoughOptions = false;
            foreach ($this->defaultsOptions as $app => $nr) {
                if($this->option($app)) {
                    $enoughOptions = true;
                    break;
                }
            }

            if(!$enoughOptions) {
                $this->error('No options given! Write --all=1 to create dummy for all default apps, or write --{APP NAME}={NUMBER OF DUMMIES TO CREATE} to proceed!');
                return false;
            }
        }

        // Ensure there is at least one user
        if(!User::count()) {
            $this->error('No Users found. Create a user with "make:user {email} {password}" command to proceed!');
            return false;
        }

        // Ensure there is at least one langauge
        if(!Language::count()) {
            $this->error('No languages found. Create a langauge manually via Admin interface to proceed!');
            return false;
        }

        return true;
    }
986694
protected function getCredentials()
    {
        // Database credentials.
        $credentialArgs = [
            '--host=%s --port=%s --user=%s --password=%s %s',
            escapeshellarg($this->config['host']),
            escapeshellarg($this->config['port']),
            escapeshellarg($this->config['user']),
            escapeshellarg($this->config['pass']),
            escapeshellarg($this->config['database']),
        ];
        return call_user_func_array('sprintf', $credentialArgs);
    }
1069676
protected function validateRequirementsInstall()
    {
        if ($this->isExcluded('requirements')) {
            return null;
        }

        if ($this->config->isInitialized()) {
            $error = $this->translation->text('System already installed');
            $this->setError('installed', $error);
            return false;
        }

        $requirements = $this->install->getRequirements();
        $errors = $this->install->getRequirementErrors($requirements);

        if (empty($errors['danger'])) {
            return true;
        }

        $messages = array();
        $messages[] = $this->translation->text('Please fix all critical errors in your environment');

        foreach ($requirements as $items) {
            foreach ($items as $name => $info) {
                if (in_array($name, $errors['danger'])) {
                    $status = empty($info['status']) ? $this->translation->text('No') : $this->translation->text('Yes');
                    $messages[] = " {$info['message']} - $status";
                }
            }
        }

        $this->setError('requirements', implode(PHP_EOL, $messages));
        return false;
    }
1148820
function validateIsRequired()
    {
        $classAttribute = $this->contentClassAttribute();
        $validationParameters = $this->validationParameters();
        if ( !( isset( $validationParameters['skip-isRequired'] ) && $validationParameters['skip-isRequired'] === true ) && $classAttribute->attribute( "is_required" ) )
            return true;

        return false;
    }
930997
public function check(): bool
    {
        $auth = $this->parseAuthenticationConfiguration(\config('auth'));

        try {
            $this->description = Str::replace($this->description, ['model' => $auth['provider']['model']]);

            return $this->validateUserProvider($auth) && $this->validateUserInstance($auth);
        } catch (ReflectionException $e) {
            // Catch ReflectionException and return false.
        } finally {
            // Catch any exception.
        }

        return false;
    }
189254
public function checkAccess()
    {
        $user = \Yii::$app->user->identity;

        if (method_exists($user, 'getIsAdmin')) {
            return $user->getIsAdmin();
        } else if ($this->adminPermission) {
            return \Yii::$app->user->can($this->adminPermission);
        } else {
            return isset($user->username) ? in_array($user->username, $this->admins) : false;
        }
    }
84600
public function check()
    {
        $result = true;

        $configurationSettings = [
            'Database.Host',
            'Database.Username',
            'Database.Password',
            'Database.Port',
            'Database.Name',
        ];

        foreach ($configurationSettings as $setting) {
            if ($this->configuration->hasConfigurationKey($setting) === false) {
                $this->missingConfiguration[] = $setting;
                $result = false;
            }
        }

        return $result;
    }
955415
public function isRequired(): bool
    {
        foreach ($this->validationRules as $rule) {
            if ($rule instanceof Required) {
                return true;
            }
        }

        return false;
    }
1188006
public function check()
    {
        if ($this->_session->has('auth')) {
            // They have an auth, let's attempt to check expiration
            // and master session
            $s = [
                'session' => $this->_session->get('SCARA_SESSION'),
                'token'   => $this->_session->get('SCARA_SESSION_TOKEN'),
            ];

            $ua = $this->_ssl->untokenize($s['token'], $s['session']);

            if ($ua === hash('sha256', $_SERVER['HTTP_USER_AGENT'])) {
                $expire = $this->_session->get('expire');
                if (time() < $expire) {
                    return true;
                } else {
                    $this->logout();
                }
            }
        }

        return false;
    }
698298
public function isCredentialsNonExpired()
    {
        if (true === $this->credentialsExpired) {
            return false;
        }

        if (null !== $this->credentialsExpireAt && $this->credentialsExpireAt->getTimestamp() < time()) {
            return false;
        }

        return true;
    }
295467
public function credential()
    {
        if (!$username = $this->username()) {
            return '';
        }
        $credentials = $username;
        if ($password = $this->password()) {
            $credentials .= ':' . $password;
        }
        return $credentials;
    }
712602
protected function checkAccountInformation()
    {
        $errors = [];

        if (!Request::$post->get('username')) {
            $errors[] = "Username is required";
        }

        if (strlen(Request::$post->get('username')) < 3) {
            $errors[] = "Username must be at least 3 characters long";
        }

        if (!Request::$post->get('password')) {
            $errors[] = "Password is required";
        }

        if (strlen(Request::$post->get('password')) < 6) {
            $errors[] = "Password must be at least 6 characters long";
        }

        if (!Request::$post->get('email')) {
            $errors[] = "Email is required";
        }

        if (count($errors)) {
            $this->title("Admin Account");
            return $this->render("steps/account_information.phtml", [
                'errors' => $errors
            ]);
        }

        $_SESSION['admin'] = [
            'username'         => Request::$post->get('username'),
            'password'         => Request::$post->get('password'),
            'confirm_password' => Request::$post->get('password'),
            'email'            => Request::$post->get('email')
        ];
    }
369412
protected function shouldSkipAuth()
    {
        $config = b8\Config::getInstance();
        $state = (bool)$config->get('phpci.authentication_settings.state', false);
        $userId    = $config->get('phpci.authentication_settings.user_id', 0);

        if (false !== $state && 0 != (int)$userId) {
            $user = b8\Store\Factory::getStore('User')
                ->getByPrimaryKey($userId);

            if ($user) {
                $_SESSION['phpci_user'] = $user;
                return true;
            }
        }

        return false;
    }
984764
public function validate(array $credentials = [])
    {
        if (empty($credentials[$this->inputKey])) {
            return false;
        }

        $credentials = [$this->storageKey => $credentials[$this->inputKey]];

        if ($this->provider->retrieveByCredentials($credentials)) {
            return true;
        }

        return false;
    }
396859
private function validateLowerThan(): bool
    {
        if ($this->options['max'] !== null) {
            if ($this->options['inclusive'] === false && $this->value >= $this->options['max']) {
                $this->setError(self::VALIDATOR_ERROR_NUMBER_MUST_BE_LOWER_THAN_MAX);
                return false;
            }

            if ($this->value > $this->options['max']) {
                $this->setError(self::VALIDATOR_ERROR_NUMBER_MUST_BE_LOWER_OR_EQUAL_TO_MAX);
                return false;
            }
        }
        return true;
    }
820750
protected boolean needsToLoadCredentials() {
        if (credentials == null) return true;

        if (credentialsExpiration != null) {
            if (isWithinExpirationThreshold()) return true;
        }

        if (lastInstanceProfileCheck != null) {
            if (isPastRefreshThreshold()) return true;
        }

        return false;
    }