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

AxeWP / wp-graphql-rank-math / 14814451099

03 May 2025 08:44PM UTC coverage: 86.429% (-2.0%) from 88.44%
14814451099

Pull #121

github

web-flow
Merge a9bfcb8d1 into 3bd3ede8c
Pull Request #121: dev: add support for lazy-loading `description`/`deprecationReason` config values

356 of 366 new or added lines in 65 files covered. (97.27%)

60 existing lines in 60 files now uncovered.

2541 of 2940 relevant lines covered (86.43%)

11.01 hits per line

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

88.46
/src/Type/WPObject/OpenGraph/Product.php
1
<?php
2
/**
3
 * The Rank Math Facebook OpenGraph meta tags GraphQL Object.
4
 *
5
 * @package WPGraphQL\RankMath\Type\WPObject
6
 */
7

8
declare( strict_types = 1 );
9

10
namespace WPGraphQL\RankMath\Type\WPObject\OpenGraph;
11

12
use WPGraphQL\RankMath\Type\Enum\OpenGraphProductAvailabilityEnum;
13
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Abstracts\ObjectType;
14

15
/**
16
 * Class - Product
17
 */
18
class Product extends ObjectType {
19
        /**
20
         * {@inheritDoc}
21
         */
22
        protected static function type_name(): string {
23
                return 'Product';
19✔
24
        }
25

26
        /**
27
         * {@inheritDoc}
28
         */
29
        public static function get_description(): string {
UNCOV
30
                return __( 'The OpenGraph Product meta.', 'wp-graphql-rank-math' );
×
31
        }
32

33
        /**
34
         * {@inheritDoc}
35
         */
36
        public static function get_fields(): array {
37
                return [
19✔
38
                        'brand'        => [
19✔
39
                                'type'        => 'String',
19✔
40
                                'description' => static fn () => __( 'The brand of the product.', 'wp-graphql-rank-math' ),
19✔
41
                        ],
19✔
42
                        'price'        => [
19✔
43
                                'type'        => 'Float',
19✔
44
                                'description' => static fn () => __( 'The price of the object', 'wp-graphql-rank-math' ),
19✔
45
                                'resolve'     => static function ( $source ): ?float {
19✔
46
                                        return ! empty( $source['price']['amount'] ) ? (float) $source['price']['amount'] : null;
×
47
                                },
19✔
48
                        ],
19✔
49
                        'currency'     => [
19✔
50
                                'type'        => 'String',
19✔
51
                                'description' => static fn () => __( 'The currency of the object price.', 'wp-graphql-rank-math' ),
19✔
52
                                'resolve'     => static function ( $source ): ?string {
19✔
53
                                        return ! empty( $source['price']['currency'] ) ? (string) $source['price']['currency'] : null;
×
54
                                },
19✔
55
                        ],
19✔
56
                        'availability' => [
19✔
57
                                'type'        => OpenGraphProductAvailabilityEnum::get_type_name(),
19✔
58
                                'description' => static fn () => __( 'The currency of the object price.', 'wp-graphql-rank-math' ),
19✔
59
                        ],
19✔
60

61
                ];
19✔
62
        }
63
}
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

© 2026 Coveralls, Inc