Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v5] PHP 8.1, Symfony 6.4, phpstan #2216

Merged
merged 56 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d97b082
bump dependencies for to php >=8.1
DjordyKoert Feb 7, 2024
5039142
remove symfony 5.4 support & bump symfony 6 to minimum 6.4
DjordyKoert Feb 7, 2024
ff1604c
use ramsey/composer-install in ci
DjordyKoert Feb 7, 2024
4d0d2d6
use ramsey/composer-install in ci
DjordyKoert Feb 7, 2024
e843ec2
use ramsey/composer-install in ci
DjordyKoert Feb 7, 2024
5bd0cf5
fix sensio/framework-extra-bundle dependency
DjordyKoert Feb 7, 2024
eefa2f5
ease symfony/framework-bundle constraint
DjordyKoert Feb 7, 2024
a028601
remove unsupported sensio/framework-extra-bundle
DjordyKoert Feb 7, 2024
02e69a6
Revert "remove unsupported sensio/framework-extra-bundle"
DjordyKoert Feb 7, 2024
1741068
fix incompatible Symfony 7 job being skipped
DjordyKoert Feb 7, 2024
8f2eb73
fix incorrect docs for MapQueryString controller
DjordyKoert Feb 7, 2024
d8bafe6
rewrite annotation detection
DjordyKoert Feb 7, 2024
8bc8f89
fix symfony 7 not using serializer groups
DjordyKoert Feb 7, 2024
968d9a9
update baseline
DjordyKoert Feb 7, 2024
54e6fea
exclude symfony 7 with annotations support
DjordyKoert Feb 7, 2024
d638446
skip symfony 7 & php 8.1
DjordyKoert Feb 7, 2024
5b9eb8f
replace phpunit baseline with ignoreFile
DjordyKoert Feb 7, 2024
1238430
bump phpunit
DjordyKoert Feb 7, 2024
5d32827
improve ci readability
DjordyKoert Feb 7, 2024
fc812bb
rename docs workflow
DjordyKoert Feb 7, 2024
5e79ad0
add phpstan
DjordyKoert Feb 7, 2024
5151c93
use ubuntu latest
DjordyKoert Feb 7, 2024
1f6d864
ci docs: use same rules to lower jobs
DjordyKoert Feb 7, 2024
d8c91e0
cleanup phpunit.xml.dist
DjordyKoert Feb 7, 2024
69e88fe
include root php files
DjordyKoert Feb 7, 2024
2968859
generate phpstan baseline
DjordyKoert Feb 7, 2024
e3c94ab
style fix
DjordyKoert Feb 7, 2024
14e017b
bump dependencies for to php >=8.1
DjordyKoert Feb 7, 2024
fb62989
remove symfony 5.4 support & bump symfony 6 to minimum 6.4
DjordyKoert Feb 7, 2024
e868dc6
use ramsey/composer-install in ci
DjordyKoert Feb 7, 2024
03f4388
use ramsey/composer-install in ci
DjordyKoert Feb 7, 2024
07be426
use ramsey/composer-install in ci
DjordyKoert Feb 7, 2024
fbb06f9
fix sensio/framework-extra-bundle dependency
DjordyKoert Feb 7, 2024
d2abd25
ease symfony/framework-bundle constraint
DjordyKoert Feb 7, 2024
4d9b9cc
remove unsupported sensio/framework-extra-bundle
DjordyKoert Feb 7, 2024
033e044
Revert "remove unsupported sensio/framework-extra-bundle"
DjordyKoert Feb 7, 2024
85dda8f
fix incompatible Symfony 7 job being skipped
DjordyKoert Feb 7, 2024
fa65a00
fix incorrect docs for MapQueryString controller
DjordyKoert Feb 7, 2024
154020d
rewrite annotation detection
DjordyKoert Feb 7, 2024
204870e
fix symfony 7 not using serializer groups
DjordyKoert Feb 7, 2024
b815f95
update baseline
DjordyKoert Feb 7, 2024
c6e7447
exclude symfony 7 with annotations support
DjordyKoert Feb 7, 2024
add14b9
skip symfony 7 & php 8.1
DjordyKoert Feb 7, 2024
6b84ff8
replace phpunit baseline with ignoreFile
DjordyKoert Feb 7, 2024
0936500
bump phpunit
DjordyKoert Feb 7, 2024
eaa3024
improve ci readability
DjordyKoert Feb 7, 2024
2fb85d7
rename docs workflow
DjordyKoert Feb 7, 2024
340e766
add phpstan
DjordyKoert Feb 7, 2024
e59747a
use ubuntu latest
DjordyKoert Feb 7, 2024
6197488
ci docs: use same rules to lower jobs
DjordyKoert Feb 7, 2024
79e27c9
cleanup phpunit.xml.dist
DjordyKoert Feb 7, 2024
ebb54ef
include root php files
DjordyKoert Feb 7, 2024
f19f256
generate phpstan baseline
DjordyKoert Feb 7, 2024
d473772
style fix
DjordyKoert Feb 7, 2024
e147ec9
Merge remote-tracking branch 'origin/feat-php-81' into feat-php-81
DjordyKoert Feb 15, 2024
d3d29f8
update phpstan-baseline
DjordyKoert Feb 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 20 additions & 33 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,29 @@ env:
jobs:
phpunit:
name: "PHPUnit"
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
include:
- php-version: 7.2
composer-flags: "--prefer-lowest"
php:
- "8.1"
- "8.2"
- "8.3"
symfony-require:
- "^6.4"
- "^7.0"
dependencies:
- "lowest"
- "highest"
doctrine-annotations:
- true
- false
exclude:
- symfony-require: "^7.0"
doctrine-annotations: true
- php-version: 7.3
symfony-require: "5.4.*"
doctrine-annotations: true
- php-version: 7.4
symfony-require: "5.4.*"
doctrine-annotations: true
- php-version: 8.0
symfony-require: "5.4.*"
doctrine-annotations: true
- php-version: 8.1
symfony-require: "5.4.*"
doctrine-annotations: true
- php-version: 8.3
symfony-require: "5.4.*"
doctrine-annotations: true
- php-version: 8.1
symfony-require: "6.3.*"
doctrine-annotations: true
- php-version: 8.3
symfony-require: "6.3.*"
doctrine-annotations: true
- php-version: 8.2
symfony-require: "7.0.*"
doctrine-annotations: false
- php-version: 8.3
symfony-require: "7.0.*"
doctrine-annotations: false
- php: "8.1"
symfony-require: "^7.0"

steps:
- name: "Checkout"
Expand Down Expand Up @@ -86,14 +73,14 @@ jobs:
composer require doctrine/annotations --no-update

- name: Remove packages not compatible symfony 7
if: matrix.symfony-require == '7.0.*'
if: matrix.symfony-require == '^7.0'
run: |
composer remove friendsofsymfony/rest-bundle sensio/framework-extra-bundle --no-update --dev

- name: "Install dependencies with composer"
uses: "ramsey/composer-install@v2"
env:
SYMFONY_REQUIRE: "${{ matrix.symfony-require }}"
run: composer update --no-interaction --no-progress ${{ matrix.composer-flags }}

- name: "PHPUnit Tests"
run: vendor/bin/phpunit --configuration phpunit.xml.dist --coverage-text
13 changes: 9 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: CI
name: docs

on:
push: ~
pull_request: ~
pull_request:
branches:
- "*.x"
- master
push:
branches:
- "*.x"
- master

jobs:
doctor-rst:
name: Lint (DOCtor-RST)

runs-on: ubuntu-latest

steps:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "static-analysis"

on:
pull_request:
branches:
- "*.x"
- master
push:
branches:
- "*.x"
- master

jobs:
static-analysis:
name: "PHPStan"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: "Install PHP without coverage"
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'

- name: "Cache dependencies"
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: "Install dependencies with composer"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: 'highest'

- name: "PHPStan"
run: composer phpstan
4 changes: 4 additions & 0 deletions Tests/Functional/Configs/annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
framework:
annotations: true
serializer:
enable_annotations: true
13 changes: 7 additions & 6 deletions Tests/Functional/Controller/MapQueryStringController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,34 @@
use Nelmio\ApiDocBundle\Tests\Functional\Entity\QueryModel\SortQueryModel;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyConstraintsWithValidationGroups;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyMapQueryString;
use OpenApi\Attributes as OA;
use Symfony\Component\HttpKernel\Attribute\MapQueryString;
use Symfony\Component\Routing\Annotation\Route;

class MapQueryStringController
{
#[Route('/article_map_query_string')]
#[Route('/article_map_query_string', methods: ['GET'])]
#[OA\Response(response: '200', description: '')]
public function fetchArticleFromMapQueryString(
#[MapQueryString] SymfonyMapQueryString $article81Query
) {
}

#[Route('/article_map_query_string_nullable')]
#[Route('/article_map_query_string_nullable', methods: ['GET'])]
#[OA\Response(response: '200', description: '')]
public function fetchArticleFromMapQueryStringNullable(
#[MapQueryString] ?SymfonyMapQueryString $article81Query
) {
}

#[Route('/article_map_query_string_passes_validation_groups')]
#[Route('/article_map_query_string_passes_validation_groups', methods: ['GET'])]
#[OA\Response(response: '200', description: '')]
public function fetchArticleFromMapQueryStringHandlesValidationGroups(
#[MapQueryString(validationGroups: ['test'])] SymfonyConstraintsWithValidationGroups $symfonyConstraintsWithValidationGroups,
) {
}

#[Route('/article_map_query_string_overwrite_parameters')]
#[Route('/article_map_query_string_overwrite_parameters', methods: ['GET'])]
#[OA\Parameter(
name: 'id',
in: 'query',
Expand Down Expand Up @@ -69,7 +70,7 @@ public function fetchArticleFromMapQueryStringOverwriteParameters(
) {
}

#[Route('/article_map_query_string_many_parameters')]
#[Route('/article_map_query_string_many_parameters', methods: ['GET'])]
#[OA\Response(response: '200', description: '')]
public function fetchArticleWithManyParameters(
#[MapQueryString] FilterQueryModel $filterQuery,
Expand All @@ -79,7 +80,7 @@ public function fetchArticleWithManyParameters(
) {
}

#[Route('/article_map_query_string_many_parameters_optional')]
#[Route('/article_map_query_string_many_parameters_optional', methods: ['GET'])]
#[OA\Response(response: '200', description: '')]
public function fetchArticleWithManyOptionalParameters(
#[MapQueryString] ?FilterQueryModel $filterQuery,
Expand Down
Loading
Loading