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

Yoast / wordpress-seo / 9594812bf110d67afe78816058eb15ec830063d2

15 Jul 2025 10:16AM UTC coverage: 52.595% (-1.0%) from 53.638%
9594812bf110d67afe78816058eb15ec830063d2

Pull #22432

github

web-flow
Merge branch 'trunk' into feature/ai-generator-in-free
Pull Request #22432: Merge feature branch into trunk

8341 of 15027 branches covered (55.51%)

Branch coverage included in aggregate %.

382 of 1769 new or added lines in 122 files covered. (21.59%)

2 existing lines in 2 files now uncovered.

30934 of 59648 relevant lines covered (51.86%)

40029.26 hits per line

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

0.0
/src/ai-authorization/domain/code-verifier.php
1
<?php
2

3
namespace Yoast\WP\SEO\AI_Authorization\Domain;
4

5
/**
6
 * Class Code_Verifier representing a challenge code and its creation time.
7
 * This is used during the authorization process to verify the user requesting a token.
8
 */
9
class Code_Verifier {
10

11
        /**
12
         * The code.
13
         *
14
         * @var string
15
         */
16
        private $code;
17

18
        /**
19
         * The time the code was created.
20
         *
21
         * @var int
22
         */
23
        private $created_at;
24

25
        /**
26
         * Code_Verifier constructor.
27
         *
28
         * @param string $code       The code.
29
         * @param int    $created_at The time the code was created.
30
         */
NEW
31
        public function __construct( string $code, int $created_at ) {
×
NEW
32
                $this->code       = $code;
×
NEW
33
                $this->created_at = $created_at;
×
34
        }
35

36
        /**
37
         * Get the code.
38
         *
39
         * @return string The code.
40
         */
NEW
41
        public function get_code(): string {
×
NEW
42
                return $this->code;
×
43
        }
44

45
        /**
46
         * Get the creation time of the code.
47
         *
48
         * @return int The creation time of the code.
49
         */
NEW
50
        public function get_created_at(): int {
×
NEW
51
                return $this->created_at;
×
52
        }
53

54
        /**
55
         * Check if the code is expired.
56
         *
57
         * @param int $validity_in_seconds The validity of the code in seconds.
58
         *
59
         * @return bool True if the code is expired, false otherwise.
60
         */
NEW
61
        public function is_expired( int $validity_in_seconds ): bool {
×
NEW
62
                return $this->created_at < ( \time() - $validity_in_seconds );
×
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