2017 © Pedro Peláez
 

library currency-manager

Simple, lightweight, currency manager

image

luxifer/currency-manager

Simple, lightweight, currency manager

  • Thursday, October 22, 2015
  • by luxifer
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8,431 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 1 % Grown

The README.md

Currency Manager

This library aims to be a simple lightweight currency manager. It includes a JSON file containing almost every currency definitions. With this libray you can find currency by some field and use the definition in your project. This libray requires jms/serializer to work., (*1)

Installation

composer require luxifer/currency-manager

Usage

<?php

require 'vendor/autoload.php';

$serializer = JMS\Serializer\SerializerBuilder::create()->build();
$manager = new Luxifer\Manager\CurrencyManager($serializer);

$euro = $manager->getCurrencyBy('code', 'EUR'); // Luxifer\Model\Currency

Serialization

This library provide a new handler for jms\serializer to handle serialization/deserialization from and to Currency., (*2)

<?php

$serializer->configureHandlers(function(JMS\Serializer\Handler\HandlerRegistry $registry) use ($manager) {
    $registry->registerSubscribingHandler(new Luxifer\Handler\CurrencyHandler($manager));
});

You can now use Currency as a Type inside your objects., (*3)

<?php
use JMS\Serializer\Annotation\Type;

class MyObject
{
    /**
     * @Type("Currency")
     *
     * will serialize to the currency ISO code
     */
    protected $currency;

    /**
     * @Type("Currency<'symbol'>")
     *
     * will serialize to the currency symbol
     */
    protected $symbol;
}

Thanks

I would like to tkank @Fluidbyte for the initial currency list published on gist., (*4)

The Versions

22/10 2015

dev-master

9999999-dev

Simple, lightweight, currency manager

  Sources   Download

MIT

The Requires

 

currency manager

22/10 2015

0.3.0

0.3.0.0

Simple, lightweight, currency manager

  Sources   Download

MIT

The Requires

 

currency manager

17/12 2014

0.2.3

0.2.3.0

Simple, lightweight, currency manager

  Sources   Download

MIT

The Requires

 

currency manager

16/12 2014

0.2.2

0.2.2.0

Simple, lightweight, currency manager

  Sources   Download

MIT

The Requires

 

currency manager

16/12 2014

0.2.1

0.2.1.0

Simple, lightweight, currency manager

  Sources   Download

MIT

The Requires

 

currency manager

16/12 2014

0.2.0

0.2.0.0

Simple, lightweight, currency manager

  Sources   Download

MIT

The Requires

 

currency manager

16/12 2014

0.1.0

0.1.0.0

Simple, lightweight, currency manager

  Sources   Download

MIT

The Requires

 

currency manager