https://github.com/lewiscowles1986/php-ulid
Universally Unique Lexicographically Sortable Identifier ported to PHP
https://github.com/lewiscowles1986/php-ulid
php reference-implementation ulid
Last synced: about 2 months ago
JSON representation
Universally Unique Lexicographically Sortable Identifier ported to PHP
- Host: GitHub
- URL: https://github.com/lewiscowles1986/php-ulid
- Owner: Lewiscowles1986
- License: agpl-3.0
- Created: 2016-08-02T17:10:24.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2024-11-07T04:43:38.000Z (7 months ago)
- Last Synced: 2025-04-13T02:16:46.356Z (about 2 months ago)
- Topics: php, reference-implementation, ulid
- Language: PHP
- Size: 95.7 KB
- Stars: 81
- Watchers: 1
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-ulid
Universally Unique Lexicographically Sortable Identifier ported to PHP[](https://github.com/Lewiscowles1986/php-ulid/actions/workflows/php.yml)
Tests borrowed from [.NET port](https://github.com/fvilers/ulid.net)
Original idea borrowed from [JS](https://github.com/alizain/ulid)License AGPL
## Requirements
PHP7.4+
## Usage:
`composer require lewiscowles/ulid`
## Tests:
To generate the coverage report xdebug extension must be enabled for your PHP
### Unit-test CLI
`php vendor/bin/phpunit --coverage-html ./reports/ --whitelist src`
### Mutation testing with infection
`php vendor/bin/infection`
### PHPStan
`php vendor/bin/phpstan analyse src -l max`
### Jenkins pipeline step for testing
```Groovy
stage('Run Unit Tests in PHP') {
dir('ulid') {
sh 'php vendor/bin/phpunit --coverage-html ./reports/ --whitelist src'
}
publishHTML([allowMissing: true, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'ulid/reports', reportFiles: 'index.html', reportName: 'PHPUnit Coverage'])
}
```## Got an idea?
Create an issue, a PR, both (if possible) :smile_cat: