protected function applyCallback(stdClass $schema): stdClass
    {
        if (is_callable($this->callback)) {
            $result = call_user_func_array($this->callback, [Convert::objectToArray($schema)]);

            if (is_null($result)) {
                throw new InvalidArgumentException('Callback returned `null`. Did you forget to `return $schema;`?');
            }

            if ($result !== false) {
                return Convert::arrayToObject($result);
            }
        }

        return $schema;
    }
protected function applyCallback(stdClass $schema): stdClass
    {
        if (is_callable($this->callback)) {
            $result = call_user_func_array($this->callback, [Convert::objectToArray($schema)]);

            if (is_null($result)) {
                throw new InvalidArgumentException('Callback returned `null`. Did you forget to `return $schema;`?');
            }

            if ($result !== false) {
                return Convert::arrayToObject($result);
            }
        }

        return $schema;
    }
protected function applyCallback ( stdClass $ schema ) : stdClass { if ( is_callable ( $ this -> callback ) ) { $ result = call_user_func_array ( $ this -> callback , [ Convert :: objectToArray ( $ schema ) ] ) ; if ( is_null ( $ result ) ) { throw new InvalidArgumentException ( 'Callback returned `null`. Did you forget to `return $schema;`?' ) ; } if ( $ result !== false ) { return Convert :: arrayToObject ( $ result ) ; } } return $ schema ; }
Apply the optional callback.

@param \stdClass $schema JSON schema object.
@return \stdClass JSON schema object after callback processing.
Apply the optional callback .