Skip to content

Commit

Permalink
code types in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkhill committed Apr 5, 2016
1 parent 6b5d8cc commit 6175e47
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ Seconds, colon separated, abbreviated, all three can be parsed and interchanged.


# Install
```
```bash
composer require khill/php-duration:~1.0
```


# Usage
```
```php
use Khill\Duration\Duration;


Expand All @@ -41,15 +41,15 @@ echo $duration->formatted(); // 7:31
echo $duration->toSeconds(); // 451
```

```
```php
$duration = new Duration('1h 2m 5s');

echo $duration->humanize(); // 1h 2m 5s
echo $duration->formatted(); // 1:02:05
echo $duration->toSeconds(); // 3725
```

```
```php
$duration = new Duration('4293');

echo $duration->humanize(); // 1h 11m 33s
Expand All @@ -59,7 +59,7 @@ echo $duration->toSeconds(); // 4293

# Note
You do not have to create a new object for each conversion, you can also pass any of the three forms into any of the methods to get the immediate output.
```
```php
$duration = new Duration;

echo $duration->humanize('1h 2m 5s'); // 1h 2m 5s
Expand Down

0 comments on commit 6175e47

Please sign in to comment.