• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wp-graphql / wp-graphql-woocommerce / 7340336633

27 Dec 2023 05:02PM UTC coverage: 84.726%. Remained the same
7340336633

push

github

web-flow
fix: DownloadableItem "product" field type changed to ProductUnion (#833)

1 of 1 new or added line in 1 file covered. (100.0%)

11083 of 13081 relevant lines covered (84.73%)

58.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/includes/data/connection/trait-wc-db-loader-common.php
1
<?php
2
/**
3
 * Defines generic functions for to be used in connections that process creates using the Db Loader.
4
 *
5
 * @package WPGraphQL\WooCommerce\Data\Connection
6
 * @since 0.5.0
7
 */
8

9
namespace WPGraphQL\WooCommerce\Data\Connection;
10

11
/**
12
 * Trait WC_Db_Loader_Common
13
 */
14
trait WC_Db_Loader_Common {
15
        /**
16
         * Given an offset and prefix, a cursor is returned
17
         *
18
         * @param string         $prefix Salt.
19
         * @param string|integer $offset Connection offset.
20
         *
21
         * @return string
22
         */
23
        public function offset_to_cursor( $prefix, $offset ) {
24
                // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
25
                return base64_encode( "{$prefix}:{$offset}" );
×
26
        }
27

28
        /**
29
         * Given a valid cursor and prefix, the offset is returned
30
         *
31
         * @param string $prefix Salt.
32
         * @param string $cursor Cursor.
33
         *
34
         * @return string|integer
35
         */
36
        public function cursor_to_offset( $prefix, $cursor ) {
37
                // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode
38
                return substr( base64_decode( $cursor ), strlen( $prefix . ':' ) );
×
39
        }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc