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

AxeWP / wp-graphql-rank-math / 14814360581

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

Pull #121

github

web-flow
Merge 4b332cbd3 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

80.0
/src/Type/WPObject/OpenGraph/Article.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\Vendor\AxeWP\GraphQL\Abstracts\ObjectType;
13

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

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

32
        /**
33
         * {@inheritDoc}
34
         */
35
        public static function get_fields(): array {
36
                return [
19✔
37
                        'modifiedTime'  => [
19✔
38
                                'type'        => 'String',
19✔
39
                                'description' => static fn () => __( 'The date modified.', 'wp-graphql-rank-math' ),
19✔
40
                                'resolve'     => static fn ( $source ): ?string => ! empty( $source['modified_time'] ) ? (string) $source['modified_time'] : null,
19✔
41
                        ],
19✔
42
                        'publishedTime' => [
19✔
43
                                'type'        => 'String',
19✔
44
                                'description' => static fn () => __( 'The date published.', 'wp-graphql-rank-math' ),
19✔
45
                                'resolve'     => static fn ( $source ): ?string => ! empty( $source['published_time'] ) ? (string) $source['published_time'] : null,
19✔
46
                        ],
19✔
47
                        'publisher'     => [
19✔
48
                                'type'        => 'String',
19✔
49
                                'description' => static fn () => __( 'The publisher', 'wp-graphql-rank-math' ),
19✔
50
                        ],
19✔
51
                        'author'        => [
19✔
52
                                'type'        => 'String',
19✔
53
                                'description' => static fn () => __( 'The author.', 'wp-graphql-rank-math' ),
19✔
54
                        ],
19✔
55
                        'tags'          => [
19✔
56
                                'type'        => [ 'list_of' => 'String' ],
19✔
57
                                'description' => static fn () => __( 'The article tags.', 'wp-graphql-rank-math' ),
19✔
58
                                'resolve'     => static function ( $source ): ?array {
19✔
59
                                        $value = ! empty( $source['tag'] ) ? $source['tag'] : null;
×
60

61
                                        if ( empty( $value ) ) {
×
62
                                                return null;
×
63
                                        }
64

65
                                        if ( ! is_array( $value ) ) {
×
66
                                                $value = [ (string) $value ];
×
67
                                        }
68

69
                                        // Ensure all tags are strings.
70
                                        $value = array_map( 'strval', $value );
×
71

72
                                        return $value;
×
73
                                },
19✔
74
                        ],
19✔
75
                        'section'       => [
19✔
76
                                'type'        => 'String',
19✔
77
                                'description' => static fn () => __( 'The article category.', 'wp-graphql-rank-math' ),
19✔
78
                                'resolve'     => static fn ( $source ): ?string => ! empty( $source['section'] ) ? (string) $source['section'] : null,
19✔
79
                        ],
19✔
80
                ];
19✔
81
        }
82
}
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