TODO

@return bool
507639
public function allTrue()
    {
        if (is_array($this->result)) {
            foreach ($this->result as $item) {
                if ($item === false) {
                    return false;
                }
            }
            return true;
        }

        return $this->result === true;
    }
717070
public function exists()
    {
        $limit = $this->limit;

        $result = $this->limit(1)->count() > 0;

        $this->limit($limit);

        return $result;
    }
219164
public function valid(): bool
    {
        if (!$this->isUsed) {
            $this->call
                ->addIterableEvent($this->callEventFactory->createUsed());
            $this->isUsed = true;
        }

        $key = key($this->array);
        $isValid = null !== $key;

        if ($this->isConsumed) {
            return $isValid;
        }

        if ($isValid) {
            $this->call->addIterableEvent(
                $this->callEventFactory
                    ->createProduced($key, current($this->array))
            );
        } else {
            $this->call->setEndEvent($this->callEventFactory->createConsumed());
            $this->isConsumed = true;
        }

        return $isValid;
    }
396350
public function validate()
    {
        $result = true;
        $this->errors = [];
        $data = $this->get();

        foreach ($this->requiredFields as $requiredField) {
            if (!isset($data[$requiredField])) {
                $result = false;
                $this->errors[$requiredField] = 'cannot be empty';
            }
        }

        foreach ($data as $fieldName => $fieldValue) {
            if (!array_key_exists($fieldName, $this->errors) && $fieldValue !== null && !is_string($fieldValue)) {
                $this->errors[$fieldName] = 'should be a string';
            }
        }

        return $result;
    }
1137208
public function isTracking()
	{
		if($this->isTracking === false) {
			return false;
		}

		if(!Resque::redis()->exists((string)$this)) {
			$this->isTracking = false;
			return false;
		}

		$this->isTracking = true;
		return true;
	}
547982
public function has()
    {
        if (!Request::has('position')) {
            return false;
        }

        if (isset($this->item->position)) {
            return true;
        }

        if (!empty($this->pivot) && isset($this->pivot->position)) {
            return true;
        }

        return false;
    }
1332427
public function execute()
    {
        if ($this->validate()) {
            $this->_result = static::perform(static::operation(), $this->getAttributes());

            return true;
        }

        return false;
    }
70656
public function validate(): bool
    {
        $this->errors = new ValidationErrors;

        $validator = $this->getValidator();
        $value = $this->getValue();

        try {
            $result = $validator($value);
            if (!$result) {
                $this->errors[] = new ValidationError($this, $value);
            }
        } catch (Exceptions $errors) {
            foreach ($errors as $error) {
                $this->errors[] = new ValidationError($this, $value, $error->getMessage(), $error->getCode(), $error);
            }
        } catch (\Throwable $error) {
            $this->errors[] = new ValidationError($this, $value, $error->getMessage(), $error->getCode(), $error);
        }

        return $this->errors->empty();
    }
1246525
public function next() {
		$value = next($this->_data);
		return key($this->_data) !== null ? $value : false;
	}
194443
public function valid()
    {
        if ($this->_buffer->offsetExists($this->_index)) {
            $current = $this->_buffer->offsetGet($this->_index);
            $this->_current = $current['value'];
            $this->_key = $current['key'];

            return true;
        }

        $valid = parent::valid();

        if ($valid) {
            $this->_current = parent::current();
            $this->_key = parent::key();
            $this->_buffer->push([
                'key' => $this->_key,
                'value' => $this->_current
            ]);
        }

        $this->_finished = !$valid;

        return $valid;
    }
816952
public function execute()
    {
        $stmt = $this->pdo->prepare($this->build());

        if ($stmt->execute($this->getValues())) {
            $this->rowCount = $stmt->rowCount();

            return $stmt;
        } else {
            return false;
        }
    }
1293044
public function validate()
    {
        $validator = Validator::make($this->toArray(), $this->rules,
            $this->messages);
        if ($validator->fails()) {
            $this->errors = $validator->messages();

            return false;
        } else return true;
    }
1133528
public function process()
    {
        if (!$this->_processed) {
            $this->_process();
            $this->_resolve();
        }
        $this->_processed = true;
        return $this->_passed !== false;
    }
1126945
public function getIsComplete ()
		{
			if ($this->_isComplete)
				return true;

			for ($i = 1; $i <= $this->_params[ 'totalChunks' ]; $i++)
			{
				if (!$this->chunkIsUploaded($i))
				{
					$this->_isComplete = false;

					return false;
				}
			}

			$this->_isComplete = true;

			return true;
		}
93463
public function validate(): bool
    {
        $valid = true;
        foreach ($this->_responses as $key => $response) {
            if ($response === null) {
                continue;
            }
            if (!$response->validate()) {
                $valid = false;
            }
        }
        return $valid && empty($this->_errors);
    }
137268
public function validate()
    {
        if (!parent::validate()) {
            return false;
        }
        if ($this->hasPaymentToken()) {
            if ($this->hasPaymentMethodId()) {
                $this->setValidationError('Both paymentToken and paymentMethodID values are specified');
                return false;
            }
            if ($this->hasPaymentMethodData()) {
                $this->setValidationError('Both paymentToken and paymentData values are specified');
                return false;
            }
        } elseif ($this->hasPaymentMethodId()) {
            if ($this->hasPaymentMethodData()) {
                $this->setValidationError('Both paymentMethodID and paymentData values are specified');
                return false;
            }
        }
        return true;
    }
314682
public function check()
    {
        $pass = true;
        foreach ($this->_rules as $rule) {
            if ($rule->lhs() instanceof BasePackage) {
                $package = $rule->lhs();
            } else {
                $package = PackageFactory::create((string)$rule->lhs());
            }

            if (!$package->versionMatch($rule->rhs())) {
                $this->_fail($rule);
                $pass = false;
            } else {
                $this->_pass($rule);
            }
        }

        $this->_checked = true;

        return $pass;
    }