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

wp-graphql / wp-graphql-woocommerce / 11966251139

12 Nov 2024 06:52PM UTC coverage: 83.665%. Remained the same
11966251139

push

github

web-flow
chore: READMEs and CHANGELOG updated (#907)

12431 of 14858 relevant lines covered (83.67%)

71.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