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

Yoast / wordpress-seo / dd6e866a9e6d253114633104d9e3858d807178ba

19 Jun 2024 10:03AM UTC coverage: 48.628% (-4.3%) from 52.936%
dd6e866a9e6d253114633104d9e3858d807178ba

push

github

web-flow
Merge pull request #21431 from Yoast/21429-update-copy-in-the-introduction-and-consent-modals

Updates the copy for the introduction and consent modals

7441 of 13454 branches covered (55.31%)

Branch coverage included in aggregate %.

0 of 3 new or added lines in 2 files covered. (0.0%)

3718 existing lines in 107 files now uncovered.

25100 of 53464 relevant lines covered (46.95%)

62392.47 hits per line

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

0.0
/src/repositories/primary-term-repository.php
1
<?php
2

3
namespace Yoast\WP\SEO\Repositories;
4

5
use Yoast\WP\Lib\Model;
6
use Yoast\WP\Lib\ORM;
7
use Yoast\WP\SEO\Models\Primary_Term;
8

9
/**
10
 * Class Primary_Term_Repository.
11
 */
12
class Primary_Term_Repository {
13

14
        /**
15
         * Starts a query for this repository.
16
         *
17
         * @return ORM
18
         */
UNCOV
19
        public function query() {
×
UNCOV
20
                return Model::of_type( 'Primary_Term' );
×
21
        }
22

23
        /**
24
         * Retrieves a primary term by a post ID and taxonomy.
25
         *
26
         * @param int    $post_id     The post the indexable is based upon.
27
         * @param string $taxonomy    The taxonomy the indexable belongs to.
28
         * @param bool   $auto_create Optional. Creates an indexable if it does not exist yet.
29
         *
30
         * @return Primary_Term|null Instance of a primary term.
31
         */
UNCOV
32
        public function find_by_post_id_and_taxonomy( $post_id, $taxonomy, $auto_create = true ) {
×
33
                /**
34
                 * Instance of the primary term.
35
                 *
36
                 * @var Primary_Term $primary_term_indexable
37
                 */
UNCOV
38
                $primary_term_indexable = $this->query()
×
UNCOV
39
                        ->where( 'post_id', $post_id )
×
UNCOV
40
                        ->where( 'taxonomy', $taxonomy )
×
UNCOV
41
                        ->find_one();
×
42

UNCOV
43
                if ( $auto_create && ! $primary_term_indexable ) {
×
44
                        $primary_term_indexable = $this->query()->create();
×
45
                }
46

UNCOV
47
                return $primary_term_indexable;
×
48
        }
49
}
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

© 2025 Coveralls, Inc