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

rtCamp / snapwp-helper / 15781983797

20 Jun 2025 03:08PM UTC coverage: 84.226% (+0.9%) from 83.349%
15781983797

Pull #113

github

web-flow
Merge 342ad2291 into fced6b317
Pull Request #113: feat!: bump minimum WPGraphQL version to v2.3.3

1714 of 2035 relevant lines covered (84.23%)

12.2 hits per line

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

92.0
/src/Modules/GraphQL/Type/WPObject/ScriptModule.php
1
<?php
2
/**
3
 * Registers the ScriptModule Object to WPGraphQL.
4
 *
5
 * @todo Temporary until supported by WPGraphQL / REST API.
6
 *
7
 * @package SnapWP\Helper\Modules\GraphQL\Type\WPObject
8
 */
9

10
declare( strict_types = 1 );
11

12
namespace SnapWP\Helper\Modules\GraphQL\Type\WPObject;
13

14
use SnapWP\Helper\Modules\GraphQL\Interfaces\TypeWithInterfaces;
15

16
/**
17
 * Class - ScriptModule
18
 */
19
final class ScriptModule extends AbstractObject implements TypeWithInterfaces {
20
        /**
21
         * {@inheritDoc}
22
         */
23
        public static function get_type_name(): string {
33✔
24
                return 'ScriptModule';
33✔
25
        }
26

27
        /**
28
         * {@inheritDoc}
29
         */
30
        public function get_description(): string {
×
31
                return __( 'The Script Module enqueued by WordPress.', 'snapwp-helper' );
×
32
        }
33

34
        /**
35
         * {@inheritDoc}
36
         */
37
        public function get_fields(): array {
33✔
38
                return [
33✔
39
                        'dependencies' => [
33✔
40
                                'type'        => [ 'list_of' => ScriptModuleDependency::get_type_name() ],
33✔
41
                                'description' => static fn () => __( 'The dependencies for the script module.', 'snapwp-helper' ),
33✔
42
                        ],
33✔
43
                        'extraData'    => [
33✔
44
                                'type'        => 'String',
33✔
45
                                'description' => static fn () => __( 'The (JSON-encoded) data object used by the script module.', 'snapwp-helper' ),
33✔
46
                        ],
33✔
47
                        'handle'       => [
33✔
48
                                'type'        => 'String',
33✔
49
                                'description' => static fn () => __( 'The handle for the script module.', 'snapwp-helper' ),
33✔
50
                        ],
33✔
51
                        'src'          => [
33✔
52
                                'type'        => 'String',
33✔
53
                                'description' => static fn () => __( 'The source URL for the script module.', 'snapwp-helper' ),
33✔
54
                        ],
33✔
55
                ];
33✔
56
        }
57

58
        /**
59
         * {@inheritDoc}
60
         */
61
        public function get_interfaces(): array {
33✔
62
                return [ 'Node' ];
33✔
63
        }
64
}
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