keywordExists( $info ) ) { return null; } if ( 'date' !== ( $info->data()->format ?? null ) ) { // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Opis requires the schema object, which is not output. throw $this->keywordException( '{keyword} requires format: date.', $info ); } $value = $this->keywordValue( $info ); if ( $this->isDataKeywordAllowed( $parser, $this->keyword ) ) { $pointer = $this->getDataKeywordPointer( $value ); if ( $pointer ) { return new DateFormatLimit( $this->keyword, $pointer ); } } if ( ! is_string( $value ) ) { // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Opis requires the schema object, which is not output. throw $this->keywordException( '{keyword} must contain a string or a valid $data reference.', $info ); } return new DateFormatLimit( $this->keyword, $value ); } }