From 323a608465c5e91cc1aa18a316bfb4bcd2bff754 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 22 Sep 2021 21:12:37 -0500 Subject: [PATCH 01/34] Add a GitHub workflow for the 3.x branch --- .github/workflows/continuous-integration.yml | 108 +++++++++++++++++++ LICENSE | 2 +- composer.json | 4 +- tests/Builder/DefaultUuidBuilderTest.php | 4 +- tests/Builder/DegradedUuidBuilderTest.php | 4 +- 5 files changed, 115 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/continuous-integration.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..bc71be1 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,108 @@ +# GitHub Actions Documentation: https://docs.github.com/en/actions + +name: "build" + +on: ["pull_request", "push"] + +env: + COMPOSER_ROOT_VERSION: "1.99.99" + +jobs: + coding-standards: + name: "Coding standards" + runs-on: "ubuntu-latest" + steps: + - name: "Checkout repository" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "latest" + extensions: bcmath, ctype, gmp, libsodium, uuid + coverage: "none" + + - name: "Install dependencies (Composer)" + uses: "ramsey/composer-install@v1" + + - name: "Check syntax (php-parallel-lint)" + run: "./vendor/bin/parallel-lint src tests --colors" + + - name: "Check coding standards (PHP_CodeSniffer)" + run: "./vendor/bin/phpcs src tests --standard=psr2 -sp --colors" + + code-coverage: + name: "Code coverage" + runs-on: "ubuntu-latest" + steps: + - name: "Checkout repository" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "latest" + extensions: bcmath, ctype, gmp, libsodium, uuid + coverage: "pcov" + ini-values: "memory_limit=-1" + + - name: "Install dependencies (Composer)" + uses: "ramsey/composer-install@v1" + + - name: "Run unit tests (PHPUnit)" + run: "./vendor/bin/phpunit --verbose --colors=always --coverage-text --coverage-clover build/logs/clover.xml" + + - name: "Publish coverage report to Codecov" + uses: "codecov/codecov-action@v1" + + unit-tests: + name: "Unit Tests" + runs-on: "ubuntu-latest" + continue-on-error: ${{ matrix.experimental }} + + strategy: + fail-fast: false + matrix: + php-version: + - "5.4" + - "5.5" + - "5.6" + - "7.0" + - "7.1" + - "7.2" + - "7.3" + - "7.4" + # Commenting out the following until I can work out a solution for the + # development libraries I use, since many of them or their dependencies + # do not support PHP 8. + # + # - "8.0" + # experimental: + # - false + # include: + # - php-version: "8.1" + # experimental: true + # composer-options: "--ignore-platform-req=php" + + steps: + - name: "Checkout repository" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + extensions: bcmath, ctype, gmp, libsodium, uuid + coverage: "none" + ini-values: "memory_limit=-1" + + - name: "Create the logs directory" + run: "mkdir -p build/logs" + + - name: "Install dependencies (Composer)" + uses: "ramsey/composer-install@v1" + with: + composer-options: "${{ matrix.composer-options }}" + + - name: "Run unit tests (PHPUnit)" + run: "./vendor/bin/phpunit --verbose --colors=always --no-coverage" diff --git a/LICENSE b/LICENSE index b2aa4b5..1db0ef8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2012-2020 Ben Ramsey +Copyright (c) 2012-2021 Ben Ramsey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/composer.json b/composer.json index 62ece07..8baf11d 100644 --- a/composer.json +++ b/composer.json @@ -30,12 +30,12 @@ "codeception/aspect-mock": "^1 | ^2", "doctrine/annotations": "^1.2", "goaop/framework": "1.0.0-alpha.2 | ^1 | ^2.1", - "jakub-onderka/php-parallel-lint": "^1", "mockery/mockery": "^0.9.11 | ^1", "moontoast/math": "^1.1", "paragonie/random-lib": "^2", "php-mock/php-mock-phpunit": "^0.3 | ^1.1", - "phpunit/phpunit": "^4.8 | ^5.4 | ^6.5", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpunit/phpunit": ">=4.8.36", "squizlabs/php_codesniffer": "^3.5" }, "suggest": { diff --git a/tests/Builder/DefaultUuidBuilderTest.php b/tests/Builder/DefaultUuidBuilderTest.php index 125b497..b8bd593 100644 --- a/tests/Builder/DefaultUuidBuilderTest.php +++ b/tests/Builder/DefaultUuidBuilderTest.php @@ -2,15 +2,15 @@ namespace Ramsey\Uuid\Test\Builder; -use PHPUnit_Framework_TestCase; use Ramsey\Uuid\Builder\DefaultUuidBuilder; +use Ramsey\Uuid\Test\TestCase; /** * Class DefaultUuidBuilderTest * @package Ramsey\Uuid\Test\Builder * @covers Ramsey\Uuid\Builder\DefaultUuidBuilder */ -class DefaultUuidBuilderTest extends PHPUnit_Framework_TestCase +class DefaultUuidBuilderTest extends TestCase { public function testBuildCreatesUuid() diff --git a/tests/Builder/DegradedUuidBuilderTest.php b/tests/Builder/DegradedUuidBuilderTest.php index ce017e2..0ab682d 100644 --- a/tests/Builder/DegradedUuidBuilderTest.php +++ b/tests/Builder/DegradedUuidBuilderTest.php @@ -2,15 +2,15 @@ namespace Ramsey\Uuid\Test\Builder; -use PHPUnit_Framework_TestCase; use Ramsey\Uuid\Builder\DegradedUuidBuilder; +use Ramsey\Uuid\Test\TestCase; /** * Class DegradedUuidBuilderTest * @package Ramsey\Uuid\Test\Builder * @covers Ramsey\Uuid\Builder\DegradedUuidBuilder */ -class DegradedUuidBuilderTest extends PHPUnit_Framework_TestCase +class DegradedUuidBuilderTest extends TestCase { public function testBuildCreatesUuid() From 1a7ec4a2d1c3a432c13c9ad55832ccdc27449d21 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 22 Sep 2021 21:15:13 -0500 Subject: [PATCH 02/34] Run coding standards and coverage on PHP 7.4 --- .github/workflows/continuous-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index bc71be1..33f202a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -18,7 +18,7 @@ jobs: - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: - php-version: "latest" + php-version: "7.4" # Unable to support 8 right now extensions: bcmath, ctype, gmp, libsodium, uuid coverage: "none" @@ -41,7 +41,7 @@ jobs: - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: - php-version: "latest" + php-version: "7.4" # Unable to support 8 right now extensions: bcmath, ctype, gmp, libsodium, uuid coverage: "pcov" ini-values: "memory_limit=-1" From 64da73f96c77344dfabced7180a7260d3b2a8141 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 22 Sep 2021 21:16:15 -0500 Subject: [PATCH 03/34] Comment out continue-on-error for the unit tests build --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 33f202a..4bc38a6 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -58,7 +58,7 @@ jobs: unit-tests: name: "Unit Tests" runs-on: "ubuntu-latest" - continue-on-error: ${{ matrix.experimental }} + # continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false From 900324c01368334f8f450e63845fde99c630d42a Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 22 Sep 2021 21:27:27 -0500 Subject: [PATCH 04/34] Install dependencies for PECL extensions --- .github/workflows/continuous-integration.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4bc38a6..848bfec 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -19,7 +19,6 @@ jobs: uses: "shivammathur/setup-php@v2" with: php-version: "7.4" # Unable to support 8 right now - extensions: bcmath, ctype, gmp, libsodium, uuid coverage: "none" - name: "Install dependencies (Composer)" @@ -38,6 +37,11 @@ jobs: - name: "Checkout repository" uses: "actions/checkout@v2" + - name: "Install dependencies (apt)" + run: | + sudo apt-get update + sudo apt-get -y install bsdmainutils libsodium-dev uuid-dev + - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: @@ -88,6 +92,11 @@ jobs: - name: "Checkout repository" uses: "actions/checkout@v2" + - name: "Install dependencies (apt)" + run: | + sudo apt-get update + sudo apt-get -y install bsdmainutils libsodium-dev uuid-dev + - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: From 1744aa802363286cd694ef8a9c3ce2060c536878 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 22 Sep 2021 21:31:54 -0500 Subject: [PATCH 05/34] Use sodium instead of libsodium --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 848bfec..ede696f 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -101,7 +101,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" - extensions: bcmath, ctype, gmp, libsodium, uuid + extensions: bcmath, ctype, gmp, sodium, uuid coverage: "none" ini-values: "memory_limit=-1" From 1c50f77b065d3c47581a2a1f2d846c25d8d31af5 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 22 Sep 2021 21:41:22 -0500 Subject: [PATCH 06/34] See if we can get extensions install on PHP 5 --- .github/workflows/continuous-integration.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index ede696f..58adb8d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -46,7 +46,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: php-version: "7.4" # Unable to support 8 right now - extensions: bcmath, ctype, gmp, libsodium, uuid + extensions: "bcmath, ctype, gmp, sodium, uuid" coverage: "pcov" ini-values: "memory_limit=-1" @@ -83,10 +83,16 @@ jobs: # - "8.0" # experimental: # - false - # include: + include: # - php-version: "8.1" # experimental: true # composer-options: "--ignore-platform-req=php" + - php-version: "5.4" + extensions: ", libsodium-1.0.7, uuid-1.0.4" + - php-version: "5.5" + extensions: ", libsodium-1.0.7, uuid-1.0.4" + - php-version: "5.6" + extensions: ", libsodium-1.0.7, uuid-1.0.4" steps: - name: "Checkout repository" @@ -101,7 +107,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" - extensions: bcmath, ctype, gmp, sodium, uuid + extensions: "bcmath, ctype, gmp, sodium, uuid ${{ matrix.extensions }}" coverage: "none" ini-values: "memory_limit=-1" From 8d6c144a37fc7e18939fd1ccd1dd4e17aafb5f5d Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 22 Sep 2021 21:49:30 -0500 Subject: [PATCH 07/34] Remove Travis CI support files and configs --- .travis.yml | 68 ---------------------- resources/docker/Dockerfile | 25 -------- resources/docker/build.sh | 10 ---- resources/docker/composer-install.sh | 17 ------ resources/scripts/cmd-proxy.sh | 25 -------- resources/scripts/php-coveralls.sh | 9 --- resources/scripts/system-info.sh | 19 ------ resources/scripts/travis-before-install.sh | 15 ----- 8 files changed, 188 deletions(-) delete mode 100644 .travis.yml delete mode 100644 resources/docker/Dockerfile delete mode 100755 resources/docker/build.sh delete mode 100755 resources/docker/composer-install.sh delete mode 100755 resources/scripts/cmd-proxy.sh delete mode 100755 resources/scripts/php-coveralls.sh delete mode 100755 resources/scripts/system-info.sh delete mode 100755 resources/scripts/travis-before-install.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e04cbc0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -language: php -os: linux - -services: - - docker - -jobs: - fast_finish: true - include: - - php: 5.4 - dist: trusty - - php: 5.5 - dist: trusty - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: 7.1 - arch: s390x - - php: 7.2 - - php: 7.2 - arch: s390x - - php: 7.2 - arch: arm64 - env: ARCH=arm32 - - php: 7.3 - - php: 7.3 - arch: s390x - - php: 7.3 - arch: arm64 - env: ARCH=arm32 - - php: 7.4 - - php: 7.4 - arch: s390x - - php: 7.4 - arch: arm64 - env: ARCH=arm32 - - php: nightly - - php: nightly - arch: s390x - allow_failures: - - php: nightly - -addons: - apt: - update: true - packages: - - bsdmainutils - - libsodium-dev - - uuid-dev - -before_install: - - travis_retry ./resources/scripts/travis-before-install.sh - - ./resources/scripts/cmd-proxy.sh ./resources/scripts/system-info.sh - -install: - - travis_retry ./resources/scripts/cmd-proxy.sh composer require --no-update "php-coveralls/php-coveralls:^1 | ^2" - - travis_retry ./resources/scripts/cmd-proxy.sh composer install --no-interaction --prefer-dist --no-progress --no-suggest - -before_script: - - mkdir -p build/logs - -script: - - ./resources/scripts/cmd-proxy.sh ./vendor/bin/parallel-lint src tests - - ./resources/scripts/cmd-proxy.sh ./vendor/bin/phpcs src tests --standard=psr2 -sp --colors - - travis_wait ./resources/scripts/cmd-proxy.sh ./vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml - -after_success: - - travis_retry ./resources/scripts/php-coveralls.sh diff --git a/resources/docker/Dockerfile b/resources/docker/Dockerfile deleted file mode 100644 index 96aaf00..0000000 --- a/resources/docker/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -ARG PHP_VERSION -ARG ARCH - -FROM ${ARCH}/php:${PHP_VERSION}-cli-alpine - -RUN apk update \ - && apk add --virtual=builddeps autoconf g++ gcc libc6-compat make re2c \ - && apk add \ - git \ - gmp-dev \ - libsodium-dev \ - libzip-dev \ - unzip \ - util-linux-dev \ - && docker-php-ext-install -j$(nproc) bcmath gmp zip \ - && yes '' | pecl install libsodium-1.0.7 \ - && yes '' | pecl install uuid \ - && yes '' | pecl install xdebug \ - && docker-php-ext-enable libsodium uuid xdebug \ - && apk del builddeps - -COPY composer-install.sh /usr/local/bin/composer-install.sh -RUN composer-install.sh \ - && mv composer.phar /usr/local/bin/composer \ - && rm /usr/local/bin/composer-install.sh diff --git a/resources/docker/build.sh b/resources/docker/build.sh deleted file mode 100755 index 8cb3029..0000000 --- a/resources/docker/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -PHP_VERSION=$1 -ARCH=$2 - -docker build \ - --tag benramsey/ramsey-uuid:php-${PHP_VERSION}-${ARCH} \ - --build-arg PHP_VERSION=${PHP_VERSION} \ - --build-arg ARCH=${ARCH} \ - . diff --git a/resources/docker/composer-install.sh b/resources/docker/composer-install.sh deleted file mode 100755 index 89abc1a..0000000 --- a/resources/docker/composer-install.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -EXPECTED_SIGNATURE="$(curl --silent https://composer.github.io/installer.sig)" -php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" - -if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] -then - >&2 echo 'ERROR: Invalid installer signature' - rm composer-setup.php - exit 1 -fi - -php composer-setup.php --quiet -RESULT=$? -rm composer-setup.php -exit $RESULT diff --git a/resources/scripts/cmd-proxy.sh b/resources/scripts/cmd-proxy.sh deleted file mode 100755 index f44eb56..0000000 --- a/resources/scripts/cmd-proxy.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# -# This script uses the ARCH environment variable to determine whether to run -# the commands through a 32-bit Docker container, for 32-bit testing. If the -# ARCH is anything other than "arm32," then it simply executes the commands -# on the local system, rather than in a container. - -php_version="${TRAVIS_PHP_VERSION:-$(php -r "echo phpversion();")}" - -dots_count=$(echo $php_version | awk -F"." '{print NF-1}') -if [ $dots_count -ge 2 ]; then - php_version="${php_version%.*}" -fi - -architecture="${ARCH:-${TRAVIS_CPU_ARCH:-$(uname -m)}}" - -cmd_proxy="" - -if [ "${architecture}" = "arm32" ]; then - image="benramsey/ramsey-uuid:php-${php_version}-arm32v7" - volumes="-v ${PWD}:${PWD}" - cmd_proxy="docker run --rm ${volumes} -w ${PWD} ${image}" -fi - -$cmd_proxy "$@" diff --git a/resources/scripts/php-coveralls.sh b/resources/scripts/php-coveralls.sh deleted file mode 100755 index d194ff4..0000000 --- a/resources/scripts/php-coveralls.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e - -if [ -f vendor/bin/php-coveralls ]; then - php vendor/bin/php-coveralls -v -else - php vendor/bin/coveralls -v -fi diff --git a/resources/scripts/system-info.sh b/resources/scripts/system-info.sh deleted file mode 100755 index af35a54..0000000 --- a/resources/scripts/system-info.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -endianness=$(printf I | hexdump -o | awk '{ print substr($2,6,1); exit}') - -endian="Big" -if [ "${endianness}" = "1" ]; then - endian="Little" -fi - -echo -echo "SYSTEM INFORMATION:" -echo -echo "$(uname -a)" -echo -echo "CPU mode: $(getconf LONG_BIT)-bit" -echo "Endianness: ${endian}" -echo -php --version -echo diff --git a/resources/scripts/travis-before-install.sh b/resources/scripts/travis-before-install.sh deleted file mode 100755 index 1612def..0000000 --- a/resources/scripts/travis-before-install.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# This script runs as part of the Travis CI before_install phase. If the ARCH -# environment variable is set and has the value "arm32," then we exit early, -# since we will use a pre-built Docker image to run commands instead. - -architecture=${ARCH:-${TRAVIS_CPU_ARCH:-$(uname -m)}} - -if [ "${architecture}" = "arm32" ]; then - exit -fi - -yes '' | pecl install -f libsodium-1.0.7 -yes '' | pecl install -f uuid-1.0.4 -composer self-update From 372d084fe93e007db7090693c7becf60202352a1 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 22 Sep 2021 21:51:30 -0500 Subject: [PATCH 08/34] Add configuration for Codecov --- .gitattributes | 3 +-- codecov.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 codecov.yml diff --git a/.gitattributes b/.gitattributes index a3066a5..ae09278 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,8 @@ .gitattributes export-ignore .github/ export-ignore .gitignore export-ignore -.travis.yml export-ignore +codecov.yml export-ignore docs/ export-ignore phpstan.neon export-ignore phpunit.xml.dist export-ignore -resources/ export-ignore tests/ export-ignore diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..047a8a9 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,29 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "70...100" + status: + project: + default: + target: auto + threshold: 0% + patch: + default: + target: auto + threshold: 0% + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: + layout: "reach,diff,flags,tree" + behavior: default + require_changes: false From 1c5b9aa277ffdb85e94857e09e5d5fdddf5ab51c Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 22 Sep 2021 22:00:13 -0500 Subject: [PATCH 09/34] Set up pcov for coverage --- .github/workflows/continuous-integration.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 58adb8d..636502f 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -41,6 +41,7 @@ jobs: run: | sudo apt-get update sudo apt-get -y install bsdmainutils libsodium-dev uuid-dev + mkdir -p build/logs - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -53,6 +54,11 @@ jobs: - name: "Install dependencies (Composer)" uses: "ramsey/composer-install@v1" + - name: "Setup PCOV" + run: | + composer require pcov/clobber + vendor/bin/pcov clobber + - name: "Run unit tests (PHPUnit)" run: "./vendor/bin/phpunit --verbose --colors=always --coverage-text --coverage-clover build/logs/clover.xml" @@ -102,6 +108,7 @@ jobs: run: | sudo apt-get update sudo apt-get -y install bsdmainutils libsodium-dev uuid-dev + mkdir -p build/logs - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -111,9 +118,6 @@ jobs: coverage: "none" ini-values: "memory_limit=-1" - - name: "Create the logs directory" - run: "mkdir -p build/logs" - - name: "Install dependencies (Composer)" uses: "ramsey/composer-install@v1" with: From 3b166cd5e734ddfb95d9502066b926f7348b3665 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 23 Sep 2021 11:19:52 -0500 Subject: [PATCH 10/34] Update README badges --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 95d4c21..28fa5c9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # ramsey/uuid +*IMPORTANT: This is the 3.x series. Please upgrade to the 4.x series.* + *NOTICE: Formerly known as `rhumsaa/uuid`, The package and namespace names have changed to `ramsey/uuid` and `Ramsey\Uuid`, respectively.* @@ -9,7 +11,6 @@ changed to `ramsey/uuid` and `Ramsey\Uuid`, respectively.* [![PHP Version][badge-php]][php] [![Build Status][badge-build]][build] [![Coverage Status][badge-coverage]][coverage] -[![Total Downloads][badge-downloads]][downloads] ramsey/uuid is a PHP 5.4+ library for generating and working with [RFC 4122][rfc4122] version 1, 3, 4, and 5 universally unique identifiers @@ -171,15 +172,13 @@ information. [badge-source]: https://img.shields.io/badge/source-ramsey/uuid-blue.svg?style=flat-square [badge-release]: https://img.shields.io/packagist/v/ramsey/uuid.svg?style=flat-square&label=release [badge-license]: https://img.shields.io/packagist/l/ramsey/uuid.svg?style=flat-square -[badge-php]: https://img.shields.io/packagist/php-v/ramsey/uuid.svg?style=flat-square -[badge-build]: https://img.shields.io/travis/ramsey/uuid/master.svg?style=flat-square -[badge-coverage]: https://img.shields.io/coveralls/github/ramsey/uuid/master.svg?style=flat-square -[badge-downloads]: https://img.shields.io/packagist/dt/ramsey/uuid.svg?style=flat-square&colorB=mediumvioletred +[badge-php]: https://img.shields.io/packagist/php-v/ramsey/uuid/3.x-dev.svg?style=flat-square +[badge-build]: https://img.shields.io/github/workflow/status/ramsey/uuid/build/3.x.svg?logo=github&style=flat-square +[badge-coverage]: https://img.shields.io/codecov/c/gh/ramsey/uuid/3.x.svg?style=flat-square&logo=codecov [source]: https://github.com/ramsey/uuid [release]: https://packagist.org/packages/ramsey/uuid [license]: https://github.com/ramsey/uuid/blob/master/LICENSE [php]: https://php.net -[build]: https://travis-ci.org/ramsey/uuid -[coverage]: https://coveralls.io/github/ramsey/uuid?branch=master -[downloads]: https://packagist.org/packages/ramsey/uuid +[build]: https://github.com/ramsey/uuid/actions/workflows/continuous-integration.yml?query=branch%3A3.x +[coverage]: https://app.codecov.io/gh/ramsey/uuid/branch/3.x From d10c09b1667848380c4c5b03134ad43be4147ef8 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 23 Sep 2021 11:47:19 -0500 Subject: [PATCH 11/34] Restrict codeception/aspect-mock from going above 2.3.2 Refer to https://github.com/Codeception/AspectMock/issues/185 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8baf11d..13ae4cb 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "codeception/aspect-mock": "^1 | ^2", + "codeception/aspect-mock": "^1 | >=2.0.0 <=2.3.2", "doctrine/annotations": "^1.2", "goaop/framework": "1.0.0-alpha.2 | ^1 | ^2.1", "mockery/mockery": "^0.9.11 | ^1", From fe0bc83c60858410774f08645b406cb9c375c5c6 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 23 Sep 2021 12:20:20 -0500 Subject: [PATCH 12/34] Revert "Restrict codeception/aspect-mock from going above 2.3.2" This reverts commit d10c09b1667848380c4c5b03134ad43be4147ef8. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 13ae4cb..8baf11d 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "codeception/aspect-mock": "^1 | >=2.0.0 <=2.3.2", + "codeception/aspect-mock": "^1 | ^2", "doctrine/annotations": "^1.2", "goaop/framework": "1.0.0-alpha.2 | ^1 | ^2.1", "mockery/mockery": "^0.9.11 | ^1", From e2ec78e3d9b498bc1da616a0112732bb2e4adfa4 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 23 Sep 2021 12:22:32 -0500 Subject: [PATCH 13/34] Attempt to pin a few versions to get tests passing on PHP 7.0 See https://github.com/Codeception/AspectMock/issues/185 --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8baf11d..0ee4144 100644 --- a/composer.json +++ b/composer.json @@ -29,9 +29,10 @@ "require-dev": { "codeception/aspect-mock": "^1 | ^2", "doctrine/annotations": "^1.2", - "goaop/framework": "1.0.0-alpha.2 | ^1 | ^2.1", + "goaop/framework": "1.0.0-alpha.2 | ^1 | >=2.1.0 <=2.3.2", "mockery/mockery": "^0.9.11 | ^1", "moontoast/math": "^1.1", + "nikic/php-parser": "<=4.5.0", "paragonie/random-lib": "^2", "php-mock/php-mock-phpunit": "^0.3 | ^1.1", "php-parallel-lint/php-parallel-lint": "^1.3", From c9ed6dd82fb46dc4d54bc42e87e36f92a41922a4 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 23 Sep 2021 13:58:48 -0500 Subject: [PATCH 14/34] Prepare tests for running on PHP 8 --- .github/workflows/continuous-integration.yml | 18 +- composer.json | 5 +- tests/Codec/GuidStringCodecTest.php | 8 +- tests/Codec/OrderedTimeCodecTest.php | 10 +- tests/Codec/StringCodecTest.php | 12 +- .../Number/DegradedNumberConverterTest.php | 10 +- tests/Encoder/TimestampFirstCombCodecTest.php | 3 +- tests/Encoder/TimestampLastCombCodecTest.php | 3 +- tests/ExpectedBehaviorTest.php | 22 +-- tests/FunctionsTest.php | 8 +- tests/Generator/CombGeneratorTest.php | 9 +- tests/Generator/DefaultTimeGeneratorTest.php | 14 +- tests/Generator/OpenSslGeneratorTest.php | 2 + .../Generator/PeclUuidRandomGeneratorTest.php | 4 + tests/Generator/PeclUuidTimeGeneratorTest.php | 4 + tests/Generator/RandomBytesGeneratorTest.php | 2 + tests/Generator/RandomLibAdapterTest.php | 11 +- tests/Generator/SodiumRandomGeneratorTest.php | 2 +- .../Provider/Node/RandomNodeProviderTest.php | 10 +- .../Provider/Node/SystemNodeProviderTest.php | 15 ++ tests/Provider/Time/FixedTimeProviderTest.php | 2 +- .../Provider/Time/SystemTimeProviderTest.php | 1 + tests/TestCase.php | 14 +- tests/UuidTest.php | 155 ++++++++---------- tests/bootstrap.php | 14 +- 25 files changed, 189 insertions(+), 169 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 636502f..b34ca20 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -68,7 +68,7 @@ jobs: unit-tests: name: "Unit Tests" runs-on: "ubuntu-latest" - # continue-on-error: ${{ matrix.experimental }} + continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false @@ -82,17 +82,13 @@ jobs: - "7.2" - "7.3" - "7.4" - # Commenting out the following until I can work out a solution for the - # development libraries I use, since many of them or their dependencies - # do not support PHP 8. - # - # - "8.0" - # experimental: - # - false + - "8.0" + experimental: + - false include: - # - php-version: "8.1" - # experimental: true - # composer-options: "--ignore-platform-req=php" + - php-version: "8.1" + experimental: true + composer-options: "--ignore-platform-req=php" - php-version: "5.4" extensions: ", libsodium-1.0.7, uuid-1.0.4" - php-version: "5.5" diff --git a/composer.json b/composer.json index 0ee4144..cb69fca 100644 --- a/composer.json +++ b/composer.json @@ -34,10 +34,11 @@ "moontoast/math": "^1.1", "nikic/php-parser": "<=4.5.0", "paragonie/random-lib": "^2", - "php-mock/php-mock-phpunit": "^0.3 | ^1.1", + "php-mock/php-mock-phpunit": "^0.3 | ^1.1 | ^2.6", "php-parallel-lint/php-parallel-lint": "^1.3", "phpunit/phpunit": ">=4.8.36", - "squizlabs/php_codesniffer": "^3.5" + "squizlabs/php_codesniffer": "^3.5", + "yoast/phpunit-polyfills": "^1.0" }, "suggest": { "ext-ctype": "Provides support for PHP Ctype functions", diff --git a/tests/Codec/GuidStringCodecTest.php b/tests/Codec/GuidStringCodecTest.php index da69cda..feb80b9 100644 --- a/tests/Codec/GuidStringCodecTest.php +++ b/tests/Codec/GuidStringCodecTest.php @@ -22,9 +22,9 @@ class GuidStringCodecTest extends TestCase /** @var array */ private $fields; - protected function setUp() + protected function set_up() { - parent::setUp(); + parent::set_up(); $this->builder = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); $this->uuid = $this->getMockBuilder('Ramsey\Uuid\UuidInterface')->getMock(); $this->fields = ['time_low' => '12345678', @@ -35,9 +35,9 @@ class GuidStringCodecTest extends TestCase 'node' => '1234abcd4321']; } - protected function tearDown() + protected function tear_down() { - parent::tearDown(); + parent::tear_down(); $this->builder = null; $this->fields = null; $this->uuid = null; diff --git a/tests/Codec/OrderedTimeCodecTest.php b/tests/Codec/OrderedTimeCodecTest.php index 33dae91..9fe51fb 100644 --- a/tests/Codec/OrderedTimeCodecTest.php +++ b/tests/Codec/OrderedTimeCodecTest.php @@ -26,9 +26,9 @@ class OrderedTimeCodecTest extends TestCase /** @var string */ private $optimizedHex = '11d8eebc58e0a7d796690800200c9a66'; - protected function setUp() + protected function set_up() { - parent::setUp(); + parent::set_up(); $this->builder = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); $this->uuid = $this->getMockBuilder('Ramsey\Uuid\UuidInterface')->getMock(); $this->fields = ['time_low' => '58e0a7d7', @@ -39,9 +39,9 @@ class OrderedTimeCodecTest extends TestCase 'node' => '0800200c9a66']; } - protected function tearDown() + protected function tear_down() { - parent::tearDown(); + parent::tear_down(); $this->builder = null; $this->uuid = null; $this->fields = null; @@ -89,7 +89,7 @@ class OrderedTimeCodecTest extends TestCase $string = '61'; $bytes = pack('H*', $string); $codec = new OrderedTimeCodec($this->builder); - $this->setExpectedException('InvalidArgumentException', '$bytes string should contain 16 characters.'); + $this->expectException('InvalidArgumentException', '$bytes string should contain 16 characters.'); $codec->decodeBytes($bytes); } diff --git a/tests/Codec/StringCodecTest.php b/tests/Codec/StringCodecTest.php index d86f0fb..a510191 100644 --- a/tests/Codec/StringCodecTest.php +++ b/tests/Codec/StringCodecTest.php @@ -24,9 +24,9 @@ class StringCodecTest extends TestCase /** @var string */ private $uuidString = '12345678-1234-abcd-abef-1234abcd4321'; - protected function setUp() + protected function set_up() { - parent::setUp(); + parent::set_up(); $this->builder = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); $this->uuid = $this->getMockBuilder('Ramsey\Uuid\UuidInterface')->getMock(); $this->fields = ['time_low' => '12345678', @@ -37,9 +37,9 @@ class StringCodecTest extends TestCase 'node' => '1234abcd4321']; } - protected function tearDown() + protected function tear_down() { - parent::tearDown(); + parent::tear_down(); $this->builder = null; $this->uuid = null; $this->fields = null; @@ -95,7 +95,7 @@ class StringCodecTest extends TestCase public function testDecodeThrowsExceptionOnInvalidUuid() { $string = 'invalid-uuid'; - $this->setExpectedException('\InvalidArgumentException'); + $this->expectException('\InvalidArgumentException'); $codec = new StringCodec($this->builder); $codec->decode($string); } @@ -115,7 +115,7 @@ class StringCodecTest extends TestCase $string = '61'; $bytes = pack('H*', $string); $codec = new StringCodec($this->builder); - $this->setExpectedException('InvalidArgumentException', '$bytes string should contain 16 characters.'); + $this->expectException('InvalidArgumentException', '$bytes string should contain 16 characters.'); $codec->decodeBytes($bytes); } diff --git a/tests/Converter/Number/DegradedNumberConverterTest.php b/tests/Converter/Number/DegradedNumberConverterTest.php index 02a9b2d..9d6ad83 100644 --- a/tests/Converter/Number/DegradedNumberConverterTest.php +++ b/tests/Converter/Number/DegradedNumberConverterTest.php @@ -12,23 +12,21 @@ use Ramsey\Uuid\Converter\Number\DegradedNumberConverter; */ class DegradedNumberConverterTest extends TestCase { - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testConvertingFromHexThrowsException() { $converter = new DegradedNumberConverter(); + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $converter->fromHex('ffff'); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testConvertingToHexThrowsException() { $converter = new DegradedNumberConverter(); + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $converter->toHex(0); } } diff --git a/tests/Encoder/TimestampFirstCombCodecTest.php b/tests/Encoder/TimestampFirstCombCodecTest.php index 248f6cb..911cf21 100644 --- a/tests/Encoder/TimestampFirstCombCodecTest.php +++ b/tests/Encoder/TimestampFirstCombCodecTest.php @@ -18,8 +18,9 @@ class TimestampFirstCombCodecTest extends TestCase */ private $builderMock; - protected function setUp() + protected function set_up() { + parent::set_up(); $this->builderMock = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); $this->codec = new TimestampFirstCombCodec($this->builderMock); } diff --git a/tests/Encoder/TimestampLastCombCodecTest.php b/tests/Encoder/TimestampLastCombCodecTest.php index 266449b..7952a0a 100644 --- a/tests/Encoder/TimestampLastCombCodecTest.php +++ b/tests/Encoder/TimestampLastCombCodecTest.php @@ -18,8 +18,9 @@ class TimestampLastCombCodecTest extends TestCase */ private $builderMock; - protected function setUp() + protected function set_up() { + parent::set_up(); $this->builderMock = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); $this->codec = new TimestampLastCombCodec($this->builderMock); } diff --git a/tests/ExpectedBehaviorTest.php b/tests/ExpectedBehaviorTest.php index 87de78f..733c1f1 100644 --- a/tests/ExpectedBehaviorTest.php +++ b/tests/ExpectedBehaviorTest.php @@ -32,27 +32,27 @@ class ExpectedBehaviorTest extends TestCase $uuid = call_user_func_array(['Ramsey\Uuid\Uuid', $method], $args); $this->assertInstanceOf('Ramsey\Uuid\UuidInterface', $uuid); - $this->assertInternalType('int', $uuid->compareTo(Uuid::uuid1())); + $this->assertIsInt($uuid->compareTo(Uuid::uuid1())); $this->assertNotSame(0, $uuid->compareTo(Uuid::uuid4())); $this->assertSame(0, $uuid->compareTo(clone $uuid)); $this->assertFalse($uuid->equals(new stdClass())); $this->assertTrue($uuid->equals(clone $uuid)); - $this->assertInternalType('string', $uuid->getBytes()); + $this->assertIsString($uuid->getBytes()); $this->assertInstanceOf('Ramsey\Uuid\Converter\NumberConverterInterface', $uuid->getNumberConverter()); - $this->assertInternalType('string', $uuid->getHex()); - $this->assertInternalType('array', $uuid->getFieldsHex()); + $this->assertIsString($uuid->getHex()); + $this->assertIsArray($uuid->getFieldsHex()); $this->assertArrayHasKey('time_low', $uuid->getFieldsHex()); $this->assertArrayHasKey('time_mid', $uuid->getFieldsHex()); $this->assertArrayHasKey('time_hi_and_version', $uuid->getFieldsHex()); $this->assertArrayHasKey('clock_seq_hi_and_reserved', $uuid->getFieldsHex()); $this->assertArrayHasKey('clock_seq_low', $uuid->getFieldsHex()); $this->assertArrayHasKey('node', $uuid->getFieldsHex()); - $this->assertInternalType('string', $uuid->getTimeLowHex()); - $this->assertInternalType('string', $uuid->getTimeMidHex()); - $this->assertInternalType('string', $uuid->getTimeHiAndVersionHex()); - $this->assertInternalType('string', $uuid->getClockSeqHiAndReservedHex()); - $this->assertInternalType('string', $uuid->getClockSeqLowHex()); - $this->assertInternalType('string', $uuid->getNodeHex()); + $this->assertIsString($uuid->getTimeLowHex()); + $this->assertIsString($uuid->getTimeMidHex()); + $this->assertIsString($uuid->getTimeHiAndVersionHex()); + $this->assertIsString($uuid->getClockSeqHiAndReservedHex()); + $this->assertIsString($uuid->getClockSeqLowHex()); + $this->assertIsString($uuid->getNodeHex()); $this->assertSame($uuid->getFieldsHex()['time_low'], $uuid->getTimeLowHex()); $this->assertSame($uuid->getFieldsHex()['time_mid'], $uuid->getTimeMidHex()); $this->assertSame($uuid->getFieldsHex()['time_hi_and_version'], $uuid->getTimeHiAndVersionHex()); @@ -82,7 +82,7 @@ class ExpectedBehaviorTest extends TestCase . $uuid->getFieldsHex()['node'] ); - $this->assertInternalType('string', $uuid->getUrn()); + $this->assertIsString($uuid->getUrn()); $this->assertStringStartsWith('urn:uuid:', $uuid->getUrn()); $this->assertSame('urn:uuid:' . $uuid->getHex(), str_replace('-', '', $uuid->getUrn())); $this->assertSame($uuid->getHex(), str_replace('-', '', $uuid->toString())); diff --git a/tests/FunctionsTest.php b/tests/FunctionsTest.php index e8aaf46..1fc59fd 100644 --- a/tests/FunctionsTest.php +++ b/tests/FunctionsTest.php @@ -10,7 +10,7 @@ class FunctionsTest extends TestCase { $v1 = \Ramsey\Uuid\v1(); - $this->assertInternalType('string', $v1); + $this->assertIsString($v1); $this->assertSame(Uuid::UUID_TYPE_TIME, Uuid::fromString($v1)->getVersion()); } @@ -19,7 +19,7 @@ class FunctionsTest extends TestCase $ns = Uuid::fromString(Uuid::NAMESPACE_URL); $v3 = \Ramsey\Uuid\v3($ns, 'https://example.com/foo'); - $this->assertInternalType('string', $v3); + $this->assertIsString($v3); $this->assertSame(Uuid::UUID_TYPE_HASH_MD5, Uuid::fromString($v3)->getVersion()); } @@ -27,7 +27,7 @@ class FunctionsTest extends TestCase { $v4 = \Ramsey\Uuid\v4(); - $this->assertInternalType('string', $v4); + $this->assertIsString($v4); $this->assertSame(Uuid::UUID_TYPE_RANDOM, Uuid::fromString($v4)->getVersion()); } @@ -36,7 +36,7 @@ class FunctionsTest extends TestCase $ns = Uuid::fromString(Uuid::NAMESPACE_URL); $v5 = \Ramsey\Uuid\v5($ns, 'https://example.com/foo'); - $this->assertInternalType('string', $v5); + $this->assertIsString($v5); $this->assertSame(Uuid::UUID_TYPE_HASH_SHA1, Uuid::fromString($v5)->getVersion()); } } diff --git a/tests/Generator/CombGeneratorTest.php b/tests/Generator/CombGeneratorTest.php index 28bbd55..8f7ade0 100644 --- a/tests/Generator/CombGeneratorTest.php +++ b/tests/Generator/CombGeneratorTest.php @@ -59,7 +59,7 @@ class CombGeneratorTest extends TestCase $generator = new CombGenerator($randomGenerator, $converter); $returned = $generator->generate($length); - $this->assertInternalType('string', $returned); + $this->assertIsString($returned); $this->assertEquals($expected, $returned); } @@ -75,19 +75,16 @@ class CombGeneratorTest extends TestCase */ public function testGenerateWithLessThanTimestampBytesThrowsException($length) { - $this->setExpectedException('InvalidArgumentException'); + $this->expectException('InvalidArgumentException'); $randomGenerator = $this->getMockBuilder('Ramsey\Uuid\Generator\RandomGeneratorInterface')->getMock(); $converter = $this->getMockBuilder('Ramsey\Uuid\Converter\NumberConverterInterface')->getMock(); $generator = new CombGenerator($randomGenerator, $converter); $generator->generate($length); } - /** - * PHP Unit converts the error to an exception so we can test it. - */ public function testGenerateWithOddNumberOverTimestampBytesCausesError() { - $this->setExpectedException('PHPUnit_Framework_Error'); + $this->expectError(); $randomGenerator = $this->getMockBuilder('Ramsey\Uuid\Generator\RandomGeneratorInterface')->getMock(); $converter = $this->getMockBuilder('Ramsey\Uuid\Converter\NumberConverterInterface')->getMock(); $generator = new CombGenerator($randomGenerator, $converter); diff --git a/tests/Generator/DefaultTimeGeneratorTest.php b/tests/Generator/DefaultTimeGeneratorTest.php index 3534297..51affa0 100644 --- a/tests/Generator/DefaultTimeGeneratorTest.php +++ b/tests/Generator/DefaultTimeGeneratorTest.php @@ -27,10 +27,9 @@ class DefaultTimeGeneratorTest extends TestCase /** @var int */ private $clockSeq = 4066; - - protected function setUp() + protected function set_up() { - parent::setUp(); + parent::set_up(); $this->timeProvider = $this->getMockBuilder('Ramsey\Uuid\Provider\TimeProviderInterface')->getMock(); $this->nodeProvider = $this->getMockBuilder('Ramsey\Uuid\Provider\NodeProviderInterface')->getMock(); $this->timeConverter = $this->getMockBuilder('Ramsey\Uuid\Converter\TimeConverterInterface')->getMock(); @@ -38,14 +37,12 @@ class DefaultTimeGeneratorTest extends TestCase $this->calculatedTime = ["low" => "83cb98e0", "mid" => "98e0", "hi" => "03cb"]; } - protected function tearDown() + protected function tear_down() { - parent::tearDown(); + parent::tear_down(); $this->timeProvider = null; $this->nodeProvider = null; $this->timeConverter = null; - Mockery::close(); - AspectMock::clean(); } public function testGenerateUsesNodeProviderWhenNodeIsNull() @@ -125,7 +122,7 @@ class DefaultTimeGeneratorTest extends TestCase $this->timeConverter, $this->timeProvider ); - $defaultTimeGenerator->generate($this->nodeId, $this->clockSeq); + $this->assertIsString($defaultTimeGenerator->generate($this->nodeId, $this->clockSeq)); } /** @@ -170,6 +167,7 @@ class DefaultTimeGeneratorTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testGenerateUsesRandomSequenceWhenClockSeqNull() { diff --git a/tests/Generator/OpenSslGeneratorTest.php b/tests/Generator/OpenSslGeneratorTest.php index 33f28ae..f8edb22 100644 --- a/tests/Generator/OpenSslGeneratorTest.php +++ b/tests/Generator/OpenSslGeneratorTest.php @@ -26,6 +26,7 @@ class OpenSslGeneratorTest extends TestCase * @dataProvider lengthAndHexDataProvider * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 * @param $length * @param $hex */ @@ -43,6 +44,7 @@ class OpenSslGeneratorTest extends TestCase * @dataProvider lengthAndHexDataProvider * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 * @param $length * @param $hex */ diff --git a/tests/Generator/PeclUuidRandomGeneratorTest.php b/tests/Generator/PeclUuidRandomGeneratorTest.php index 650a93c..9e5795e 100644 --- a/tests/Generator/PeclUuidRandomGeneratorTest.php +++ b/tests/Generator/PeclUuidRandomGeneratorTest.php @@ -17,6 +17,8 @@ class PeclUuidRandomGeneratorTest extends PeclUuidTestCase * This test is just to check collaboration with the PECL UUID extension - not to check * the correctness of the methods defined in that extension. * So we are just checking that the UUID methods are called with the right parameters. + * + * @requires PHP < 8 */ public function testGenerateCreatesUuidUsingPeclUuidMethods() { @@ -33,6 +35,8 @@ class PeclUuidRandomGeneratorTest extends PeclUuidTestCase /** * This test is for the return type of the generate method * It ensures that the generate method returns whatever value uuid_parse returns. + * + * @requires PHP < 8 */ public function testGenerateReturnsUuidString() { diff --git a/tests/Generator/PeclUuidTimeGeneratorTest.php b/tests/Generator/PeclUuidTimeGeneratorTest.php index a3ed54a..28e42c0 100644 --- a/tests/Generator/PeclUuidTimeGeneratorTest.php +++ b/tests/Generator/PeclUuidTimeGeneratorTest.php @@ -16,6 +16,8 @@ class PeclUuidTimeGeneratorTest extends PeclUuidTestCase * This test is just to check collaboration with the PECL UUID extension - not to check * the correctness of the methods defined in that extension. * So we are just checking that the UUID methods are called with the right parameters. + * + * @requires PHP < 8 */ public function testGenerateCreatesUuidUsingPeclUuidMethods() { @@ -32,6 +34,8 @@ class PeclUuidTimeGeneratorTest extends PeclUuidTestCase /** * This test is for the return type of the generate method * It ensures that the generate method returns whatever value uuid_parse returns. + * + * @requires PHP < 8 */ public function testGenerateReturnsUuidString() { diff --git a/tests/Generator/RandomBytesGeneratorTest.php b/tests/Generator/RandomBytesGeneratorTest.php index cd1092c..6721255 100644 --- a/tests/Generator/RandomBytesGeneratorTest.php +++ b/tests/Generator/RandomBytesGeneratorTest.php @@ -26,6 +26,7 @@ class RandomBytesGeneratorTest extends TestCase * @dataProvider lengthAndHexDataProvider * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 * @param int $length * @param string $hex * @throws \Exception @@ -44,6 +45,7 @@ class RandomBytesGeneratorTest extends TestCase * @dataProvider lengthAndHexDataProvider * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 * @param int $length * @param string $hex * @throws \Exception diff --git a/tests/Generator/RandomLibAdapterTest.php b/tests/Generator/RandomLibAdapterTest.php index 9e0da77..254f2df 100644 --- a/tests/Generator/RandomLibAdapterTest.php +++ b/tests/Generator/RandomLibAdapterTest.php @@ -26,7 +26,11 @@ class RandomLibAdapterTest extends TestCase $generator = $this->getMockBuilder('RandomLib\Generator') ->disableOriginalConstructor() ->getMock(); - new RandomLibAdapter($generator); + + $this->assertInstanceOf( + 'Ramsey\Uuid\Generator\RandomGeneratorInterface', + new RandomLibAdapter($generator) + ); } /** @@ -40,7 +44,10 @@ class RandomLibAdapterTest extends TestCase ->once() ->getMock(); - new RandomLibAdapter(); + $this->assertInstanceOf( + 'Ramsey\Uuid\Generator\RandomGeneratorInterface', + new RandomLibAdapter() + ); } public function testGenerateUsesGenerator() diff --git a/tests/Generator/SodiumRandomGeneratorTest.php b/tests/Generator/SodiumRandomGeneratorTest.php index 7716d6d..1da2067 100644 --- a/tests/Generator/SodiumRandomGeneratorTest.php +++ b/tests/Generator/SodiumRandomGeneratorTest.php @@ -28,7 +28,7 @@ class SodiumRandomGeneratorTest extends TestCase $bytes = $generator->generate(16); - $this->assertInternalType('string', $bytes); + $this->assertIsString($bytes); $this->assertEquals(16, strlen($bytes)); } diff --git a/tests/Provider/Node/RandomNodeProviderTest.php b/tests/Provider/Node/RandomNodeProviderTest.php index 647c93a..b390d23 100644 --- a/tests/Provider/Node/RandomNodeProviderTest.php +++ b/tests/Provider/Node/RandomNodeProviderTest.php @@ -8,15 +8,10 @@ use AspectMock\Test as AspectMock; class RandomNodeProviderTest extends TestCase { - protected function tearDown() - { - parent::tearDown(); - AspectMock::clean(); - } - /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testGetNodeUsesRandomBytes() { @@ -31,6 +26,7 @@ class RandomNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testGetNodeSetsMulticastBit() { @@ -48,6 +44,7 @@ class RandomNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testGetNodeAlreadyHasMulticastBit() { @@ -66,6 +63,7 @@ class RandomNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testGetNodeSetsMulticastBitForLowNodeValue() { diff --git a/tests/Provider/Node/SystemNodeProviderTest.php b/tests/Provider/Node/SystemNodeProviderTest.php index 0cafa72..657f55e 100644 --- a/tests/Provider/Node/SystemNodeProviderTest.php +++ b/tests/Provider/Node/SystemNodeProviderTest.php @@ -50,6 +50,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 * * @dataProvider provideValidNetStatOutput * @@ -88,6 +89,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 * * @dataProvider provideInvalidNetStatOutput * @@ -119,6 +121,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 * * @dataProvider provideNotationalFormats * @@ -151,6 +154,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 * * @dataProvider provideInvalidNotationalFormats * @@ -182,6 +186,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testGetNodeReturnsFirstMacAddressFound() { @@ -209,6 +214,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testGetNodeReturnsFalseWhenNodeIsNotFound() { @@ -236,6 +242,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testGetNodeWillNotExecuteSystemCallIfFailedFirstTime() { @@ -262,6 +269,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 * * @dataProvider provideCommandPerOs * @@ -306,6 +314,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testGetNodeReturnsSameNodeUponSubsequentCalls() { @@ -334,6 +343,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testSubsequentCallsToGetNodeDoNotRecallIfconfig() { @@ -362,6 +372,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 * * @dataProvider provideCommandPerOs * @@ -420,6 +431,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testCallGetsysfsOnLinuxWhenGlobReturnsFalse() { @@ -453,6 +465,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testCallGetsysfsOnLinuxWhenGlobReturnsEmptyArray() { @@ -486,6 +499,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testCallGetsysfsOnLinuxWhenGlobFilesAreNotReadable() { @@ -522,6 +536,7 @@ class SystemNodeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testGetNodeReturnsFalseWhenPassthruIsDisabled() { diff --git a/tests/Provider/Time/FixedTimeProviderTest.php b/tests/Provider/Time/FixedTimeProviderTest.php index 2f13943..5096675 100644 --- a/tests/Provider/Time/FixedTimeProviderTest.php +++ b/tests/Provider/Time/FixedTimeProviderTest.php @@ -10,7 +10,7 @@ class FixedTimeProviderTest extends TestCase public function testConstructorRequiresSecAndUsec() { - $this->setExpectedException('InvalidArgumentException'); + $this->expectException('InvalidArgumentException'); $provider = new FixedTimeProvider([]); } diff --git a/tests/Provider/Time/SystemTimeProviderTest.php b/tests/Provider/Time/SystemTimeProviderTest.php index 8210efd..e1e5fbb 100644 --- a/tests/Provider/Time/SystemTimeProviderTest.php +++ b/tests/Provider/Time/SystemTimeProviderTest.php @@ -20,6 +20,7 @@ class SystemTimeProviderTest extends TestCase /** * @runInSeparateProcess * @preserveGlobalState disabled + * @requires PHP < 8 */ public function testCurrentTimeUsesGettimeofday() { diff --git a/tests/TestCase.php b/tests/TestCase.php index 5a1cd05..e268c54 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,14 +3,18 @@ namespace Ramsey\Uuid\Test; use AspectMock\Test as AspectMock; use Mockery; -use PHPUnit\Framework\TestCase as PhpUnitTestCase; +use Yoast\PHPUnitPolyfills\TestCases\TestCase as YoastTestCase; -class TestCase extends PhpUnitTestCase +class TestCase extends YoastTestCase { - protected function tearDown() + protected function tear_down() { - parent::tearDown(); - AspectMock::clean(); + parent::tear_down(); + + if (PHP_MAJOR_VERSION < 8) { + AspectMock::clean(); + } + Mockery::close(); } diff --git a/tests/UuidTest.php b/tests/UuidTest.php index 4299fbc..f8085ed 100644 --- a/tests/UuidTest.php +++ b/tests/UuidTest.php @@ -14,8 +14,9 @@ use stdClass; class UuidTest extends TestCase { - protected function setUp() + protected function set_up() { + parent::set_up(); Uuid::setFactory(new UuidFactory()); } @@ -80,21 +81,19 @@ class UuidTest extends TestCase $this->assertEquals('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', $uuid->toString()); } - /** - * @expectedException Ramsey\Uuid\Exception\InvalidUuidStringException - * @expectedExceptionMessage Invalid UUID string: - */ public function testFromStringWithInvalidUuidString() { + $this->expectException('Ramsey\Uuid\Exception\InvalidUuidStringException'); + $this->expectExceptionMessage('Invalid UUID string:'); + $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21'); } - /** - * @expectedException Ramsey\Uuid\Exception\InvalidUuidStringException - * @expectedExceptionMessage Invalid UUID string: - */ public function testFromStringWithTrailingNewLine() { + $this->expectException('Ramsey\Uuid\Exception\InvalidUuidStringException'); + $this->expectExceptionMessage('Invalid UUID string:'); + Uuid::fromString("d0d5f586-21d1-470c-8088-55c8857728dc\n"); } @@ -225,9 +224,6 @@ class UuidTest extends TestCase $this->assertSame('-12219292800', $uuid->getDateTime()->format('U')); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testGetDateTimeThrownException() { Uuid::setFactory(new UuidFactory(new FeatureSet(false, true, true))); @@ -237,15 +233,16 @@ class UuidTest extends TestCase $this->assertInstanceOf('Ramsey\Uuid\DegradedUuid', $uuid); $this->assertInstanceOf('Ramsey\Uuid\Converter\Number\DegradedNumberConverter', $uuid->getNumberConverter()); + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $date = $uuid->getDateTime(); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsupportedOperationException - * @expectedExceptionMessage Not a time-based UUID - */ public function testGetDateTimeFromNonVersion1Uuid() { + $this->expectException('Ramsey\Uuid\Exception\UnsupportedOperationException'); + $this->expectExceptionMessage('Not a time-based UUID'); + // Using a version 4 UUID to test $uuid = Uuid::fromString('bf17b594-41f2-474f-bf70-4c90220f75de'); $date = $uuid->getDateTime(); @@ -271,14 +268,14 @@ class UuidTest extends TestCase $this->assertEquals($fields, $uuid->getFields()); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testGetFields32Bit() { Uuid::setFactory(new UuidFactory(new FeatureSet(false, true))); $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'); + + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $fields = $uuid->getFields(); } @@ -311,14 +308,14 @@ class UuidTest extends TestCase $this->assertEquals('11178224546741000806', $uuid->getLeastSignificantBits()->getValue()); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testGetLeastSignificantBitsException() { Uuid::setFactory(new UuidFactory(new FeatureSet(false, false, true))); $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'); + + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $bn = $uuid->getLeastSignificantBits(); } @@ -341,14 +338,14 @@ class UuidTest extends TestCase $this->assertEquals('18406084892941947361', $uuid->getMostSignificantBits()->getValue()); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testGetMostSignificantBitsException() { Uuid::setFactory(new UuidFactory(new FeatureSet(false, false, true))); $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'); + + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $bn = $uuid->getMostSignificantBits(); } @@ -370,14 +367,14 @@ class UuidTest extends TestCase $this->assertEquals(8796630719078, $uuid->getNode()); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testGetNode32Bit() { Uuid::setFactory(new UuidFactory(new FeatureSet(false, true))); $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'); + + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $node = $uuid->getNode(); } @@ -415,14 +412,14 @@ class UuidTest extends TestCase $this->assertEquals(4285500592, $uuid->getTimeLow()); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testGetTimeLow32Bit() { Uuid::setFactory(new UuidFactory(new FeatureSet(false, true))); $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'); + + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $timeLow = $uuid->getTimeLow(); } @@ -478,36 +475,36 @@ class UuidTest extends TestCase $this->assertEquals('00001540901e600', $uuid->getTimestampHex()); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsupportedOperationException - * @expectedExceptionMessage Not a time-based UUID - */ public function testGetTimestampFromNonVersion1Uuid() { // Using a version 4 UUID to test $uuid = Uuid::fromString('bf17b594-41f2-474f-bf70-4c90220f75de'); + + $this->expectException('Ramsey\Uuid\Exception\UnsupportedOperationException'); + $this->expectExceptionMessage('Not a time-based UUID'); + $ts = $uuid->getTimestamp(); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsupportedOperationException - * @expectedExceptionMessage Not a time-based UUID - */ public function testGetTimestampHexFromNonVersion1Uuid() { // Using a version 4 UUID to test $uuid = Uuid::fromString('bf17b594-41f2-474f-bf70-4c90220f75de'); + + $this->expectException('Ramsey\Uuid\Exception\UnsupportedOperationException'); + $this->expectExceptionMessage('Not a time-based UUID'); + $ts = $uuid->getTimestampHex(); } - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testGetTimestamp32Bit() { Uuid::setFactory(new UuidFactory(new FeatureSet(false, true))); $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'); + + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $ts = $uuid->getTimestamp(); } @@ -721,30 +718,27 @@ class UuidTest extends TestCase } } - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Invalid node value - */ public function testUuid1WithOutOfBoundsNode() { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('Invalid node value'); + $uuid = Uuid::uuid1(9223372036854775808); } - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Invalid node value - */ public function testUuid1WithNonHexadecimalNode() { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('Invalid node value'); + $uuid = Uuid::uuid1('db77e160355g'); } - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Invalid node value - */ public function testUuid1WithNon48bitNumber() { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('Invalid node value'); + $uuid = Uuid::uuid1('db77e160355ef'); } @@ -1349,13 +1343,12 @@ class UuidTest extends TestCase } } - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testCalculateUuidTimeThrownException() { Uuid::setFactory(new UuidFactory(new FeatureSet(false, true, true))); + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $uuid = Uuid::uuid1(0x00007ffffffe, 0x1669); } @@ -1515,19 +1508,17 @@ class UuidTest extends TestCase $this->assertEquals($guid->toString(), $parsedGuid->toString()); } - /** - * @expectedException InvalidArgumentException - */ public function testFromBytesArgumentTooShort() { + $this->expectException('InvalidArgumentException'); + Uuid::fromBytes('thisisveryshort'); } - /** - * @expectedException InvalidArgumentException - */ public function testFromBytesArgumentTooLong() { + $this->expectException('InvalidArgumentException'); + Uuid::fromBytes('thisisabittoolong'); } @@ -1865,32 +1856,32 @@ class UuidTest extends TestCase if ($this->hasMoontoastMath()) { $this->assertEquals($test['int'], (string)$uuid->getInteger()); } - $this->assertEquals($test['fields'], $uuid->getFieldsHex()); - $this->assertEquals($test['fields']['time_low'], $uuid->getTimeLowHex()); - $this->assertEquals($test['fields']['time_mid'], $uuid->getTimeMidHex()); - $this->assertEquals($test['fields']['time_hi_and_version'], $uuid->getTimeHiAndVersionHex()); - $this->assertEquals($test['fields']['clock_seq_hi_and_reserved'], $uuid->getClockSeqHiAndReservedHex()); - $this->assertEquals($test['fields']['clock_seq_low'], $uuid->getClockSeqLowHex()); - $this->assertEquals($test['fields']['node'], $uuid->getNodeHex()); + $this->assertTrue($test['fields'] == $uuid->getFieldsHex()); + $this->assertTrue($test['fields']['time_low'] == $uuid->getTimeLowHex()); + $this->assertTrue($test['fields']['time_mid'] == $uuid->getTimeMidHex()); + $this->assertTrue($test['fields']['time_hi_and_version'] == $uuid->getTimeHiAndVersionHex()); + $this->assertTrue($test['fields']['clock_seq_hi_and_reserved'] == $uuid->getClockSeqHiAndReservedHex()); + $this->assertTrue($test['fields']['clock_seq_low'] == $uuid->getClockSeqLowHex()); + $this->assertTrue($test['fields']['node'] == $uuid->getNodeHex()); $this->assertEquals($test['urn'], $uuid->getUrn()); if ($uuid->getVersion() == 1) { - $this->assertEquals($test['time'], $uuid->getTimestampHex()); + $this->assertTrue($test['time'] == $uuid->getTimestampHex()); } - $this->assertEquals($test['clock_seq'], $uuid->getClockSequenceHex()); + $this->assertTrue($test['clock_seq'] == $uuid->getClockSequenceHex()); $this->assertEquals($test['variant'], $uuid->getVariant()); $this->assertEquals($test['version'], $uuid->getVersion()); } } } - /** - * @expectedException Ramsey\Uuid\Exception\UnsatisfiedDependencyException - */ public function testGetInteger() { Uuid::setFactory(new UuidFactory(new FeatureSet(false, false, true))); $uuid = Uuid::uuid1(); + + $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $uuid->getInteger(); } @@ -1912,12 +1903,11 @@ class UuidTest extends TestCase $this->assertTrue($uuid->equals($unserializedUuid)); } - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Invalid UUID string: - */ public function testUuid3WithEmptyNamespace() { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('Invalid UUID string:'); + $uuid = Uuid::uuid3('', ''); } @@ -1949,12 +1939,11 @@ class UuidTest extends TestCase $this->assertEquals('19826852-5007-3022-a72a-212f66e9fac3', $uuid->toString()); } - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Invalid UUID string: - */ public function testUuid5WithEmptyNamespace() { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('Invalid UUID string:'); + $uuid = Uuid::uuid5('', ''); } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 22f23fa..052ea4f 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -8,9 +8,11 @@ use AspectMock\Kernel; require_once __DIR__ . '/../vendor/autoload.php'; // composer autoload require_once __DIR__ . '/phpstan-bootstrap.php'; -$kernel = Kernel::getInstance(); -$kernel->init([ - 'debug' => true, - 'cacheDir' => sys_get_temp_dir(), - 'includePaths' => [__DIR__ . '/../src'] -]); +if (PHP_MAJOR_VERSION < 8) { + $kernel = Kernel::getInstance(); + $kernel->init([ + 'debug' => true, + 'cacheDir' => sys_get_temp_dir(), + 'includePaths' => [__DIR__ . '/../src'] + ]); +} From 90031b396c4416f75ba1eed35ec7ff4cddc43ec1 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 23 Sep 2021 14:07:00 -0500 Subject: [PATCH 15/34] Fix coding standards and coverage issues --- .github/workflows/continuous-integration.yml | 11 +++-------- tests/Codec/GuidStringCodecTest.php | 4 ++-- tests/Codec/OrderedTimeCodecTest.php | 4 ++-- tests/Codec/StringCodecTest.php | 4 ++-- tests/Encoder/TimestampFirstCombCodecTest.php | 2 +- tests/Encoder/TimestampLastCombCodecTest.php | 2 +- tests/Generator/DefaultTimeGeneratorTest.php | 4 ++-- tests/TestCase.php | 2 +- tests/UuidTest.php | 2 +- 9 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b34ca20..13bb062 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -54,11 +54,6 @@ jobs: - name: "Install dependencies (Composer)" uses: "ramsey/composer-install@v1" - - name: "Setup PCOV" - run: | - composer require pcov/clobber - vendor/bin/pcov clobber - - name: "Run unit tests (PHPUnit)" run: "./vendor/bin/phpunit --verbose --colors=always --coverage-text --coverage-clover build/logs/clover.xml" @@ -86,9 +81,9 @@ jobs: experimental: - false include: - - php-version: "8.1" - experimental: true - composer-options: "--ignore-platform-req=php" + #- php-version: "8.1" + # experimental: true + # composer-options: "--ignore-platform-req=php" - php-version: "5.4" extensions: ", libsodium-1.0.7, uuid-1.0.4" - php-version: "5.5" diff --git a/tests/Codec/GuidStringCodecTest.php b/tests/Codec/GuidStringCodecTest.php index feb80b9..a201457 100644 --- a/tests/Codec/GuidStringCodecTest.php +++ b/tests/Codec/GuidStringCodecTest.php @@ -22,7 +22,7 @@ class GuidStringCodecTest extends TestCase /** @var array */ private $fields; - protected function set_up() + protected function set_up() // phpcs:ignore { parent::set_up(); $this->builder = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); @@ -35,7 +35,7 @@ class GuidStringCodecTest extends TestCase 'node' => '1234abcd4321']; } - protected function tear_down() + protected function tear_down() // phpcs:ignore { parent::tear_down(); $this->builder = null; diff --git a/tests/Codec/OrderedTimeCodecTest.php b/tests/Codec/OrderedTimeCodecTest.php index 9fe51fb..6fd928e 100644 --- a/tests/Codec/OrderedTimeCodecTest.php +++ b/tests/Codec/OrderedTimeCodecTest.php @@ -26,7 +26,7 @@ class OrderedTimeCodecTest extends TestCase /** @var string */ private $optimizedHex = '11d8eebc58e0a7d796690800200c9a66'; - protected function set_up() + protected function set_up() // phpcs:ignore { parent::set_up(); $this->builder = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); @@ -39,7 +39,7 @@ class OrderedTimeCodecTest extends TestCase 'node' => '0800200c9a66']; } - protected function tear_down() + protected function tear_down() // phpcs:ignore { parent::tear_down(); $this->builder = null; diff --git a/tests/Codec/StringCodecTest.php b/tests/Codec/StringCodecTest.php index a510191..8e5b9cf 100644 --- a/tests/Codec/StringCodecTest.php +++ b/tests/Codec/StringCodecTest.php @@ -24,7 +24,7 @@ class StringCodecTest extends TestCase /** @var string */ private $uuidString = '12345678-1234-abcd-abef-1234abcd4321'; - protected function set_up() + protected function set_up() // phpcs:ignore { parent::set_up(); $this->builder = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); @@ -37,7 +37,7 @@ class StringCodecTest extends TestCase 'node' => '1234abcd4321']; } - protected function tear_down() + protected function tear_down() // phpcs:ignore { parent::tear_down(); $this->builder = null; diff --git a/tests/Encoder/TimestampFirstCombCodecTest.php b/tests/Encoder/TimestampFirstCombCodecTest.php index 911cf21..25d5cf4 100644 --- a/tests/Encoder/TimestampFirstCombCodecTest.php +++ b/tests/Encoder/TimestampFirstCombCodecTest.php @@ -18,7 +18,7 @@ class TimestampFirstCombCodecTest extends TestCase */ private $builderMock; - protected function set_up() + protected function set_up() // phpcs:ignore { parent::set_up(); $this->builderMock = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); diff --git a/tests/Encoder/TimestampLastCombCodecTest.php b/tests/Encoder/TimestampLastCombCodecTest.php index 7952a0a..f1801b9 100644 --- a/tests/Encoder/TimestampLastCombCodecTest.php +++ b/tests/Encoder/TimestampLastCombCodecTest.php @@ -18,7 +18,7 @@ class TimestampLastCombCodecTest extends TestCase */ private $builderMock; - protected function set_up() + protected function set_up() // phpcs:ignore { parent::set_up(); $this->builderMock = $this->getMockBuilder('Ramsey\Uuid\Builder\UuidBuilderInterface')->getMock(); diff --git a/tests/Generator/DefaultTimeGeneratorTest.php b/tests/Generator/DefaultTimeGeneratorTest.php index 51affa0..91521f0 100644 --- a/tests/Generator/DefaultTimeGeneratorTest.php +++ b/tests/Generator/DefaultTimeGeneratorTest.php @@ -27,7 +27,7 @@ class DefaultTimeGeneratorTest extends TestCase /** @var int */ private $clockSeq = 4066; - protected function set_up() + protected function set_up() // phpcs:ignore { parent::set_up(); $this->timeProvider = $this->getMockBuilder('Ramsey\Uuid\Provider\TimeProviderInterface')->getMock(); @@ -37,7 +37,7 @@ class DefaultTimeGeneratorTest extends TestCase $this->calculatedTime = ["low" => "83cb98e0", "mid" => "98e0", "hi" => "03cb"]; } - protected function tear_down() + protected function tear_down() // phpcs:ignore { parent::tear_down(); $this->timeProvider = null; diff --git a/tests/TestCase.php b/tests/TestCase.php index e268c54..9131266 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -7,7 +7,7 @@ use Yoast\PHPUnitPolyfills\TestCases\TestCase as YoastTestCase; class TestCase extends YoastTestCase { - protected function tear_down() + protected function tear_down() // phpcs:ignore { parent::tear_down(); diff --git a/tests/UuidTest.php b/tests/UuidTest.php index f8085ed..65594d4 100644 --- a/tests/UuidTest.php +++ b/tests/UuidTest.php @@ -14,7 +14,7 @@ use stdClass; class UuidTest extends TestCase { - protected function set_up() + protected function set_up() // phpcs:ignore { parent::set_up(); Uuid::setFactory(new UuidFactory()); From 9264d240b8de1cca5f7761961781dc3bc9e938e7 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 23 Sep 2021 16:52:54 -0500 Subject: [PATCH 16/34] Support PHP 8.1 --- .github/workflows/continuous-integration.yml | 12 +++----- src/Uuid.php | 29 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 13bb062..fc18ae1 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -18,7 +18,7 @@ jobs: - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: - php-version: "7.4" # Unable to support 8 right now + php-version: "7.4" coverage: "none" - name: "Install dependencies (Composer)" @@ -46,7 +46,7 @@ jobs: - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: - php-version: "7.4" # Unable to support 8 right now + php-version: "7.4" extensions: "bcmath, ctype, gmp, sodium, uuid" coverage: "pcov" ini-values: "memory_limit=-1" @@ -63,7 +63,6 @@ jobs: unit-tests: name: "Unit Tests" runs-on: "ubuntu-latest" - continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false @@ -78,18 +77,15 @@ jobs: - "7.3" - "7.4" - "8.0" - experimental: - - false include: - #- php-version: "8.1" - # experimental: true - # composer-options: "--ignore-platform-req=php" - php-version: "5.4" extensions: ", libsodium-1.0.7, uuid-1.0.4" - php-version: "5.5" extensions: ", libsodium-1.0.7, uuid-1.0.4" - php-version: "5.6" extensions: ", libsodium-1.0.7, uuid-1.0.4" + - php-version: "8.1" + composer-options: "--ignore-platform-req=php" steps: - name: "Checkout repository" diff --git a/src/Uuid.php b/src/Uuid.php index f2912b4..d51e0e1 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -22,6 +22,7 @@ use Ramsey\Uuid\Codec\CodecInterface; use Ramsey\Uuid\Exception\InvalidUuidStringException; use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; use Ramsey\Uuid\Exception\UnsupportedOperationException; +use ReturnTypeWillChange; /** * Represents a universally unique identifier (UUID), according to RFC 4122. @@ -224,11 +225,21 @@ class Uuid implements UuidInterface * @return string * @link http://php.net/manual/en/class.serializable.php */ + #[ReturnTypeWillChange] public function serialize() { return $this->toString(); } + /** + * @return array{string: string} + */ + #[ReturnTypeWillChange] + public function __serialize() + { + return ['string' => $this->toString()]; + } + /** * Re-constructs the object from its serialized form. * @@ -236,6 +247,7 @@ class Uuid implements UuidInterface * @link http://php.net/manual/en/class.serializable.php * @throws InvalidUuidStringException */ + #[ReturnTypeWillChange] public function unserialize($serialized) { $uuid = self::fromString($serialized); @@ -244,6 +256,23 @@ class Uuid implements UuidInterface $this->fields = $uuid->fields; } + /** + * @param array{string: string} $serialized + * @return void + * @throws InvalidUuidStringException + */ + #[ReturnTypeWillChange] + public function __unserialize(array $serialized) + { + // @codeCoverageIgnoreStart + if (!isset($serialized['string'])) { + throw new InvalidUuidStringException(); + } + // @codeCoverageIgnoreEnd + + $this->unserialize($serialized['string']); + } + public function compareTo(UuidInterface $other) { if ($this->getMostSignificantBitsHex() < $other->getMostSignificantBitsHex()) { From e6e2d78979b0819b85e1307ac80c2a1d7fbbaf84 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 23 Sep 2021 17:03:00 -0500 Subject: [PATCH 17/34] Disallow PHPUnit 9.0-9.2 and show deprecations --- composer.json | 2 +- tests/bootstrap.php | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/composer.json b/composer.json index cb69fca..e6f440a 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "paragonie/random-lib": "^2", "php-mock/php-mock-phpunit": "^0.3 | ^1.1 | ^2.6", "php-parallel-lint/php-parallel-lint": "^1.3", - "phpunit/phpunit": ">=4.8.36", + "phpunit/phpunit": ">=4.8.36 <9.0.0 | >=9.3.0", "squizlabs/php_codesniffer": "^3.5", "yoast/phpunit-polyfills": "^1.0" }, diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 052ea4f..e281141 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,8 +1,6 @@ Date: Thu, 23 Sep 2021 19:10:50 -0500 Subject: [PATCH 18/34] Run builds on Windows --- .github/workflows/continuous-integration.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index fc18ae1..8375091 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -62,7 +62,7 @@ jobs: unit-tests: name: "Unit Tests" - runs-on: "ubuntu-latest" + runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false @@ -77,6 +77,9 @@ jobs: - "7.3" - "7.4" - "8.0" + operating-system: + - "ubuntu-latest" + - "windows-latest" include: - php-version: "5.4" extensions: ", libsodium-1.0.7, uuid-1.0.4" @@ -85,6 +88,7 @@ jobs: - php-version: "5.6" extensions: ", libsodium-1.0.7, uuid-1.0.4" - php-version: "8.1" + operating-system: "ubuntu-latest" composer-options: "--ignore-platform-req=php" steps: From c4849b9a1abea06d9c71785d82c6c59317fe6cd8 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 23 Sep 2021 19:12:52 -0500 Subject: [PATCH 19/34] Fix Windows builds --- .github/workflows/continuous-integration.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 8375091..e5161db 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -92,10 +92,17 @@ jobs: composer-options: "--ignore-platform-req=php" steps: + - name: "Configure Git (for Windows)" + if: ${{ matrix.operating-system == 'windows-latest' }} + run: | + git config --system core.autocrlf false + git config --system core.eol lf + - name: "Checkout repository" uses: "actions/checkout@v2" - name: "Install dependencies (apt)" + if: ${{ matrix.operating-system == 'ubuntu-latest' }} run: | sudo apt-get update sudo apt-get -y install bsdmainutils libsodium-dev uuid-dev From 5c08654f98877eb588bb05e97eb306103675c6a3 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 24 Sep 2021 11:55:30 -0500 Subject: [PATCH 20/34] Move exception expectation --- tests/UuidTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/UuidTest.php b/tests/UuidTest.php index 65594d4..a581da0 100644 --- a/tests/UuidTest.php +++ b/tests/UuidTest.php @@ -1878,10 +1878,9 @@ class UuidTest extends TestCase { Uuid::setFactory(new UuidFactory(new FeatureSet(false, false, true))); - $uuid = Uuid::uuid1(); - $this->expectException('Ramsey\Uuid\Exception\UnsatisfiedDependencyException'); + $uuid = Uuid::uuid1(); $uuid->getInteger(); } From fd7961ce818cfa560b24ff39f36e1ddff01f4681 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 24 Sep 2021 12:18:24 -0500 Subject: [PATCH 21/34] Only attempting loading extensions on Ubuntu --- .github/workflows/continuous-integration.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e5161db..da4c83a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -82,10 +82,13 @@ jobs: - "windows-latest" include: - php-version: "5.4" + operating-system: "ubuntu-latest" extensions: ", libsodium-1.0.7, uuid-1.0.4" - php-version: "5.5" + operating-system: "ubuntu-latest" extensions: ", libsodium-1.0.7, uuid-1.0.4" - php-version: "5.6" + operating-system: "ubuntu-latest" extensions: ", libsodium-1.0.7, uuid-1.0.4" - php-version: "8.1" operating-system: "ubuntu-latest" From 893211ef8432795338c90a81bf0f34e2352f7a6b Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 24 Sep 2021 12:33:33 -0500 Subject: [PATCH 22/34] Fiddle with the build matrix to fix Windows issues --- .github/workflows/continuous-integration.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index da4c83a..0a238d7 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -90,8 +90,21 @@ jobs: - php-version: "5.6" operating-system: "ubuntu-latest" extensions: ", libsodium-1.0.7, uuid-1.0.4" + - php-version: "7.0" + extensions: ", sodium, uuid" + - php-version: "7.1" + extensions: ", sodium, uuid" + - php-version: "7.2" + extensions: ", sodium, uuid" + - php-version: "7.3" + extensions: ", sodium, uuid" + - php-version: "7.4" + extensions: ", sodium, uuid" + - php-version: "8.0" + extensions: ", sodium, uuid" - php-version: "8.1" operating-system: "ubuntu-latest" + extensions: ", sodium, uuid" composer-options: "--ignore-platform-req=php" steps: @@ -115,7 +128,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" - extensions: "bcmath, ctype, gmp, sodium, uuid ${{ matrix.extensions }}" + extensions: "bcmath, ctype, gmp ${{ matrix.extensions }}" coverage: "none" ini-values: "memory_limit=-1" From 1b074f4a1c1c78f4c92b45b2db752a73185d2585 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 24 Sep 2021 12:38:13 -0500 Subject: [PATCH 23/34] Lock 3.x to PHP 8.1.x and lower --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e6f440a..7034822 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ } ], "require": { - "php": "^5.4 | ^7 | ^8", + "php": "^5.4 | ^7 | ~8.0.0 | ~8.1.0", "ext-json": "*", "paragonie/random_compat": "^1 | ^2 | ^9.99.99", "symfony/polyfill-ctype": "^1.8" From 43439cdb79b6fc938c8d59c9c27a985c30c3fa99 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 24 Sep 2021 13:07:14 -0500 Subject: [PATCH 24/34] Update badges for 3.x --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 28fa5c9..3f0d2f4 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@ changed to `ramsey/uuid` and `Ramsey\Uuid`, respectively.* [![Source Code][badge-source]][source] -[![Latest Version][badge-release]][release] -[![Software License][badge-license]][license] +[![Series][badge-series]][series] +[![Upgrade][badge-upgrade]][upgrade] [![PHP Version][badge-php]][php] +[![Software License][badge-license]][license] [![Build Status][badge-build]][build] [![Coverage Status][badge-coverage]][coverage] @@ -170,14 +171,16 @@ information. [contributing.md]: https://github.com/ramsey/uuid/blob/master/.github/CONTRIBUTING.md [badge-source]: https://img.shields.io/badge/source-ramsey/uuid-blue.svg?style=flat-square -[badge-release]: https://img.shields.io/packagist/v/ramsey/uuid.svg?style=flat-square&label=release -[badge-license]: https://img.shields.io/packagist/l/ramsey/uuid.svg?style=flat-square -[badge-php]: https://img.shields.io/packagist/php-v/ramsey/uuid/3.x-dev.svg?style=flat-square +[badge-series]: https://img.shields.io/badge/series-3.x-darkcyan.svg?style=flat-square +[badge-upgrade]: https://img.shields.io/packagist/v/ramsey/uuid.svg?style=flat-square&label=upgrade&colorB=darkred +[badge-license]: https://img.shields.io/packagist/l/ramsey/uuid.svg?style=flat-square&colorB=darkcyan +[badge-php]: https://img.shields.io/packagist/php-v/ramsey/uuid/3.x-dev.svg?style=flat-square&colorB=%238892BF [badge-build]: https://img.shields.io/github/workflow/status/ramsey/uuid/build/3.x.svg?logo=github&style=flat-square [badge-coverage]: https://img.shields.io/codecov/c/gh/ramsey/uuid/3.x.svg?style=flat-square&logo=codecov [source]: https://github.com/ramsey/uuid -[release]: https://packagist.org/packages/ramsey/uuid +[series]: https://packagist.org/packages/ramsey/uuid/tree/3.x +[upgrade]: https://packagist.org/packages/ramsey/uuid [license]: https://github.com/ramsey/uuid/blob/master/LICENSE [php]: https://php.net [build]: https://github.com/ramsey/uuid/actions/workflows/continuous-integration.yml?query=branch%3A3.x From ada8d27a5cfc2d41d2a5a4108b8a7070a5ebb3e4 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 24 Sep 2021 13:08:40 -0500 Subject: [PATCH 25/34] Fix links in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f0d2f4..544df1a 100644 --- a/README.md +++ b/README.md @@ -178,8 +178,8 @@ information. [badge-build]: https://img.shields.io/github/workflow/status/ramsey/uuid/build/3.x.svg?logo=github&style=flat-square [badge-coverage]: https://img.shields.io/codecov/c/gh/ramsey/uuid/3.x.svg?style=flat-square&logo=codecov -[source]: https://github.com/ramsey/uuid -[series]: https://packagist.org/packages/ramsey/uuid/tree/3.x +[source]: https://github.com/ramsey/uuid/tree/3.x +[series]: https://packagist.org/packages/ramsey/uuid [upgrade]: https://packagist.org/packages/ramsey/uuid [license]: https://github.com/ramsey/uuid/blob/master/LICENSE [php]: https://php.net From 7577465251660d69c719b0ac461d827105f3e6a4 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 24 Sep 2021 13:11:15 -0500 Subject: [PATCH 26/34] Ignore the changelog in exported packages --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index ae09278..44187e0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,7 @@ .gitattributes export-ignore .github/ export-ignore .gitignore export-ignore +CHANGELOG.md export-ignore codecov.yml export-ignore docs/ export-ignore phpstan.neon export-ignore From d6b829b1a3e076c11a55bc6e00619532c25978bd Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 24 Sep 2021 13:21:52 -0500 Subject: [PATCH 27/34] Remove changelog version links --- CHANGELOG.md | 158 +++++++++++++++++---------------------------------- 1 file changed, 52 insertions(+), 106 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8276415..0d50771 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,14 +21,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Security -## [3.9.4] - 2021-08-06 +## 3.9.4 - 2021-08-06 ### Fixed * Allow installation of paragonie/random_compat v9.99.100 (for PHP 8 compatibility). -## [3.9.3] - 2020-02-20 +## 3.9.3 - 2020-02-20 ### Fixed @@ -45,7 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. the time is `1970-01-01 00:00:01`. No rounding should occur. -## [3.9.2] - 2019-12-17 +## 3.9.2 - 2019-12-17 ### Fixed @@ -54,7 +54,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. emitted on hosts that do not grant permission to read these files. -## [3.9.1] - 2019-12-01 +## 3.9.1 - 2019-12-01 ### Fixed @@ -64,7 +64,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. resolved. -## [3.9.0] - 2019-11-30 +## 3.9.0 - 2019-11-30 ### Added @@ -96,7 +96,7 @@ These will be removed in ramsey/uuid version 4.0.0: cases when `php_uname()` is disabled for security reasons. -## [3.8.0] - 2018-07-19 +## 3.8.0 - 2018-07-19 ### Added @@ -107,7 +107,7 @@ These will be removed in ramsey/uuid version 4.0.0: * Annotate thrown exceptions for improved IDE hinting -## [3.7.3] - 2018-01-19 +## 3.7.3 - 2018-01-19 ### Fixed @@ -120,7 +120,7 @@ These will be removed in ramsey/uuid version 4.0.0: * Switch to `random_int()` from `mt_rand()` for better random numbers -## [3.7.2] - 2018-01-13 +## 3.7.2 - 2018-01-13 ### Fixed @@ -128,7 +128,7 @@ These will be removed in ramsey/uuid version 4.0.0: reliable way to identify the node on Docker images, etc. -## [3.7.1] - 2017-09-22 +## 3.7.1 - 2017-09-22 ### Fixed @@ -139,7 +139,7 @@ These will be removed in ramsey/uuid version 4.0.0: * Use `random_bytes()` when generating random nodes -## [3.7.0] - 2017-08-04 +## 3.7.0 - 2017-08-04 ### Added @@ -151,14 +151,14 @@ These will be removed in ramsey/uuid version 4.0.0: * `Uuid::UUID_TYPE_HASH_SHA1` -## [3.6.1] - 2017-03-26 +## 3.6.1 - 2017-03-26 ### Fixed * Optimize UUID string decoding by using `str_pad()` instead of `sprintf()` -## [3.6.0] - 2017-03-18 +## 3.6.0 - 2017-03-18 ### Added @@ -172,14 +172,14 @@ These will be removed in ramsey/uuid version 4.0.0: and `dechex()` instead of `sprintf()`) -## [3.5.2] - 2016-11-22 +## 3.5.2 - 2016-11-22 ### Fixed * Improve test coverage -## [3.5.1] - 2016-10-02 +## 3.5.1 - 2016-10-02 ### Fixed @@ -187,7 +187,7 @@ These will be removed in ramsey/uuid version 4.0.0: mixed cases -## [3.5.0] - 2016-08-02 +## 3.5.0 - 2016-08-02 ### Added @@ -200,14 +200,14 @@ These will be removed in ramsey/uuid version 4.0.0: system node -## [3.4.1] - 2016-04-23 +## 3.4.1 - 2016-04-23 ### Fixed * Fix test that violated a PHP CodeSniffer rule, breaking the build -## [3.4.0] - 2016-04-23 +## 3.4.0 - 2016-04-23 ### Added @@ -217,7 +217,7 @@ These will be removed in ramsey/uuid version 4.0.0: * Improve logic of `CombGenerator` for COMB sequential UUIDs -## [3.3.0] - 2016-03-22 +## 3.3.0 - 2016-03-22 ### Security @@ -226,7 +226,7 @@ These will be removed in ramsey/uuid version 4.0.0: this addresses and fixes the [collision issue] -## [3.2.0] - 2016-02-17 +## 3.2.0 - 2016-02-17 ### Added @@ -234,7 +234,7 @@ These will be removed in ramsey/uuid version 4.0.0: a random bytes generator when creating UUIDs -## [3.1.0] - 2015-12-17 +## 3.1.0 - 2015-12-17 ### Added @@ -242,14 +242,14 @@ These will be removed in ramsey/uuid version 4.0.0: serialize/unserialize UUID objects -## [3.0.1] - 2015-10-21 +## 3.0.1 - 2015-10-21 ### Added * Adopt the [Contributor Code of Conduct] for this project -## [3.0.0] - 2015-09-28 +## 3.0.0 - 2015-09-28 The 3.0.0 release represents a significant step for the ramsey/uuid library. While the simple and familiar API used in previous versions remains intact, this @@ -316,7 +316,7 @@ versions leading up to this release.* * Fix exception message for `DegradedNumberConverter::fromHex()` -## [3.0.0-beta1] - 2015-08-31 +## 3.0.0-beta1 - 2015-08-31 ### Fixed @@ -328,7 +328,7 @@ versions leading up to this release.* * Fix exception message for `DegradedNumberConverter::fromHex()` -## [3.0.0-alpha3] - 2015-07-28 +## 3.0.0-alpha3 - 2015-07-28 ### Added @@ -344,7 +344,7 @@ versions leading up to this release.* default `TimeGenerator` -## [3.0.0-alpha2] - 2015-07-28 +## 3.0.0-alpha2 - 2015-07-28 ### Added @@ -366,7 +366,7 @@ versions leading up to this release.* * Remove `PeclUuidFactory` in favor of using pecl-uuid with generators -## [3.0.0-alpha1] - 2015-07-16 +## 3.0.0-alpha1 - 2015-07-16 ### Added @@ -400,7 +400,7 @@ versions leading up to this release.* * Remove `Uuid::VERSION` package version constant -## [2.9.0] - 2016-03-22 +## 2.9.0 - 2016-03-22 ### Security @@ -409,28 +409,28 @@ versions leading up to this release.* this addresses and fixes the [collision issue] -## [2.8.4] - 2015-12-17 +## 2.8.4 - 2015-12-17 ### Added * Add support for symfony/console v3 in the `uuid` CLI application -## [2.8.3] - 2015-08-31 +## 2.8.3 - 2015-08-31 ### Fixed * Fix exception message in `Uuid::calculateUuidTime()` -## [2.8.2] - 2015-07-23 +## 2.8.2 - 2015-07-23 ### Fixed * Ensure the release tag makes it into the rhumsaa/uuid package -## [2.8.1] - 2015-06-16 +## 2.8.1 - 2015-06-16 ### Fixed @@ -439,7 +439,7 @@ versions leading up to this release.* runtime -## [2.8.0] - 2014-11-09 +## 2.8.0 - 2014-11-09 ### Added @@ -448,32 +448,31 @@ versions leading up to this release.* ### Fixed -* Improve Doctrine conversion to Uuid or string for the ramsey/uuid [Doctrine - field type] +* Improve Doctrine conversion to Uuid or string for the ramsey/uuid [Doctrine field type] -## [2.7.4] - 2014-10-29 +## 2.7.4 - 2014-10-29 ### Fixed * Change loop in `generateBytes()` from `foreach` to `for` -## [2.7.3] - 2014-08-27 +## 2.7.3 - 2014-08-27 ### Fixed * Fix upper range for `mt_rand` used in version 4 UUIDs -## [2.7.2] - 2014-07-28 +## 2.7.2 - 2014-07-28 ### Changed * Upgrade to PSR-4 autoloading -## [2.7.1] - 2014-02-19 +## 2.7.1 - 2014-02-19 ### Fixed @@ -481,14 +480,14 @@ versions leading up to this release.* * Support symfony/console 2.3 (LTS version) -## [2.7.0] - 2014-01-31 +## 2.7.0 - 2014-01-31 ### Added * Add `Uuid::VALID_PATTERN` constant containing a UUID validation regex pattern -## [2.6.1] - 2014-01-27 +## 2.6.1 - 2014-01-27 ### Fixed @@ -496,7 +495,7 @@ versions leading up to this release.* autoloader when installed in another project -## [2.6.0] - 2014-01-17 +## 2.6.0 - 2014-01-17 ### Added @@ -509,14 +508,14 @@ versions leading up to this release.* * Require moontoast/math as part of the regular package requirements -## [2.5.0] - 2013-10-30 +## 2.5.0 - 2013-10-30 ### Added * Use `openssl_random_pseudo_bytes()`, if available, to generate random bytes -## [2.4.0] - 2013-07-29 +## 2.4.0 - 2013-07-29 ### Added @@ -524,21 +523,21 @@ versions leading up to this release.* * Support string UUIDs without dashes passed to `Uuid::fromString()` -## [2.3.0] - 2013-07-16 +## 2.3.0 - 2013-07-16 ### Added * Support creation of UUIDs from bytes with `Uuid::fromBytes()` -## [2.2.0] - 2013-07-04 +## 2.2.0 - 2013-07-04 ### Added * Add `Doctrine\UuidType::requiresSQLCommentHint()` method -## [2.1.2] - 2013-07-03 +## 2.1.2 - 2013-07-03 ### Fixed @@ -546,21 +545,21 @@ versions leading up to this release.* digits; this ensures that case in the node is converted to lowercase -## [2.1.1] - 2013-04-29 +## 2.1.1 - 2013-04-29 ### Fixed * Fix bug in `Uuid::isValid()` where the NIL UUID was not reported as valid -## [2.1.0] - 2013-04-15 +## 2.1.0 - 2013-04-15 ### Added * Allow checking the validity of a UUID through the `Uuid::isValid()` method -## [2.0.0] - 2013-02-11 +## 2.0.0 - 2013-02-11 ### Added @@ -576,21 +575,21 @@ versions leading up to this release.* * Move `UnsupportedOperationException` to the `Exception` subnamespace -## [1.1.2] - 2012-11-29 +## 1.1.2 - 2012-11-29 ### Fixed * Relax [Doctrine field type] conversion rules for UUIDs -## [1.1.1] - 2012-08-27 +## 1.1.1 - 2012-08-27 ### Fixed * Remove `final` keyword from `Uuid` class -## [1.1.0] - 2012-08-06 +## 1.1.0 - 2012-08-06 ### Added @@ -598,7 +597,7 @@ versions leading up to this release.* field mapping type -## [1.0.0] - 2012-07-19 +## 1.0.0 - 2012-07-19 ### Added @@ -614,56 +613,3 @@ versions leading up to this release.* [doctrine field type]: http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html [ramsey/uuid-doctrine]: https://github.com/ramsey/uuid-doctrine [ramsey/uuid-console]: https://github.com/ramsey/uuid-console - -[unreleased]: https://github.com/ramsey/uuid/compare/3.9.4...3.x -[3.9.4]: https://github.com/ramsey/uuid/compare/3.9.2...3.9.4 -[3.9.3]: https://github.com/ramsey/uuid/compare/3.9.2...3.9.3 -[3.9.2]: https://github.com/ramsey/uuid/compare/3.9.1...3.9.2 -[3.9.1]: https://github.com/ramsey/uuid/compare/3.9.0...3.9.1 -[3.9.0]: https://github.com/ramsey/uuid/compare/3.8.0...3.9.0 -[3.8.0]: https://github.com/ramsey/uuid/compare/3.7.3...3.8.0 -[3.7.3]: https://github.com/ramsey/uuid/compare/3.7.2...3.7.3 -[3.7.2]: https://github.com/ramsey/uuid/compare/3.7.1...3.7.2 -[3.7.1]: https://github.com/ramsey/uuid/compare/3.7.0...3.7.1 -[3.7.0]: https://github.com/ramsey/uuid/compare/3.6.1...3.7.0 -[3.6.1]: https://github.com/ramsey/uuid/compare/3.6.0...3.6.1 -[3.6.0]: https://github.com/ramsey/uuid/compare/3.5.2...3.6.0 -[3.5.2]: https://github.com/ramsey/uuid/compare/3.5.1...3.5.2 -[3.5.1]: https://github.com/ramsey/uuid/compare/3.5.0...3.5.1 -[3.5.0]: https://github.com/ramsey/uuid/compare/3.4.1...3.5.0 -[3.4.1]: https://github.com/ramsey/uuid/compare/3.4.0...3.4.1 -[3.4.0]: https://github.com/ramsey/uuid/compare/3.3.0...3.4.0 -[3.3.0]: https://github.com/ramsey/uuid/compare/3.2.0...3.3.0 -[3.2.0]: https://github.com/ramsey/uuid/compare/3.1.0...3.2.0 -[3.1.0]: https://github.com/ramsey/uuid/compare/3.0.1...3.1.0 -[3.0.1]: https://github.com/ramsey/uuid/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/ramsey/uuid/compare/3.0.0-beta1...3.0.0 -[3.0.0-beta1]: https://github.com/ramsey/uuid/compare/3.0.0-alpha3...3.0.0-beta1 -[3.0.0-alpha3]: https://github.com/ramsey/uuid/compare/3.0.0-alpha2...3.0.0-alpha3 -[3.0.0-alpha2]: https://github.com/ramsey/uuid/compare/3.0.0-alpha1...3.0.0-alpha2 -[3.0.0-alpha1]: https://github.com/ramsey/uuid/compare/2.9.0...3.0.0-alpha1 -[2.9.0]: https://github.com/ramsey/uuid/compare/2.8.4...2.9.0 -[2.8.4]: https://github.com/ramsey/uuid/compare/2.8.3...2.8.4 -[2.8.3]: https://github.com/ramsey/uuid/compare/2.8.2...2.8.3 -[2.8.2]: https://github.com/ramsey/uuid/compare/2.8.1...2.8.2 -[2.8.1]: https://github.com/ramsey/uuid/compare/2.8.0...2.8.1 -[2.8.0]: https://github.com/ramsey/uuid/compare/2.7.4...2.8.0 -[2.7.4]: https://github.com/ramsey/uuid/compare/2.7.3...2.7.4 -[2.7.3]: https://github.com/ramsey/uuid/compare/2.7.2...2.7.3 -[2.7.2]: https://github.com/ramsey/uuid/compare/2.7.1...2.7.2 -[2.7.1]: https://github.com/ramsey/uuid/compare/2.7.0...2.7.1 -[2.7.0]: https://github.com/ramsey/uuid/compare/2.6.1...2.7.0 -[2.6.1]: https://github.com/ramsey/uuid/compare/2.6.0...2.6.1 -[2.6.0]: https://github.com/ramsey/uuid/compare/2.5.0...2.6.0 -[2.5.0]: https://github.com/ramsey/uuid/compare/2.4.0...2.5.0 -[2.4.0]: https://github.com/ramsey/uuid/compare/2.3.0...2.4.0 -[2.3.0]: https://github.com/ramsey/uuid/compare/2.2.0...2.3.0 -[2.2.0]: https://github.com/ramsey/uuid/compare/2.1.2...2.2.0 -[2.1.2]: https://github.com/ramsey/uuid/compare/2.1.1...2.1.2 -[2.1.1]: https://github.com/ramsey/uuid/compare/2.1.0...2.1.1 -[2.1.0]: https://github.com/ramsey/uuid/compare/2.0.0...2.1.0 -[2.0.0]: https://github.com/ramsey/uuid/compare/1.1.2...2.0.0 -[1.1.2]: https://github.com/ramsey/uuid/compare/1.1.1...1.1.2 -[1.1.1]: https://github.com/ramsey/uuid/compare/1.1.0...1.1.1 -[1.1.0]: https://github.com/ramsey/uuid/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/ramsey/uuid/commits/1.0.0 From e62af90c1cf1552167e69e68c4c96b6a07a919c7 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 24 Sep 2021 13:22:07 -0500 Subject: [PATCH 28/34] Prepare changelog for release 3.9.5 --- CHANGELOG.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d50771..353bb7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,21 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -### Added - -### Changed - -### Deprecated - -### Removed +## 3.9.5 - 2021-09-24 ### Fixed -### Security - +* Indicate support for PHP 8.1, using `~8.1.0` to prevent installations on 8.2 + until the library is ready. ## 3.9.4 - 2021-08-06 From ffa80ab953edd85d5b6c004f96181a538aad35a3 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 25 Sep 2021 18:07:42 -0500 Subject: [PATCH 29/34] Switch back to ^8.0 in the PHP version requirement for 3.9.x --- CHANGELOG.md | 9 +++++++++ composer.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 353bb7e..002de3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## 3.9.6 - 2021-09-25 + +### Fixed + +* Switch back to `^8.0` in the PHP version requirement. + + ## 3.9.5 - 2021-09-24 ### Fixed @@ -12,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * Indicate support for PHP 8.1, using `~8.1.0` to prevent installations on 8.2 until the library is ready. + ## 3.9.4 - 2021-08-06 ### Fixed diff --git a/composer.json b/composer.json index 7034822..a618595 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ } ], "require": { - "php": "^5.4 | ^7 | ~8.0.0 | ~8.1.0", + "php": "^5.4 | ^7.0 | ^8.0", "ext-json": "*", "paragonie/random_compat": "^1 | ^2 | ^9.99.99", "symfony/polyfill-ctype": "^1.8" From 7201bafdb2c5bff4136ab1e7b32fb02392cedca3 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sun, 27 Mar 2022 12:27:45 -0500 Subject: [PATCH 30/34] chore: remove branch-alias and allow plugins --- composer.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index a618595..8f5505d 100644 --- a/composer.json +++ b/composer.json @@ -51,11 +51,12 @@ "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter" }, "config": { - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" + "sort-packages": true, + "allow-plugins": { + "phpstan/extension-installer": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "ergebnis/composer-normalize": true, + "captainhook/plugin-composer": true } }, "replace": { From d999e9c97e6f4ef31d794b0a9c0d6f09b86a7e75 Mon Sep 17 00:00:00 2001 From: anthony <12048285+MadeWilson@users.noreply.github.com> Date: Mon, 19 Dec 2022 20:32:42 +0100 Subject: [PATCH 31/34] fix missing #[ReturnTypeWillChange] in Uuid (#470) --- src/Uuid.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Uuid.php b/src/Uuid.php index d51e0e1..1744d28 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -213,6 +213,7 @@ class Uuid implements UuidInterface * @return string * @link http://php.net/manual/en/class.jsonserializable.php */ + #[ReturnTypeWillChange] public function jsonSerialize() { return $this->toString(); From 6456d902e4ac0fe4d98bdae523f9236174486e3a Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Mon, 19 Dec 2022 15:35:35 -0600 Subject: [PATCH 32/34] docs: fix build status badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 544df1a..491429d 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ information. [badge-upgrade]: https://img.shields.io/packagist/v/ramsey/uuid.svg?style=flat-square&label=upgrade&colorB=darkred [badge-license]: https://img.shields.io/packagist/l/ramsey/uuid.svg?style=flat-square&colorB=darkcyan [badge-php]: https://img.shields.io/packagist/php-v/ramsey/uuid/3.x-dev.svg?style=flat-square&colorB=%238892BF -[badge-build]: https://img.shields.io/github/workflow/status/ramsey/uuid/build/3.x.svg?logo=github&style=flat-square +[badge-build]: https://img.shields.io/github/actions/workflow/status/ramsey/uuid/continuous-integration.yml?branch=3.x&logo=github&style=flat-square [badge-coverage]: https://img.shields.io/codecov/c/gh/ramsey/uuid/3.x.svg?style=flat-square&logo=codecov [source]: https://github.com/ramsey/uuid/tree/3.x From 963d13717a9c4224f521961969bdf4479bc59a0e Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Mon, 19 Dec 2022 15:41:41 -0600 Subject: [PATCH 33/34] ci: update workflow for testing on PHP 8.1 and 8.2 --- .github/workflows/continuous-integration.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 0a238d7..afff34a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -13,7 +13,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "Checkout repository" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -22,7 +22,7 @@ jobs: coverage: "none" - name: "Install dependencies (Composer)" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" - name: "Check syntax (php-parallel-lint)" run: "./vendor/bin/parallel-lint src tests --colors" @@ -35,7 +35,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "Checkout repository" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "Install dependencies (apt)" run: | @@ -52,13 +52,13 @@ jobs: ini-values: "memory_limit=-1" - name: "Install dependencies (Composer)" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" - name: "Run unit tests (PHPUnit)" run: "./vendor/bin/phpunit --verbose --colors=always --coverage-text --coverage-clover build/logs/clover.xml" - name: "Publish coverage report to Codecov" - uses: "codecov/codecov-action@v1" + uses: "codecov/codecov-action@v3" unit-tests: name: "Unit Tests" @@ -77,6 +77,8 @@ jobs: - "7.3" - "7.4" - "8.0" + - "8.1" + - "8.2" operating-system: - "ubuntu-latest" - "windows-latest" @@ -103,9 +105,9 @@ jobs: - php-version: "8.0" extensions: ", sodium, uuid" - php-version: "8.1" - operating-system: "ubuntu-latest" extensions: ", sodium, uuid" - composer-options: "--ignore-platform-req=php" + - php-version: "8.2" + extensions: ", sodium, uuid" steps: - name: "Configure Git (for Windows)" @@ -115,7 +117,7 @@ jobs: git config --system core.eol lf - name: "Checkout repository" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "Install dependencies (apt)" if: ${{ matrix.operating-system == 'ubuntu-latest' }} @@ -133,7 +135,7 @@ jobs: ini-values: "memory_limit=-1" - name: "Install dependencies (Composer)" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: composer-options: "${{ matrix.composer-options }}" From dc75aa439eb4c1b77f5379fd958b3dc0e6014178 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Mon, 19 Dec 2022 15:55:10 -0600 Subject: [PATCH 34/34] chore: prepare for release 3.9.7 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 002de3b..5c15b32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 3.9.7 - 2022-12-19 + +### Fixed + +* Add `#[ReturnTypeWillChange]` to `Uuid::jsonSerialize()` method. + + ## 3.9.6 - 2021-09-25 ### Fixed