Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 55 additions & 10 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
branches: ["main"]

jobs:
php-checks:
name: PHP Checks
checks:
name: Quality Checks
runs-on: ubuntu-latest
steps:
- name: "Checkout Code"
Expand All @@ -21,19 +21,64 @@ jobs:
php-version: "8.3"
ini-values: memory_limit=-1
tools: composer:v2
- name: "Determine Composer Cache Dir"
id: composer-cache
run: |
echo "dir=$(composer -q config cache-files-dir)" >> $GITHUB_OUTPUT
- name: "Cache Dependencies"
uses: "actions/cache@v4"
with:
path: |
~/.composer/cache
key: "composer-cache"
restore-keys: "composer-cache"
path: ${{ steps.composer-cache.outputs.dir }}
key: "composer-8.3-lock"
restore-keys: "composer-8.3-lock"
- name: "Install Dependencies"
run: "composer install --ansi --no-interaction --no-progress --no-suggest"
- name: "Run Continuous Integration"
run: composer ci
run: "composer install --ansi --no-interaction --no-progress"
- name: "Check code style"
run: composer fmt:check
- name: "Check Types"
run: composer psalm:gh

test:
name: Test
runs-on: ubuntu-latest
needs: ["checks"]
strategy:
matrix:
php-version: ["8.3", "8.4"]
deps: ["lock", "highest", "lowest"]
steps:
- name: "Checkout Code"
uses: "actions/checkout@v4"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "xdebug"
php-version: ${{ matrix.php-version }}
ini-values: memory_limit=-1
tools: composer:v2
- name: "Determine Composer Cache Dir"
id: composer-cache
run: |
echo "dir=$(composer -q config cache-files-dir)" >> $GITHUB_OUTPUT
- name: "Cache Dependencies"
uses: "actions/cache@v4"
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: "composer-${{ matrix.php-version }}-${{ matrix.deps }}"
restore-keys: "composer-${{ matrix.php-version }}-${{ matrix.deps }}"
- name: "Install Dependencies"
if: ${{ matrix.deps == 'lock'}}
run: "composer install --ignore-platform-reqs --ansi --no-interaction --no-progress"
- name: "Install Highest Dependencies"
if: ${{ matrix.deps == 'highest'}}
run: "composer update --ignore-platform-reqs --ansi --no-interaction --no-progress"
- name: "Install Lowest Dependencies"
if: ${{ matrix.deps == 'lowest'}}
run: "composer update --ignore-platform-reqs --prefer-lowest --ansi --no-interaction --no-progress"
- name: "Run Test Suite"
run: composer test
- name: "Upload Coverage Report"
uses: actions/upload-artifact@v4
with:
name: "coverage-report"
name: "coverage-report-${{ matrix.php-version }}-${{ matrix.deps }}"
path: .dev/coverage
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

$header = <<<EOF
@project Castor UUID
Expand All @@ -15,6 +16,7 @@
EOF;

return (new PhpCsFixer\Config())
->setParallelConfig(ParallelConfigFactory::detect())
->setCacheFile('/tmp/php-cs-fixer')
->setRiskyAllowed(true)
->setRules([
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ echo $parsed instanceof Uuid\Version6; // Prints: false
echo $parsed->equals($uuid); // Prints: true
```

The same API is available for `Uuid\Version3` and `Uuid\Version5`.
The same API is available for `Uuid\Version3`, `Uuid\Version5`, `Uuid\Version6` and `Uuid\Version7`.

`Uuid\Version1` and `Uuid\Version6` provides an extended API that can return the different components that form it.
`Uuid\Version1`, `Uuid\Version6` and `Uuid\Version7` implement `Uuid\TimeBased` which provides an extended API that can
return the time component that form it.

`Uuid\Version2` will not be implemented.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
},
"require-dev": {
"phpunit/phpunit": "^10.5",
"friendsofphp/php-cs-fixer": "^3.49",
"vimeo/psalm": "^5.22",
"friendsofphp/php-cs-fixer": "^3.68",
"vimeo/psalm": "^5.26",
"ergebnis/phpunit-slow-test-detector": "^2.10",
"ramsey/uuid": "^4.7",
"phpbench/phpbench": "^1.3"
Expand All @@ -64,7 +64,7 @@
"@test"
],
"fmt": "php-cs-fixer fix --diff --ansi",
"fmt:check": "php-cs-fixer fix --dry-run --diff --ansi",
"fmt:check": "php-cs-fixer fix --dry-run --diff --show-progress=none --ansi",
"test": [
"phpunit --colors"
],
Expand Down
Loading
Loading