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

wp-graphql / wp-graphql-woocommerce / 14788432316

01 May 2025 06:46PM UTC coverage: 83.59% (-0.03%) from 83.617%
14788432316

push

github

web-flow
Fix/recursive interface definitions (#934)

* fix: recursive interface definitions for Product, etc.

* devops: CI & Linter compliances met

* devops: lint-code.yml updated

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>

7 of 9 new or added lines in 8 files covered. (77.78%)

8 existing lines in 2 files now uncovered.

12424 of 14863 relevant lines covered (83.59%)

72.08 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