Automattic\WooCommerce\Admin\RemoteSpecs
DataSourcePoller::validate_spec()
Validate the spec.
Метод класса: DataSourcePoller{}
Хуков нет.
Возвращает
true|false
. The result of the validation.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->validate_spec( $spec, $url );
- $spec(объект) (обязательный)
- The spec to validate.
- $url(строка) (обязательный)
- The url of the feed that provided the spec.
Код DataSourcePoller::validate_spec() DataSourcePoller::validate spec WC 9.5.1
protected function validate_spec( $spec, $url ) { $logger = self::get_logger(); $logger_context = array( 'source' => $url ); if ( ! $this->get_spec_key( $spec ) ) { $logger->error( 'Spec is invalid because the id is missing in feed', $logger_context ); // phpcs:ignore $logger->error( print_r( $spec, true ), $logger_context ); return false; } return true; }