Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Application
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 2
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 initialize_chat_editor
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace NewfoldLabs\WP\Module\EditorChat;
4
5use NewfoldLabs\WP\ModuleLoader\Container;
6
7/**
8 * Main Application class for the Editor Chat module.
9 */
10class Application {
11
12    /**
13     * Dependency injection container.
14     *
15     * @var Container
16     */
17    protected $container;
18
19    /**
20     * Constructor.
21     *
22     * @param Container $container Dependency injection container.
23     */
24    public function __construct( Container $container ) {
25
26        $this->container = $container;
27
28        // Delay ChatEditor initialization until WordPress functions are available
29        \add_action( 'plugins_loaded', array( $this, 'initialize_chat_editor' ) );
30    }
31
32    /**
33     * Initialize ChatEditor for users with editor capabilities.
34     * Called after WordPress pluggable functions are available.
35     *
36     * @return void
37     */
38    public function initialize_chat_editor() {
39        if ( Permissions::is_editor() ) {
40            new ChatEditor();
41        }
42    }
43}