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

Yoast / wordpress-seo / 7004843404

27 Nov 2023 11:48AM UTC coverage: 49.206% (-0.03%) from 49.232%
7004843404

push

github

web-flow
Merge pull request #20858 from Yoast/improve-copy-in-the-ftc-57

15305 of 31104 relevant lines covered (49.21%)

4.03 hits per line

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

0.0
/admin/class-collector.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin
6
 */
7

8
/**
9
 * Collects the data from the added collection objects.
10
 */
11
class WPSEO_Collector {
12

13
        /**
14
         * Holds the collections.
15
         *
16
         * @var WPSEO_Collection[]
17
         */
18
        protected $collections = [];
19

20
        /**
21
         * Adds a collection object to the collections.
22
         *
23
         * @param WPSEO_Collection $collection The collection object to add.
24
         */
25
        public function add_collection( WPSEO_Collection $collection ) {
×
26
                $this->collections[] = $collection;
×
27
        }
28

29
        /**
30
         * Collects the data from the collection objects.
31
         *
32
         * @return array The collected data.
33
         */
34
        public function collect() {
×
35
                $data = [];
×
36

37
                foreach ( $this->collections as $collection ) {
×
38
                        $data = array_merge( $data, $collection->get() );
×
39
                }
40

41
                return $data;
×
42
        }
43

44
        /**
45
         * Returns the collected data as a JSON encoded string.
46
         *
47
         * @return false|string The encode string.
48
         */
49
        public function get_as_json() {
×
50
                return WPSEO_Utils::format_json_encode( $this->collect() );
×
51
        }
52
}
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