-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
587a710
commit 2591c89
Showing
22 changed files
with
252 additions
and
97,320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: sebastianbergmann |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | ||
|
||
on: | ||
- "pull_request" | ||
- "push" | ||
|
||
name: "CI" | ||
|
||
env: | ||
COMPOSER_ROOT_VERSION: "1.0-dev" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
coding-guidelines: | ||
name: Coding Guidelines | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
coverage: none | ||
|
||
- name: Run PHP-CS-Fixer | ||
run: ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose | ||
|
||
type-checker: | ||
name: Type Checker | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
coverage: none | ||
|
||
- name: Install dependencies with Composer | ||
run: ./tools/composer update --no-interaction --no-ansi --no-progress | ||
|
||
- name: Run Psalm | ||
run: ./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats | ||
|
||
tests: | ||
name: Tests | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: | ||
- "8.1" | ||
- "8.2" | ||
- "8.3" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v3" | ||
|
||
- name: "Install PHP with extensions" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
coverage: "pcov" | ||
|
||
- name: "Install dependencies with Composer" | ||
run: "./tools/composer update --no-ansi --no-interaction --no-progress" | ||
|
||
- name: "Run tests with PHPUnit" | ||
run: "vendor/bin/phpunit --coverage-clover=coverage.xml" | ||
|
||
- name: "Send code coverage report to Codecov.io" | ||
env: | ||
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" | ||
run: "bash <(curl -s https://codecov.io/bash) || true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phive xmlns="https://phar.io/phive"> | ||
<phar name="phpunit" version="^9.5.9" installed="9.5.13" location="./tools/phpunit" copy="true"/> | ||
<phar name="php-cs-fixer" version="^3.1.0" installed="3.6.0" location="./tools/php-cs-fixer" copy="true"/> | ||
<phar name="psalm" version="^4.10.0" installed="4.20.0" location="./tools/psalm" copy="true"/> | ||
<phar name="composer" version="^2.1.8" installed="2.2.6" location="./tools/composer" copy="true"/> | ||
<phar name="php-cs-fixer" version="^3.15" installed="3.15.1" location="./tools/php-cs-fixer" copy="true"/> | ||
<phar name="psalm" version="^5.8" installed="5.8.0" location="./tools/psalm" copy="true"/> | ||
<phar name="composer" version="^2.5" installed="2.5.4" location="./tools/composer" copy="true"/> | ||
</phive> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<files psalm-version="4.x-dev@"> | ||
</files> | ||
<files psalm-version="5.8.0@9cf4f60a333f779ad3bc704a555920e81d4fdcda"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# ChangeLog | ||
|
||
All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. | ||
|
||
## [1.0.0] - YYYY-MM-DD | ||
|
||
* Initial release | ||
|
||
[1.0.0]: https://github.com/sebastianbergmann/uuid/compare/f4a58bc49316b4dae46aa69cbe311d08932be2f6...main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2023, Sebastian Bergmann | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[![Latest Stable Version](https://poser.pugx.org/sebastian/uuid/v/stable.png)](https://packagist.org/packages/sebastian/uuid) | ||
[![CI Status](https://github.com/sebastianbergmann/uuid/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/uuid/actions) | ||
[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/uuid/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/uuid) | ||
[![codecov](https://codecov.io/gh/sebastianbergmann/uuid/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/uuid) | ||
|
||
# sebastian/uuid | ||
|
||
This package provides a single function: `uuid()`. This function uses PHP's `random_bytes()` function to generate a string that contains a 16-byte number written in hexadecimal and divided into five groups of characters (8-4-4-4-12). | ||
|
||
Strings generated using the `uuid()` function can be used as Universally Unique Identifiers (UUIDs) in certain contexts. | ||
|
||
## Installation | ||
|
||
You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): | ||
|
||
``` | ||
composer require sebastian/uuid | ||
``` | ||
|
||
If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: | ||
|
||
``` | ||
composer require --dev sebastian/uuid | ||
``` | ||
|
||
## Usage | ||
|
||
```php | ||
<?php declare(strict_types=1); | ||
use function SebastianBergmann\Uuid\uuid; | ||
|
||
var_dump(uuid()); | ||
``` | ||
``` | ||
string(36) "67b14e2a-17a4-43f7-aba5-859f7fc07b69" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Security Policy | ||
|
||
If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. | ||
|
||
**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** | ||
|
||
Instead, please send an email to `sebastian@phpunit.de`. | ||
|
||
Please include as much of the information listed below as you can to help us better understand and resolve the issue: | ||
|
||
* The type of issue | ||
* Full paths of source file(s) related to the manifestation of the issue | ||
* The location of the affected source code (tag/branch/commit or direct URL) | ||
* Any special configuration required to reproduce the issue | ||
* Step-by-step instructions to reproduce the issue | ||
* Proof-of-concept or exploit code (if possible) | ||
* Impact of the issue, including how an attacker might exploit the issue | ||
|
||
This information will help us triage your report more quickly. | ||
|
||
## Web Context | ||
|
||
The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. | ||
|
||
The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in a HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. | ||
|
||
If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. | ||
|
||
Vulnerabilities specific to the use outside of a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.