Validates subject against additionalItems

@param $subject
@return bool
198647
public function validate($subject): bool
    {
        if (isset($this->schema['items']) && \is_array($this->schema['items'])) {
            $schemaFirstKey = \array_keys($this->schema['items'])[0];
            $schemaType = \is_int($schemaFirstKey) ? 'array' : 'object';

            if ($schemaType === 'array') {
                if (!$this->validateAdditionalItems($subject, $this->schema)) {
                    return false;
                }
            }
        }
        return true;
    }
856649
public function plainText($subject) : bool
    {
        if ($subject === null) {
            return false;
        }
        $v = '' . $subject;
        return $v === '' ? true : !strcmp($v, strip_tags($v));
    }
1212299
private function validateAdditionalItemsSchemaBoolean(array $subject, array $schema): bool
    {
        if (($schema['additionalItems'] === false) && count($subject) > 0) {
            return false;
        }
        return true;
    }
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;
    }
388905
protected function preCheckedEnum($subject, array $allowedValues) : bool
    {
        if ($subject !== null && !is_scalar($subject)) {
            return false;
        }
        foreach ($allowedValues as $allowed) {
            if ($subject === $allowed) {
                return true;
            }
        }
        return false;
    }
165807
public function validate($subject): bool
    {
        // This keyword's value MUST be an object. Each property specifies a dependency. Each dependency value MUST
        // be an array or a valid JSON Schema.
        if (\is_array($this->schema['dependencies']) && count($this->schema['dependencies']) > 0) {
            foreach ($this->schema['dependencies'] as $propertyName => $dependentProperties) {
                // If the dependency value is an array, each element in the array, if any, MUST be a string, and MUST
                // be unique. If the dependency key is a property in the instance, each of the items in the
                // dependency value must be a property that exists in the instance.
                if (\is_int(\array_keys($dependentProperties)[0])) {
                    if (!$this->validateClassicDependencies($subject, $propertyName, $dependentProperties)) {
                        return false;
                    }
                    // If the dependency value is a subschema, and the dependency key is a property in the instance,
                    // the entire instance must validate against the dependency value.
                } elseif (\is_string(\array_keys($dependentProperties)[0])) {
                    if (!$this->validateSchemaDependencies($subject, $propertyName, $dependentProperties)) {
                        return false;
                    }
                }

            }
        }
        return true;
    }
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);
    }
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)
        );
    }
907027
public function validate($value)
    {
        if (!is_array($value)) {
            return false;
        }

        // From json-schema definition: if "items" is not present, or its value is an object,
        // validation of the instance always succeeds, regardless of the value of "additionalItems";
        if (empty($this->items)) {
            return true;
        }

        return $this->executeItemsValidation($value);
    }
439493
public function ascii($subject) : bool
    {
        if ($subject === null) {
            return false;
        }
        $v = '' . $subject;
        return $v === '' ? true : !!preg_match('/^[[:ascii:]]+$/', $v);
    }
905379
public function subject($subject = null)
    {
        if ($subject !== null) {
            $this->_subject = $subject;

            return $this;
        }

        return $this->_subject;
    }
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);
    }
362259
protected function _error(Subject $subject)
    {
        $subject->set(['success' => false, 'created' => false]);

        $this->_trigger('afterSave', $subject);
        $this->setFlash('error', $subject);
        $this->_trigger('beforeRender', $subject);
    }
1174179
public function validate($subject): bool
    {
        if (\is_numeric($this->schema['exclusiveMinimum'])) {
            if ($subject <= $this->schema['exclusiveMinimum']) {
                return false;
            }
        }
        return true;
    }
91625
function match($subject, &$match) {
            if (count($this->_patterns) == 0) {
                return false;
            }
            if (!preg_match($this->_getCompoundedRegex(), $subject, $matches)) {
                $match = "";
                return false;
            }
            $match = $matches[0];
            for ($i = 1; $i < count($matches); $i++) {
                if ($matches[$i]) {
                    return $this->_labels[$i - 1];
                }
            }
            return true;
        }
522012
protected function isSubjectSupported($subject)
    {
        if (null === $subject || \is_string($subject) || $subject instanceof FieldVote || \is_object($subject)) {
            return true;
        }

        return \is_array($subject)
            && isset($subject[0], $subject[1])

            && (\is_string($subject[0]) || \is_object($subject[0]))
            && \is_string($subject[1]);
    }
1175848
protected function isValid($value)
    {
        if (!is_array($value) && !($value instanceof \Countable)) {
            $this->addError('The given subject was not countable.', 1253718666);
            return;
        }

        $minimum = intval($this->options['minimum']);
        $maximum = intval($this->options['maximum']);
        if (count($value) < $minimum || count($value) > $maximum) {
            $this->addError('The count must be between %1$d and %2$d.', 1253718831, [$minimum, $maximum]);
        }
    }