private function filterConstraintsForSchema(array $constraints, stdClass $schema)
    {
        $filtered = [];

        foreach ($constraints as $constraint) {
            foreach ($constraint->keywords() as $keyword) {
                if (property_exists($schema, $keyword)) {
                    $filtered[] = $constraint;
                    break;
                }
            }
        }

        return $filtered;
    }
private function filterConstraintsForSchema(array $constraints, stdClass $schema)
    {
        $filtered = [];

        foreach ($constraints as $constraint) {
            foreach ($constraint->keywords() as $keyword) {
                if (property_exists($schema, $keyword)) {
                    $filtered[] = $constraint;
                    break;
                }
            }
        }

        return $filtered;
    }
private function filterConstraintsForSchema ( array $ constraints , stdClass $ schema ) { $ filtered = [ ] ; foreach ( $ constraints as $ constraint ) { foreach ( $ constraint -> keywords ( ) as $ keyword ) { if ( property_exists ( $ schema , $ keyword ) ) { $ filtered [ ] = $ constraint ; break ; } } } return $ filtered ; }
Filters constraints which should be triggered for given schema.

@param Constraint[] $constraints
@param stdClass     $schema

@return Constraint[]
Filters constraints which should be triggered for given schema .