src/Server/Helper.php
private function resolveValidationRules(
        ServerConfig $config,
        OperationParams $params,
        DocumentNode $doc,
        $operationType
    ) {
        // Allow customizing validation rules per operation:
        $validationRules = $config->getValidationRules();

        if (is_callable($validationRules)) {
            $validationRules = $validationRules($params, $doc, $operationType);

            if (! is_array($validationRules)) {
                throw new InvariantViolation(sprintf(
                    'Expecting validation rules to be array or callable returning array, but got: %s',
                    Utils::printSafe($validationRules)
                ));
            }
        }

        return $validationRules;
    }
private function resolveValidationRules(
        ServerConfig $config,
        OperationParams $params,
        DocumentNode $doc,
        $operationType
    ) {
        // Allow customizing validation rules per operation:
        $validationRules = $config->getValidationRules();

        if (is_callable($validationRules)) {
            $validationRules = $validationRules($params, $doc, $operationType);

            if (! is_array($validationRules)) {
                throw new InvariantViolation(sprintf(
                    'Expecting validation rules to be array or callable returning array, but got: %s',
                    Utils::printSafe($validationRules)
                ));
            }
        }

        return $validationRules;
    }
private function resolveValidationRules ( ServerConfig $ config , OperationParams $ params , DocumentNode $ doc , $ operationType ) { // Allow customizing validation rules per operation: $ validationRules = $ config -> getValidationRules ( ) ; if ( is_callable ( $ validationRules ) ) { $ validationRules = $ validationRules ( $ params , $ doc , $ operationType ) ; if ( ! is_array ( $ validationRules ) ) { throw new InvariantViolation ( sprintf ( 'Expecting validation rules to be array or callable returning array, but got: %s' , Utils :: printSafe ( $ validationRules ) ) ) ; } } return $ validationRules ; }
@param string $operationType

@return mixed[]|null
@param string $operationType