Logs a result.

@param  boolean $boolean Set `true` for success and `false` for failure.
@param  array   $data    Test details array.
@return boolean
7417
protected function _log($boolean, $data = [])
    {
        $not = $this->_not;
        $pass = $not ? !$boolean : $boolean;
        if ($pass) {
            $data['type'] = 'passed';
        } else {
            $data['type'] = 'failed';
            $this->_passed = false;
        }

        $description = $data['description'];
        if (is_array($description)) {
            $data['data'] = $description['data'];
            $data['description'] = $description['description'];
        }
        $data += ['backtrace' => Debugger::backtrace()];
        $data['not'] = $not;

        $this->_logs[] = $data;
        $this->_not = false;
        return $boolean;
    }
950544
private static function encodeBoolean($bool)
    {
        if ($bool)
        {
            return self::encodeFirstByte(MajorType::SIMPLE_AND_FLOAT, AdditionalType::SIMPLE_TRUE);
        }
        else
        {
            return self::encodeFirstByte(MajorType::SIMPLE_AND_FLOAT, AdditionalType::SIMPLE_FALSE);
        }
    }
145514
public function setSuperAdmin($boolean)
    {
        if (true === $boolean) {
            $this->addRole(static::ROLE_SUPER_ADMIN);
        } else {
            $this->removeRole(static::ROLE_SUPER_ADMIN);
        }

        return $this;
    }
1001988
public static function finalise_log(bool $failed = false) {
        global $CFG, $DB, $PERF;

        if (!self::should_log()) {
            return;
        }

        if (!self::is_capturing()) {
            // Not capturing anything.
            return;
        }

        // Ensure that all logs are closed.
        $buffers = ob_get_status(true);
        foreach (array_reverse($buffers) as $ob) {
            if (null !== self::$oblevel) {
                if ($ob['level'] <= self::$oblevel) {
                    // Only close as far as the initial output buffer level.
                    break;
                }
            }

            // End and flush this buffer.
            ob_end_flush();

            if ('core\\task\\logmanager::add_line' == $ob['name']) {
                break;
            }
        }
        self::$oblevel = null;

        // Flush any remaining buffer.
        self::flush();

        // Close and unset the FH.
        fclose(self::$fh);
        self::$fh = null;

        if ($failed || empty($CFG->task_logmode) || self::MODE_ALL == $CFG->task_logmode) {
            // Finalise the log.
            $loggerclass = self::get_logger_classname();
            $loggerclass::store_log_for_task(
                self::$task,
                self::$logpath,
                $failed,
                $DB->perf_get_reads() - self::$taskloginfo->dbread,
                $DB->perf_get_writes() - self::$taskloginfo->dbwrite - $PERF->logwrites,
                self::$taskloginfo->timestart,
                microtime(true)
            );
        }

        // Tidy up.
        self::$logpath = null;
        self::$taskloginfo = null;
    }
324832
function setDebug($bool)
    {
        $this->dbug = (boolean) $bool;
        $this->cfs_http->setDebug($this->dbug);
    }
1325111
public function update($table, $data = false)
    {
        if ($data == false) {
            $data = $table;
        } else {
            $this->table($table);
        }

        // Escape SQL 
        foreach ($data as $key => $value) {
            $data[$key] = $this->quote($value);
        }

        $this->queryCompiler->getQuery()->update($data);

        $this->queryCompiler->compile('update');

        return $this->getResult('get');
    }
526828
public function toSqlBoolean(bool $boolean, Provider $provider = null)
    {
        $this->setParameterProvider($provider);

        return $provider->convertToSqlBoolean($boolean);
    }
661039
public function setSatisfied($bool = true)
    {
        $storage = $this->getStorage()->read() ?: [];
        $storage['is_satisfied'] = $bool;
        $this->getStorage()->write($storage);

        return $this;
    }
290635
public function login(array $data, $check_password = true)
    {
        $result = array();
        $this->hook->attach('user.login.before', $data, $check_password, $result, $this);

        if (!empty($result)) {
            return (array) $result;
        }

        if (empty($data['email'])) {
            return $this->getResultErrorLogin();
        }

        $user = $this->user->getByEmail($data['email']);

        if (empty($user['status'])) {
            return $this->getResultErrorLogin();
        }

        if ($check_password && (!isset($data['password']) || !$this->user->passwordMatches($data['password'], $user))) {
            return $this->getResultErrorLogin();
        }

        $this->session->regenerate(true);
        $this->session->set('user', $user);

        $result = $this->getResultLogin($user);
        $this->hook->attach('user.login.after', $data, $check_password, $result, $this);

        return (array) $result;
    }
798610
public function success($message = null, $data = array(), $return = false)
    {
        if (!empty($data)) {
            foreach ($data as $key => $value) {
                $this->add($key, $value);
            }
        }
        $json = $this->jsonEncode(
            array(
                'success' => true,
                'message' => $message,
                'data' => $this->_data,
            )
        );
        if (!$return) {
            echo $json;
            Yii::app()->end();
        } else {
            return $json;
        }
    }
113633
protected function checkReturn(array $booleans):bool{

		foreach($booleans as $bool){

			if(!(bool)$bool){
				return false; // @codeCoverageIgnore
			}

		}

		return true;
	}
970089
static function createBooleanElement( $boolean, $variablePlacement = false )
    {
        if ( !is_bool( $boolean ) )
            $boolean = (bool)$boolean;
        return array( eZTemplate::TYPE_BOOLEAN,
                      $boolean, $variablePlacement );
    }
892215
public function success($message, $data=null){
        is_object($data) && $data = (array)$data;
        $return = ['success' => true, 'message' => $message, 'data'=>$data];
        return $return;
    }
1259966
public function statsOnly(bool $bool = true): Compare
    {
        $this->stats = $this->useOption('--numstat', $bool);
        return $this;
    }
699133
func (v *Value) Boolean() (bool, error) {
	var valid bool

	// Check the type of this data
	switch v.data.(type) {
	case bool:
		valid = true
		break
	}

	if valid {
		return v.data.(bool), nil
	}

	return false, ErrNotBool
}
505439
public function add($data, $sqlQuery = false)
    {
        if(!is_array($data) || count($data) == 0) {
            echo 'no data to save'; //no argument
            exit;
        }
        $sql = $this->buildQuery('insert', $data);
        if($sqlQuery === true) {
            return $this->getQuery();
        }
        $result = $this->executeQuery($sql);
        return $result;
    }
398845
public function log($type = null, $data = [])
    {
        if (!func_num_args()) {
            return $this->_log;
        }
        $this->report($type, $this->log()->add($type, $data));
    }