# easy-invoice/2.3.2/includes/Providers/InvoiceServiceProvider.php

Easy Invoice – Invoice Generator, PDF Quotes &amp; Payments, version 2.3.2. 80 lines.

- Page: https://pluginprobe.com/plugins/easy-invoice/2.3.2/code/includes/Providers/InvoiceServiceProvider.php
- Raw: https://pluginprobe.com/plugins/easy-invoice/2.3.2/raw/includes/Providers/InvoiceServiceProvider.php
- Modified: 2025-08-14T09:51:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-invoice/2.3.2/code/includes/Providers/InvoiceServiceProvider.php#L10-L20`.

```php
<?php
/**
 * Invoice Service Provider
 *
 * @package Easy_Invoice
 * @subpackage Providers
 */

namespace EasyInvoice\Providers;

use EasyInvoice\Interfaces\InvoiceRepositoryInterface;
use EasyInvoice\Repositories\InvoiceRepository;

/**
 * InvoiceServiceProvider Class
 * 
 * Handles the registration of invoice-related services.
 */
class InvoiceServiceProvider {
    /**
     * The repository instance
     *
     * @var InvoiceRepositoryInterface
     */
    protected static $repository = null;
    
    /**
     * Register invoice services
     */
    public function register() {
        // Register service providers, load dependencies, etc.
        $this->registerRepositories();
        $this->registerHooks();
    }
    
    /**
     * Register repositories
     */
    protected function registerRepositories() {
        // This method would be more useful if you're using a dependency injection container
        // For now, it's just a placeholder to maintain structure for future expansion
    }
    
    /**
     * Register hooks
     */
    protected function registerHooks() {
        // Register any WordPress hooks related to invoices
        // Removed duplicate textdomain loading - it's handled in the main plugin file
    }
    
    /**
     * Load text domain
     */
    public function loadTextDomain() {
        // Removed - textdomain is loaded in the main plugin file
    }
    
    /**
     * Register invoice repository
     */
    protected function registerInvoiceRepository() {
        // Create and store the repository instance
        self::$repository = new InvoiceRepository();
    }
    
    /**
     * Get the invoice repository
     *
     * @return InvoiceRepositoryInterface The invoice repository
     */
    public static function getInvoiceRepository() {
        // Create the repository if it doesn't exist
        if (self::$repository === null) {
            self::$repository = new InvoiceRepository();
        }
        
        return self::$repository;
    }
} 
```
