@param string $schema
@param string $typeName
@param string $id

@return bool
973869
public function has(string $schema, string $typeName, string $id) : bool
    {
        if (!$this->typeExists($schema, $typeName)) {
            return false;
        }

        return array_key_exists($id, $this->storage[$schema][$typeName]);
    }
388474
public function check($typeName, $value)
    {
        switch ($typeName) {
            case static::COMPOUND_ARRAY:
                return is_array($value);
            case static::COMPOUND_OBJECT:
                return is_object($value);
            default:
                return false;
        }
    }
1302625
protected function validateSchema($schema)
    {
        if (!is_string($schema) || trim($schema) == '') {
            throw new Exception\InvalidArgumentException(__METHOD__ . ': Schema name must be a valid string or an empty string detected');
        }

        return $this;
    }
562646
protected function execSchema(Schema $schema)
    {
        $query = $schema->build($this->database);

        return $this->database->exec(trim($query));
    }
218703
public static function assertJsonMatchesSchemaString($schema, $content)
    {
        $file = tempnam(sys_get_temp_dir(), 'json-schema-');
        file_put_contents($file, $schema);

        self::assertJsonMatchesSchema($content, $file);
    }
788400
protected function validateSchema(&$document_data, &$data, array $data_pointer, array $parent_data_pointer, ISchema $document, $schema, ValidationResult $bag): bool
    {
        if (is_bool($schema)) {
            if ($schema) {
                return true;
            }
            $bag->addError(new ValidationError($data, $data_pointer, $parent_data_pointer, $schema, '$schema', [
                'schema' => $schema
            ]));
            return false;
        }

        if (!is_object($schema)) {
            throw new InvalidSchemaException($schema);
        }

        if (property_exists($schema, '$ref') && is_string($schema->{'$ref'})) {
            return $this->validateRef($document_data, $data, $data_pointer, $parent_data_pointer, $document, $schema, $bag);
        }

        return $this->validateKeywords($document_data, $data, $data_pointer, $parent_data_pointer, $document, $schema, $bag);
    }
1363186
public function setSchema($schema)
    {
        if (!\is_string($schema) && !$schema instanceof SchemaDefinitionInterface) {
            throw new InvalidSchemaDefinitionException();
        }

        $this->schema = $schema;
    }
386210
public <T> boolean registerPojo(Class<T> typeClass, Schema<T> schema)
    {
        assert typeClass != null && schema != null;
        
        final HasSchema<?> last = pojoMapping.putIfAbsent(typeClass.getName(), 
                new Registered<T>(schema));
        
        return last == null || (last instanceof Registered<?> && 
                ((Registered<?>)last).schema == schema);
    }
988972
public function has(string $type, string $id): bool
    {
        return array_key_exists($this->buildArrayKey($type, $id), $this->collection);
    }
987241
public function addEntitySubject($id, $type = null, $idKey = "id", $typeKey = "type")
    {
        if(!isset($this->_subscription->subject)){
            $this->_subscription->subject = (object) [
                "entities" => [],
                "condition" => (object)["attrs" => []]
            ];
        }

        $entity = (object) [];
        $entity->$idKey = $id;

        if (null != $type) {
            $entity->$typeKey = (string)$type;
        }

        $this->_subscription->subject->entities[] = $entity;
        return $this;
    }
1133664
def valid_schema?(schema, id)
      schema.is_a?(Hash) && Schema.build(schema, parent, id)
    rescue InvalidSchema
      false
    end
106046
public function check($typeName, $value)
    {
        switch ($typeName) {
            case static::SCALAR_STRING:
                return is_string($value);
            case static::SCALAR_INTEGER:
                return is_integer($value);
            case static::SCALAR_FLOAT:
                return is_float($value);
            case static::SCALAR_BOOLEAN:
                return is_bool($value);
            default:
                return false;
        }
    }
776629
public function check($typeName, $value)
    {
        switch ($typeName) {
            case static::SPECIAL_NULL:
                return $value === null;
            case static::SPECIAL_RESOURCE:
                return is_resource($value);
            default:
                return false;
        }
    }
828109
public static function checkSchemaType($type)
    {
        if (isset(self::$_schemaTypes[$type])) {
            return self::$_schemaTypes[$type];
        } else {
            return false;
        }
    }
726144
public function makeSchemaValidator(EventInterface $event, $schema)
    {
        // we can't validate on an array, only an object
        // so we need to convert the event payload to an object
        $payload = $event->toMessage();
        $payload = json_encode($payload); // back to json
        $payload = json_decode($payload); // from json to an object

        return new Validator($payload, $schema);
    }
1204666
public function postDown(Schema $schema)
    {
        if (!$this->sm->tablesExist(['typo3_flow_resource_resource'])) {
            return;
        }
        $resourcesResult = $this->connection->executeQuery('SELECT DISTINCT resourcepointer FROM typo3_flow_resource_resource');
        while ($resourceInfo = $resourcesResult->fetch(\PDO::FETCH_ASSOC)) {
            $this->connection->executeQuery(
                'INSERT INTO typo3_flow_resource_resourcepointer (hash) VALUES (?)',
                array($resourceInfo['resourcepointer'])
            );

            $resourcePathAndFilename = FLOW_PATH_DATA . 'Persistent/Resources/' . $resourceInfo['resourcepointer'][0] . '/' . $resourceInfo['resourcepointer'][1] . '/' . $resourceInfo['resourcepointer'][2] . '/' . $resourceInfo['resourcepointer'][3] . '/' . $resourceInfo['resourcepointer'];
            if (!file_exists($resourcePathAndFilename)) {
                $this->write(sprintf('Error while migrating database for the old resource management: the resource file "%s" was not found.', $resourcePathAndFilename));
                continue;
            }
            $newResourcePathAndFilename = FLOW_PATH_DATA . 'Persistent/Resources/' . $resourceInfo['resourcepointer'];
            $result = @rename($resourcePathAndFilename, $newResourcePathAndFilename);
            if ($result === false) {
                $this->write(sprintf('Could not move the data file of resource "%s" from its location at %s to the legacy location %s.', $resourceInfo['resourcepointer'], $resourcePathAndFilename, $newResourcePathAndFilename));
            }
            Files::removeEmptyDirectoriesOnPath(dirname($resourcePathAndFilename));
        }

        $this->connection->exec('UPDATE typo3_flow_resource_resource SET fileextension =  SUBSTRING_INDEX(filename, \'.\', -1)');
        $this->connection->exec('ALTER TABLE typo3_flow_resource_resource ADD CONSTRAINT typo3_flow_resource_resource_ibfk_1 FOREIGN KEY (resourcepointer) REFERENCES typo3_flow_resource_resourcepointer (hash)');
    }
424564
protected function checkTypeAny($entity, $schema, $entityName)
    {
        $this->checkDisallow($entity, $schema, $entityName);

        return $this;
    }