You are here

NumberFormatterFactory.php in Price 3.x

Same filename and directory in other branches
  1. 8 src/NumberFormatterFactory.php
  2. 3.0.x src/NumberFormatterFactory.php

Namespace

Drupal\price

File

src/NumberFormatterFactory.php
View source
<?php

namespace Drupal\price;

use CommerceGuys\Intl\Formatter\CurrencyFormatterInterface;
@trigger_error('The ' . __NAMESPACE__ . '\\NumberFormatterFactory is deprecated. Instead, use \\Drupal\\price\\CurrencyFormatter. See http://drupal.org/node/the-change-notice-nid.', E_USER_DEPRECATED);

/**
 * Defines the NumberFormatter factory.
 *
 * @deprecated Use \Drupal\price\CurrencyFormatter instead.
 */
class NumberFormatterFactory implements NumberFormatterFactoryInterface {

  /**
   * The currency formatter.
   *
   * @var \CommerceGuys\Intl\Formatter\CurrencyFormatterInterface
   */
  protected $currencyFormatter;

  /**
   * Constructs a new NumberFormatterFactory object.
   *
   * @param \CommerceGuys\Intl\Formatter\CurrencyFormatterInterface $currency_formatter
   *   The currency formatter.
   */
  public function __construct(CurrencyFormatterInterface $currency_formatter) {
    $this->currencyFormatter = $currency_formatter;
  }

  /**
   * {@inheritdoc}
   */
  public function createInstance() {
    return new LegacyNumberFormatter($this->currencyFormatter);
  }

}

Classes

Namesort descending Description
NumberFormatterFactory Deprecated Defines the NumberFormatter factory.