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

Yoast / wordpress-seo / a8bd51c9c67efd390ef74e947ca420e24bc0ceed

02 Dec 2025 03:40PM UTC coverage: 52.295% (-0.008%) from 52.303%
a8bd51c9c67efd390ef74e947ca420e24bc0ceed

push

github

web-flow
Merge pull request #22771 from Yoast/646-differentiate-pagination-strategy-for-products

Make the max amount per page based on the post type.

8307 of 15554 branches covered (53.41%)

Branch coverage included in aggregate %.

0 of 26 new or added lines in 7 files covered. (0.0%)

4 existing lines in 3 files now uncovered.

31815 of 61169 relevant lines covered (52.01%)

47138.37 hits per line

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

0.0
/src/schema-aggregator/application/aggregate-site-schema-map-command-handler.php
1
<?php
2
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
namespace Yoast\WP\SEO\Schema_Aggregator\Application;
4

5
use Yoast\WP\SEO\Helpers\Indexable_Helper;
6
use Yoast\WP\SEO\Schema_Aggregator\Application\Schema_Map\Schema_Map_Builder;
7
use Yoast\WP\SEO\Schema_Aggregator\Application\Schema_Map\Schema_Map_Xml_Renderer;
8
use Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Schema_Map\Schema_Map_Repository_Factory;
9

10
/**
11
 * Class that handles the command to aggregate site schema map.
12
 *
13
 * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
14
 */
15
class Aggregate_Site_Schema_Map_Command_Handler {
16

17
        /**
18
         * The schema map factory.
19
         *
20
         * @var Schema_Map_Repository_Factory
21
         */
22
        private $schema_map_repository_factory;
23

24
        /**
25
         * The schema map builder.
26
         *
27
         * @var Schema_Map_Builder
28
         */
29
        private $schema_map_builder;
30

31
        /**
32
         * The schema map XML renderer.
33
         *
34
         * @var Schema_Map_Xml_Renderer
35
         */
36
        private $schema_map_xml_renderer;
37

38
        /**
39
         * The indexable helper.
40
         *
41
         * @var Indexable_Helper
42
         */
43
        private $indexable_helper;
44

45
        /**
46
         * Aggregate_Site_Schema_Map_Command_Handler constructor.
47
         *
48
         * @param Schema_Map_Repository_Factory $schema_map_repository_factory The schema map factory.
49
         * @param Schema_Map_Builder            $schema_map_builder            The schema map builder.
50
         * @param Schema_Map_Xml_Renderer       $schema_map_xml_renderer       The schema map XML renderer.
51
         * @param Indexable_Helper              $indexable_helper              The indexable helper.
52
         */
53
        public function __construct( Schema_Map_Repository_Factory $schema_map_repository_factory, Schema_Map_Builder $schema_map_builder, Schema_Map_Xml_Renderer $schema_map_xml_renderer, Indexable_Helper $indexable_helper ) {
×
54
                $this->schema_map_repository_factory = $schema_map_repository_factory;
×
55
                $this->schema_map_builder            = $schema_map_builder;
×
56
                $this->schema_map_xml_renderer       = $schema_map_xml_renderer;
×
57
                $this->indexable_helper              = $indexable_helper;
×
58
        }
59

60
        /**
61
         * Handles the Aggregate_Site_Schema_Map_Command.
62
         *
63
         * @param Aggregate_Site_Schema_Map_Command $command The command.
64
         *
65
         * @return string The schema map xml.
66
         */
67
        public function handle( Aggregate_Site_Schema_Map_Command $command ): string {
×
68

69
                $schema_map_repository = $this->schema_map_repository_factory->get_repository( $this->indexable_helper->should_index_indexables() );
×
70
                $indexable_counts      = $schema_map_repository->get_indexable_count_per_post_type( $command->get_post_types() );
×
71

72
                $schema_map = $this->schema_map_builder
×
UNCOV
73
                        ->with_repository( $schema_map_repository )
×
NEW
74
                        ->build( $indexable_counts );
×
75

76
                return $this->schema_map_xml_renderer->render( $schema_map );
×
77
        }
78
}
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