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

Yoast / wordpress-seo / 3b574d1ec7604bedb25fcf160cfdf3804cbab777

15 May 2025 07:52AM UTC coverage: 52.98% (-0.05%) from 53.034%
3b574d1ec7604bedb25fcf160cfdf3804cbab777

push

github

web-flow
Merge pull request #22253 from Yoast/llms-txt/create-file

Create the LLMs.txt automatically and on a schedule.

8175 of 14234 branches covered (57.43%)

Branch coverage included in aggregate %.

66 of 185 new or added lines in 13 files covered. (35.68%)

4 existing lines in 4 files now uncovered.

29670 of 57199 relevant lines covered (51.87%)

41740.26 hits per line

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

0.0
/src/llms-txt/application/file/commands/remove-file-command-handler.php
1
<?php
2
// phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded
3
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong
4
namespace Yoast\WP\SEO\Llms_Txt\Application\File\Commands;
5

6
use Yoast\WP\SEO\Helpers\Options_Helper;
7
use Yoast\WP\SEO\Llms_Txt\Infrastructure\File\WordPress_File_System_Adapter;
8

9
/**
10
 * Handles the removal of the llms.txt
11
 */
12
class Remove_File_Command_Handler {
13

14
        /**
15
         * The options helper.
16
         *
17
         * @var Options_Helper
18
         */
19
        private $options_helper;
20

21
        /**
22
         * The file system adapter.
23
         *
24
         * @var WordPress_File_System_Adapter
25
         */
26
        private $file_system_adapter;
27

28
        /**
29
         * Constructor.
30
         *
31
         * @param Options_Helper                $options_helper      The options helper.
32
         * @param WordPress_File_System_Adapter $file_system_adapter The file system adapter.
33
         */
NEW
34
        public function __construct( Options_Helper $options_helper, WordPress_File_System_Adapter $file_system_adapter ) {
×
NEW
35
                $this->options_helper      = $options_helper;
×
NEW
36
                $this->file_system_adapter = $file_system_adapter;
×
37
        }
38

39
        /**
40
         * Runs the command.
41
         *
42
         * @return void
43
         */
NEW
44
        public function handle() {
×
NEW
45
                $this->file_system_adapter->remove_file();
×
46
                // Maybe move this to a class if we need to handle this option more often.
NEW
47
                $this->options_helper->set( 'llms_txt_content_hash', '' );
×
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

© 2026 Coveralls, Inc