Validates a prototype object

@param  stdClass $prototype object prototype
@return boolean  true if prototype is valid
764383
protected function isPrototypeSchemaValid(stdclass $prototype)
    {
        foreach ($prototype as $method => $args) {
            if (! is_array($args)) {
                return false;
            }
        }

        return true;
    }
494507
public function isValid()
    {
        foreach ($this->objects as $fileInfo) {
            // Before validation callback
            $this->applyCallback('beforeValidation', $fileInfo);

            // Check is uploaded file
            if ($fileInfo->isUploadedFile() === false) {
                $this->errors[] = sprintf(
                    '%s: %s',
                    $fileInfo->getNameWithExtension(),
                    'Is not an uploaded file'
                );
                continue;
            }

            // Apply user validations
            foreach ($this->validations as $validation) {
                try {
                    $validation->validate($fileInfo);
                } catch (\Upload\Exception $e) {
                    $this->errors[] = sprintf(
                        '%s: %s',
                        $fileInfo->getNameWithExtension(),
                        $e->getMessage()
                    );
                }
            }

            // After validation callback
            $this->applyCallback('afterValidation', $fileInfo);
        }

        return empty($this->errors);
    }
665192
function is($proto)
    {
        if ($proto == 'all') return true;
        if ($this->eq($proto)) return true;
        return $this->heir_of($proto);
    }
41723
public function validate(): bool
    {
        foreach ($this as $element) {
            if ($element instanceof HasValueValidationInterface) {
                $element->validate();
            }
        }
        return $this->errors()->empty();
    }
471667
protected function setPrototype($prototype)
    {
        if ($this->entityName) {
            throw RuntimeException::setPrototypeCalledAgain();
        }

        $this->entityName = is_object($prototype)
            ? get_class($prototype)
            : $prototype;
    }
292318
public function isValid($value)
    {
        if (false === Core::get()->classExists($value)) {
            $errorMessage = $this->translateErrorMessage('validator.class_exists.not_valid', 'configuration_object', [$value]);
            $this->addError($errorMessage, 1457610460);
        }
    }
238654
public function validate($element): bool
    {
        if (!$expectedType = $this->getType()) {
            return true;
        }

        $expectedType = $this->typeMap[$expectedType] ?? $expectedType;
        $actualType   = \gettype($element);

        if (($actualType === 'object' && $element instanceof $expectedType) || $actualType === $expectedType) {
            return true;
        }

        throw new InvalidTypeException($expectedType, $actualType === 'object' ? \get_class($element) : $actualType);
    }
965085
protected function validateControllerClass($controllerClass)
    {
        if (class_exists($controllerClass)) {
            $class = new \ReflectionClass($controllerClass);
            return !$class->isAbstract() && $class->isSubclassOf(Controller::class);
        }

        return false;
    }
177280
public static function instance($prototype = false)
    {
        // no references, since PHP doesn't copy unless modified
        static $instance = null;
        if ($prototype) {
            $instance = $prototype;
        } elseif (!$instance) {
            $instance = new HTMLPurifier_EntityLookup();
            $instance->setup();
        }
        return $instance;
    }
1246312
protected function validate()
    {
        foreach ($this->_requiredAttr as $attr) {
            if (is_array($attr)) {
                $valid = false;
                foreach ($attr as $sub) {
                    if (!is_null($this->$sub)) {
                        $valid = true;
                        break;
                    }
                }
                if (!$valid) {
                    return false;
                }
            } elseif (is_null($this->$attr)) {
                return false;
            }
        }
        return true;
    }
603553
public static function validate($c)
    {
        if ($c && (is_array($c) || $c instanceof Traversable)) {
            foreach ($c as $o) {
                if ($o instanceof ValidateDescriptorInterface || (is_object($o) && method_exists($o, 'validate'))) {
                    $o->validate();
                }
            }
        }
    }
1329506
private function isValidObjectInstance($object)
    {
        if (!is_null($this->classname) && !$this->isInstanceOrSubclassOf($object)) {
            return false;
        }

        return true;
    }
22697
public static function isSuccess(stdClass $response)
    {
        if (is_object($response) && $response->success == true) {
            return HttpCodes::isOk($response->http_code);
        } else {
            return false;
        }
    }
1067137
public function Validate()
	{
		// force re-validation
		$this->ResetValidationErrors();

		$is_valid = (!$this->HasValidationErrors());

		// if validation fails, remove this object from the cache otherwise invalid values can
		// hang around and cause troubles.
		if (!$is_valid)
		{
			$this->_phreezer->DeleteCache(get_class($this), $this->GetPrimaryKeyValue());
		}

		return $is_valid;
	}
944870
private function validateObject($object, \SplObjectStorage $validatedInstancesContainer)
    {
        $className = $this->entityManager->getClassMetadata(get_class($object))->getName();
        $validator = $this->validatorResolver->getBaseValidatorConjunction($className, ['Persistence', 'Default']);
        if ($validator === null) {
            return;
        }

        $validator->setValidatedInstancesContainer($validatedInstancesContainer);
        $validationResult = $validator->validate($object);
        if ($validationResult->hasErrors()) {
            $errorMessages = '';
            $errorCount = 0;
            $allErrors = $validationResult->getFlattenedErrors();
            foreach ($allErrors as $path => $errors) {
                $errorMessages .= $path . ':' . PHP_EOL;
                foreach ($errors as $error) {
                    $errorCount++;
                    $errorMessages .= (string)$error . PHP_EOL;
                }
            }
            throw new ObjectValidationFailedException('An instance of "' . get_class($object) . '" failed to pass validation with ' . $errorCount . ' error(s): ' . PHP_EOL . $errorMessages, 1322585164);
        }
    }
623205
protected function validate($data)
    {
        InvalidRegisterData::assert(
            is_subclass_of($data, \Lego\Field\Field::class),
            '$data should be subclass of ' . \Lego\Field\Field::class
        );
    }
162904
public static function isValid($date)
	{
		if(self::validateXSDDateTimeFormat($date) && self::validateXSDDateTimeValue($date))
		{
			return true;
		}
		else
		{
			return false;
		}
	}