Validates subject against required

@param array $subject
@return bool
423815
public function validate($subject): bool
    {
        if (\is_array($this->schema['required'])) {
            foreach ($this->schema['required'] as $propertyName) {
                if (!\array_key_exists($propertyName, $subject)) {
                    return false;
                }
            }
        }
        return true;
    }
737368
public function isValidFor($mixed, $subject = null, ArrayAccess $error = null)
    {
        $valid = true;
        foreach ($this->getValidators() as $validator) {
            if ($validator instanceof ValidatorForSubjectInterface) {
                if (!$validator->isValidFor($mixed, $subject, $error)) {
                    $valid = false;
                }
            } elseif (!$validator->isValid($mixed, $error)) {
                $valid = false;
            }
        }

        return $valid;
    }
117610
protected function supports($attribute, $subject)
    {
        $isSupportedAttribute = false;

        foreach ($this->getSupportedAttributes() as $supportedAttributeClass) {
            if ($attribute instanceof $supportedAttributeClass) {
                $isSupportedAttribute = true;
                break;
            }
        }

        return $isSupportedAttribute && $this->supportSubject($subject);
    }
97704
public function reset($subject)
    {
        $subject = $this->key.':'.$subject;

        return (bool) $this->client->del($subject);
    }
985103
public function getMatches($subject)
    {
        preg_match('/'.$this->pattern.'/',$subject,$matches);
        return count($matches) ? $matches : false;
    }
198329
public function validateResponse(array $response)
    {
        $returnValue = false;
        if (isset($response['header'])
            && isset($response['header']['status'])
            && $response['header']['status'] >= 200
            && $response['header']['status'] < 300
        ) {
            $returnValue = true;
        }

        return $returnValue;
    }
311111
public function validate($subject): bool
    {
        if (\is_array($this->schema['patternProperties'])) {
            foreach ($this->schema['patternProperties'] as $pattern => $patternSchema) {
                foreach ($subject as $propertyName => $propertyData) {
                    if (\preg_match(sprintf('/%s/', $pattern), $propertyName)) {
                        $nodeValidator = new NodeValidator($patternSchema, $this->rootSchema);
                        if (!$nodeValidator->validate($propertyData)) {
                            return false;
                        }
                    }
                }
            }
        }
        return true;
    }
1097108
protected function supportSubject($subject)
    {
        if (is_object($subject)) {
            return $this->supportClasses(
                $subject,
                array('OpenOrchestra\ModelInterface\Model\ContentInterface')
            );
        }

        return $subject === ContentInterface::ENTITY_TYPE;
    }
775185
public function validate($subject): bool
    {
        // Validation with "additionalProperties" applies only to the child values of instance names that do
        // not match any names in "properties", and do not match any regular expression in "patternProperties".
        $subject = $this->removePropertiesFromSubject($subject, $this->schema);
        $subject = $this->removePatternPropertiesFromSubject($subject, $this->schema);
        // The value of "additionalProperties" MUST be a valid JSON Schema (including boolean false)
        if (\is_bool($this->schema['additionalProperties']) && $this->schema['additionalProperties'] === false) {
            if (count($subject) > 0) {
                return false;
            }
        } elseif (\is_array($this->schema['additionalProperties'])) {
            foreach ($subject as $propertyValue) {
                $nodeValidator = new NodeValidator($this->schema['additionalProperties'], $this->rootSchema);
                if (!$nodeValidator->validate($propertyValue)) {
                    return false;
                }
            }
        }
        return true;
    }
698067
public function validate($subject): bool
    {
        switch ($this->schema['type']) {
            case 'boolean':
                return $this->validateTypBoolean($subject);
            case 'number':
            case 'integer':
            case 'float':
                return $this->validateTypeNumeric($subject);
            case 'string':
                return $this->validateTypeString($subject);
            case 'array':
                return $this->validateTypeArray($subject);
            case 'object':
                return $this->validateTypeObject($subject);
            case 'null':
                return $this->validateTypeNull($subject);
        }
        return false;
    }
993791
private function validateAdditionalItems(array $subject, array $schema): bool
    {
        $subject = \array_slice($subject, count($schema['items']));

        if (\is_bool($schema['additionalItems'])) {
            return $this->validateAdditionalItemsSchemaBoolean($subject, $schema);
        }
        if (\is_int(\array_keys($schema['additionalItems'])[0])) {
            return $this->validateAdditionalItemsSchemaArray($subject, $schema);
        }
        return $this->validateAdditionalItemsSchemaObject($subject, $schema);
    }
139428
protected function supportSubject($subject)
    {
        if (is_object($subject)) {
            return $this->supportClasses(
                $subject,
                array(
                    'OpenOrchestra\ModelInterface\Model\KeywordInterface',
                    'OpenOrchestra\BaseApi\Model\ApiClientInterface'
                )
            );
        }

        return in_array(
            $subject,
            array(
                KeywordInterface::ENTITY_TYPE,
                ApiClientInterface::ENTITY_TYPE
            )
        );
    }
350823
public function matches($subject)
    {
        if ($this->pattern === null) {
            throw new RegexpException("No pattern specified for regexp match().");
        }

        return $this->engine->match($this->pattern, $subject, $this->groups);
    }
1109556
protected function supports($attribute, $subject)
    {
        if (null !== $subject) {
            return $subject instanceof Email && in_array($attribute, self::ATTRIBUTES);
        }

        return in_array($attribute, self::ATTRIBUTES);
    }
1157004
protected function containsObject($subject)
    {
        if (is_object($subject)) {
            return true;
        }
        if (!is_array($subject)) {
            return false;
        }
        foreach ($subject as $value) {
            if ($this->containsObject($value)) {
                return true;
            }
        }
        return false;
    }
1062595
public function isGranted($attributes, $subject = null)
    {
        return $this->container->get('security.authorization_checker')
            ->isGranted($attributes, $subject);
    }
1108945
public function email($subject) : bool
    {
        if ($subject === null) {
            return false;
        }
        // FILTER_VALIDATE_EMAIL doesn't reliably require .tld.
        $v = '' . $subject;
        return $v === '' ? false : (
            !!filter_var($v, FILTER_VALIDATE_EMAIL)
            && !!preg_match('/\.[a-zA-Z\d]+$/', $v)
        );
    }