From 19702d99d08a3156b44ee28167071d55e05f0a6e Mon Sep 17 00:00:00 2001 From: DerManoMann Date: Fri, 9 Feb 2024 16:25:59 +1300 Subject: [PATCH 01/11] Update PHP dependencies to 7.4 --- .github/workflows/build.yml | 2 +- .github/workflows/security-checks.yml | 2 +- composer.json | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8bbfdfd..f1923d8b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: fail-fast: true matrix: operating-system: [ ubuntu-latest ] - php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] dependencies: [ 'lowest', 'highest' ] exclude: - php: '8.1' diff --git a/.github/workflows/security-checks.yml b/.github/workflows/security-checks.yml index 949602e0..f6474c3a 100644 --- a/.github/workflows/security-checks.yml +++ b/.github/workflows/security-checks.yml @@ -15,7 +15,7 @@ jobs: fail-fast: true matrix: operating-system: [ ubuntu-latest ] - php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ] + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] dependencies: [ 'highest' ] name: PHP ${{ matrix.php }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies diff --git a/composer.json b/composer.json index 62414402..289a44f5 100644 --- a/composer.json +++ b/composer.json @@ -40,16 +40,16 @@ "minimum-stability": "stable", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" } }, "require": { - "php": ">=7.2", + "php": ">=7.4", "ext-json": "*", "psr/log": "^1.1 || ^2.0 || ^3.0", "symfony/deprecation-contracts": "^2 || ^3", - "symfony/finder": ">=2.2", - "symfony/yaml": ">=3.3" + "symfony/finder": "^5.0 || ^6.0 || ^7.0", + "symfony/yaml": "^5.0 || ^6.0 || ^7.0" }, "autoload": { "psr-4": { @@ -58,17 +58,17 @@ }, "require-dev": { "composer/package-versions-deprecated": "^1.11", - "doctrine/annotations": "^1.7 || ^2.0", - "friendsofphp/php-cs-fixer": "^2.17 || 3.62.0", + "doctrine/annotations": "^2.0", + "friendsofphp/php-cs-fixer": "^3.62.0", "phpstan/phpstan": "^1.6", - "phpunit/phpunit": ">=8", + "phpunit/phpunit": "^9.0", "vimeo/psalm": "^4.23" }, "conflict": { "symfony/process": ">=6, <6.4.14" }, "suggest": { - "doctrine/annotations": "^1.7 || ^2.0" + "doctrine/annotations": "^2.0" }, "autoload-dev": { "exclude-from-classmap": [ From 8ff0c0a2ed667e103dd829bfb7e7796b14e27f5f Mon Sep 17 00:00:00 2001 From: DerManoMann Date: Fri, 9 Feb 2024 16:40:32 +1300 Subject: [PATCH 02/11] Remove (most) workflow build matrix exclusion --- .github/workflows/build.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1923d8b..9b29c2fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,18 +17,6 @@ jobs: operating-system: [ ubuntu-latest ] php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] dependencies: [ 'lowest', 'highest' ] - exclude: - - php: '8.1' - dependencies: 'lowest' - - php: '8.2' - dependencies: 'lowest' - - php: '8.3' - dependencies: 'lowest' - - php: '8.4' - dependencies: 'lowest' - include: - - php: '8.2' - composer-options: "--ignore-platform-req=php+" name: PHP ${{ matrix.php }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies From 4e352b856d15fc232222494139769af1c37d9c74 Mon Sep 17 00:00:00 2001 From: DerManoMann Date: Fri, 9 Feb 2024 16:36:53 +1300 Subject: [PATCH 03/11] Prefer attributes over annotations --- README.md | 2 +- docs/index.md | 8 ++++++-- src/Generator.php | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 30764f6e..3794db60 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # swagger-php -Generate interactive [OpenAPI](https://www.openapis.org) documentation for your RESTful API using [PHP attributes](https://www.php.net/manual/en/language.attributes.overview.php) (preferred) or +Generate interactive [OpenAPI](https://www.openapis.org) documentation for your RESTful API using [PHP attributes](https://www.php.net/manual/en/language.attributes.overview.php) (preferred) or [doctrine annotations](https://www.doctrine-project.org/projects/annotations.html) (requires additional `doctrine/annotations` library). See the [documentation website](https://zircote.github.io/swagger-php/guide/attributes.html) for supported attributes and annotations. diff --git a/docs/index.md b/docs/index.md index 84a7a3fa..ab34f8e2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -20,7 +20,10 @@ features: ### 2. Update your code -Add `swagger-php` attributes or annotations to your source code. +Add `swagger-php` attributes (or legacy annotations) to your source code. + +⚠️ `doctrine/annotations` is going to be deprecated in the future, so wherever +possible attributes should be used.