Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam authored Oct 26, 2016
1 parent 800afe7 commit 37083c2
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ For each version it uses Composer SemVer parser to parse version and normalize i
### Sample:

1. Version **1.0.5**
2. Normalize with SevVer: **1.0.5.0**
3. Explode: **[ 1, 0, 5, 0 ]**
4. Converts to strings and pad zeros: **[ '100', '000', '500', '000' ]**
5. Concatenate all strings: **'100' + '000' + '500' + '000'**
6. Converts to integer: **(int) '100000500000'**
2. Normalize with SemVer: **1.0.5**
3. Explode: **[ 1, 0, 5 ]**
4. Converts to strings and pad zeros: **[ '100', '000', '500' ]**
5. Concatenate all strings: **'100' + '000' + '500'**
6. Converts to integer: **(int) '100000500'**

Result: **'1.0.5' == 100000500000**
Result: **'1.0.5' == 100000500**

# Examples

Expand Down Expand Up @@ -107,6 +107,20 @@ array (size=2)
1 => string '<' (length=1)
```

# Settings

```php
new SemVerConverter($zeros, $sections);
```

### $zeros

Defines how meny zeros need to pad for each section of versions. It allows to define how long should be result.

### $sections

Defines how many sections need to be generated from input. Default is 3, Composer SemVer generates 4. This also have an impact for result.

# Licence

This code is licensed under MIT License.

0 comments on commit 37083c2

Please sign in to comment.