diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..059c79a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,60 @@ +name: CI build +on: [ push, pull_request ] +jobs: + build: + name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }} ${{ matrix.extra-label }} ${{ matrix.composer-dependencies }} + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ ubuntu-latest ] + php-versions: [ '8.0' ] + composer-dependencies: [ '', '--prefer-lowest' ] + symfony-version: [ '' ] + extra-label: [ '' ] + include: + + # Windows + - php-versions: '8.0' + operating-system: windows-latest + coverage: xdebug + + steps: + # see https://github.com/actions/checkout/issues/226#issue-606867805 + - name: Prepare git + run: git config --global core.autocrlf false + + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: ${{ matrix.php-versions }} + ini-values: memory_limit=-1 + tools: composer:${{ matrix.composer-version }} + coverage: ${{ matrix.coverage }} + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install Composer dependencies + run: composer update --no-progress --prefer-dist --optimize-autoloader ${{ matrix.composer-dependencies }} + + - name: Run Build + run: composer run build + + - name: Upload coverage results to Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + composer global require php-coveralls/php-coveralls --no-progress --prefer-dist --optimize-autoloader + php-coveralls --coverage_clover=build/logs/clover.xml -v diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c313138..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: php - -php: - - 7.4 - - 8.0 - -jobs: - allow_failures: - - php: 8.0 - -env: - global: - - XDEBUG_MODE=coverage - matrix: - - PREFER_LOWEST="--prefer-lowest --prefer-stable" - - PREFER_LOWEST="" - -before_script: - - composer update $PREFER_LOWEST - -script: - - composer run build - -after_success: - - travis_retry php vendor/bin/php-coveralls -v diff --git a/README.md b/README.md index 8d6c95b..b80be35 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,9 @@ Author Changelog ---------- +## 3.4.0 (2021-??-??) +- [#15](../../pull/15) Drop support for PHP < 8.0 + ## 3.3.0 (2020-12-31) - [#12](../../pull/12) Drop support for PHP < 7.4 - [#11](../../pull/11) Add support for PHP 8.0 (thank you @ahilles107!) diff --git a/composer.json b/composer.json index f085f0a..a31330a 100644 --- a/composer.json +++ b/composer.json @@ -17,15 +17,15 @@ } ], "require": { - "php": "~7.4 | ~8.0", - "jms/serializer": "~3.2", + "php": "~8.0", + "jms/serializer": "~3.14", "ramsey/uuid": "~3.0|~4.0" }, "require-dev": { - "consistence/coding-standard": "3.10.1", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "php-coveralls/php-coveralls": "2.4.1", - "phpunit/phpunit": "9.5.0" + "consistence-community/coding-standard": "3.11.1", + "php-parallel-lint/php-parallel-lint": "1.3.1", + "php-coveralls/php-coveralls": "2.4.3", + "phpunit/phpunit": "9.5.10" }, "autoload": { "psr-4": { "Mhujer\\JmsSerializer\\": [ "src" ] }, @@ -43,7 +43,7 @@ ], "coveralls": "coveralls -v", "lint": "parallel-lint src tests", - "phpcs": "phpcs --standard=vendor/consistence/coding-standard/Consistence/ruleset.xml src tests", + "phpcs": "phpcs --standard=vendor/consistence-community/coding-standard/Consistence/ruleset.xml src tests", "test": "phpunit" } } diff --git a/src/Uuid/UuidSerializerHandler.php b/src/Uuid/UuidSerializerHandler.php index 6c914b5..1516492 100644 --- a/src/Uuid/UuidSerializerHandler.php +++ b/src/Uuid/UuidSerializerHandler.php @@ -55,7 +55,7 @@ public static function getSubscribingMethods(): array * @param \JMS\Serializer\Context $context * @return \Ramsey\Uuid\UuidInterface */ - public function deserializeUuid(DeserializationVisitorInterface $visitor, $data, array $type, Context $context): UuidInterface + public function deserializeUuid(DeserializationVisitorInterface $visitor, $data, array $type, Context $context): UuidInterface // phpcs:ignore { try { return $this->deserializeUuidValue((string) $data); @@ -81,7 +81,7 @@ private function deserializeUuidValue(string $uuidString): UuidInterface * @param mixed[] $type * @return string|object */ - public function serializeUuid(SerializationVisitorInterface $visitor, UuidInterface $uuid, array $type) + public function serializeUuid(SerializationVisitorInterface $visitor, UuidInterface $uuid, array $type): mixed { return $visitor->visitString($uuid->toString(), $type); }