Skip to content

Commit fee1f5f

Browse files
committed
Rename method
1 parent 11e0ccf commit fee1f5f

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PHP Currency API
1+
# 💱 PHP Currency API
22
_A PHP 7 API Wrapper for Popular Currency Rate APIs._
33

44
[![Version](https://img.shields.io/packagist/v/otherguy/php-currency-api.svg?style=flat-square)](https://packagist.org/packages/otherguy/php-currency-api)
@@ -10,13 +10,13 @@ _A PHP 7 API Wrapper for Popular Currency Rate APIs._
1010

1111
Dont worry about your favorite currency conversion service suddenly shutting down or switching plans on you. Switch away easily.
1212

13-
## Inspiration
13+
## Inspiration 💅
1414

1515
I needed a currency conversion API for [my travel website]() but couldn't find a good PHP package. The idea of the
1616
[`Rackbeat/php-currency-api`](https://github.com/Rackbeat/php-currency-api) package came closest but unfortunately it
1717
was just a stub and not implemented.
1818

19-
## Supported APIs
19+
## Supported APIs 🌐
2020

2121
| Service | Identifier |
2222
|------------------------------------------------------|---------------------|
@@ -26,23 +26,25 @@ was just a stub and not implemented.
2626
| [Rates API](http://ratesapi.io) | `ratesapi` |
2727
| [Exchange Rates API](https://exchangeratesapi.io) | `exchangeratesapi` |
2828

29-
## Prerequisites
29+
_If you want to see more services added, feel free to [open an issue](https://github.com/otherguy/php-currency-api/issues)!_
30+
31+
## Prerequisites 📚
3032

3133
* `PHP 7.1` or higher (Tested on: PHP `7.1` ✅, `7.2` ✅ and `7.3` ✅)
32-
* [Composer](https://getcomposer.org)
34+
* [`composer`](https://getcomposer.org)
3335
* An account with one or more of the API providers above
3436

35-
## Installation
37+
## Installation 🚀
3638

3739
Just require the package using `composer` and you're good to go!
3840

3941
```bash
4042
$ composer require otherguy/php-currency-api
4143
```
4244

43-
## Usage
45+
## Usage 🛠
4446

45-
### Initialize instance
47+
### Initialize API Instance
4648

4749
```php
4850
$api = Otherguy\Currency\API::make('fixerio'); // driver identifier from supported drivers.
@@ -81,3 +83,8 @@ $api->convert($fromCurrency = 'DKK', $toCurrency = 'EUR', 10.00); // Convert 10
8183
$api->historical($date = '2018-01-01'); // Get currency rate for base on 1st of January 2018
8284
$api->historical($date = '2018-01-01', 'GBP'); // Get currency rate for GBP on 1st of January 2018
8385
```
86+
87+
## Contributing 🚧
88+
89+
[Pull Requests](https://github.com/otherguy/php-currency-api/pulls) are more than welcome! I'm striving for 100% test
90+
coverage for this repository so please make sure to add tests for your code.

src/Symbol.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public static function name(string $currency): string
375375
*
376376
* @return array
377377
*/
378-
public static function currencyNames(): array
378+
public static function names(): array
379379
{
380380
return static::$currencyNames;
381381
}

tests/SymbolTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public function can_get_a_symbol_name() {
2121

2222
/** @test */
2323
public function can_get_a_list_of_all_symbols() {
24-
$this->assertCount(167, Symbol::currencyNames());
25-
$this->assertEquals('Lithuanian Litas', Symbol::currencyNames()[Symbol::LTL]);
26-
$this->assertEquals('Bitcoin', Symbol::currencyNames()[Symbol::BTC]);
24+
$this->assertCount(167, Symbol::names());
25+
$this->assertEquals('Lithuanian Litas', Symbol::names()[Symbol::LTL]);
26+
$this->assertEquals('Bitcoin', Symbol::names()[Symbol::BTC]);
2727
}
2828
}

0 commit comments

Comments
 (0)