Skip to content

Commit

Permalink
v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Mar 10, 2020
1 parent 52454ec commit 676e7ed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to `laravel-unit-converter` will be documented in this file

## 0.1.1 - 2020-03-10

- fix default units
- add `Unit::to()` annotation with correct return type

## 0.1.0 - 2020-03-05

- initial release
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Latest Version on Packagist](https://img.shields.io/packagist/v/elbgoods/laravel-unit-converter.svg?style=flat-square)](https://packagist.org/packages/elbgoods/laravel-unit-converter)


This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

https://github.com/pimlie/php-unit-conversion
Expand Down Expand Up @@ -47,7 +46,3 @@ If you discover any security related issues, please email [email protected]
## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

## Laravel Package Boilerplate

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).
3 changes: 3 additions & 0 deletions src/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
use PhpUnitConversion\Unit as BaseUnit;
use RuntimeException;

/**
* @method Unit to(Unit|string $target)
*/
abstract class Unit extends BaseUnit implements Arrayable, Jsonable, JsonSerializable
{
/**
Expand Down
6 changes: 4 additions & 2 deletions src/UnitConverterServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ public function boot(): void
], 'config');
}

if (! config('unit-converter.default_units')) {
UnitMap::clear();
UnitMap::clear();

if (config('unit-converter.default_units')) {
UnitMap::add(__DIR__.'/Units', __NAMESPACE__.'\\Units', null);
}

foreach (config('unit-converter.units') as $unitType => $units) {
Expand Down

0 comments on commit 676e7ed

Please sign in to comment.