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

Yoast / wordpress-seo / 9f70c0278dfa8a47317c8094b5259465fbcd3325

25 Nov 2025 01:51PM UTC coverage: 52.323% (-0.7%) from 52.975%
9f70c0278dfa8a47317c8094b5259465fbcd3325

Pull #22675

github

web-flow
Merge b03ff5b95 into 130f1448f
Pull Request #22675: 804 add caching

8197 of 15362 branches covered (53.36%)

Branch coverage included in aggregate %.

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

376 existing lines in 10 files now uncovered.

31700 of 60889 relevant lines covered (52.06%)

39221.69 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-command-handler.php
1
<?php
2

3
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4
namespace Yoast\WP\SEO\Schema_Aggregator\Application;
5

6
use Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Schema_Piece_Repository;
7

8
/**
9
 * Class that handles the Aggregate_Site_Schema_Command.
10
 */
11
class Aggregate_Site_Schema_Command_Handler {
12

13
        /**
14
         * The Schema_Piece_Repository instance.
15
         *
16
         * @var Schema_Piece_Repository
17
         */
18
        private $schema_piece_repository;
19

20
        /**
21
         * The Schema_Pieces_Aggregator instance.
22
         *
23
         * @var Schema_Pieces_Aggregator
24
         */
25
        private $schema_piece_aggregator;
26

27
        /**
28
         * The Schema_Aggregator_Response_Composer instance.
29
         *
30
         * @var Schema_Aggregator_Response_Composer
31
         */
32
        private $schema_response_composer;
33

34
        /**
35
         * Aggregate_Site_Schema_Command_Handler constructor.
36
         *
37
         * @param Schema_Piece_Repository             $schema_piece_repository  The collector of indexables that need to be aggregated.
38
         * @param Schema_Pieces_Aggregator            $schema_piece_aggregator  The schema pieces aggregator.
39
         * @param Schema_Aggregator_Response_Composer $schema_response_composer The schema response composer.
40
         */
UNCOV
41
        public function __construct(
×
42
                Schema_Piece_Repository $schema_piece_repository,
43
                Schema_Pieces_Aggregator $schema_piece_aggregator,
44
                Schema_Aggregator_Response_Composer $schema_response_composer
45
        ) {
UNCOV
46
                $this->schema_piece_repository  = $schema_piece_repository;
×
47
                $this->schema_piece_aggregator  = $schema_piece_aggregator;
×
48
                $this->schema_response_composer = $schema_response_composer;
×
49
        }
50

51
        /**
52
         * Handles the Aggregate_Site_Schema_Command.
53
         *
54
         * @param Aggregate_Site_Schema_Command $command The command.
55
         *
56
         * @return array<string> The aggregated schema.
57
         */
58
        public function handle( Aggregate_Site_Schema_Command $command ): array {
×
59

UNCOV
60
                $schema_pieces = $this->schema_piece_repository->get(
×
UNCOV
61
                        $command->get_page_controls()->get_page(),
×
UNCOV
62
                        $command->get_page_controls()->get_page_size(),
×
UNCOV
63
                        $command->get_page_controls()->get_post_type()
×
UNCOV
64
                );
×
65

UNCOV
66
                $aggregated_schema_pieces = $this->schema_piece_aggregator->aggregate( $schema_pieces );
×
UNCOV
67
                $schema                   = $this->schema_response_composer->compose( $aggregated_schema_pieces, $command->get_page_controls()->get_post_type(), $command->get_page_controls()->get_page(), $command->get_page_controls()->get_page_size() );
×
UNCOV
68
                return $schema;
×
69
        }
70
}
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