<?php
/**
 * Invoice Formatter Helper Class
 *
 * @package Easy_Invoice
 * @subpackage Helpers
 */

namespace EasyInvoice\Helpers;

use EasyInvoice\Traits\CurrencyTrait;

/**
 * Invoice Formatter Class
 * 
 * Handles formatting of invoice values
 */
class InvoiceFormatter {
    use CurrencyTrait;
    
    /**
     * The invoice object
     *
     * @var mixed
     */
    private $invoice;
    
    /**
     * Constructor
     *
     * @param mixed $invoice The invoice object
     */
    public function __construct($invoice = null) {
        $this->invoice = $invoice;
    }
    
    /**
     * Format a currency amount
     * 
     * @param float $amount The amount to format
     * @return string The formatted amount
     */
    public function format($amount) {
        return $this->formatCurrency($amount, $this->invoice);
    }
} 