From 6cde337777a8d854095c013144913727651e605f Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 27 Aug 2024 12:10:07 +0200 Subject: [PATCH 1/5] PHPStan 1.12 (#11585) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ebf9299607..76df2056e4 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "doctrine/annotations": "^1.13 || ^2", "doctrine/coding-standard": "^9.0.2 || ^12.0", "phpbench/phpbench": "^0.16.10 || ^1.0", - "phpstan/phpstan": "~1.4.10 || 1.11.1", + "phpstan/phpstan": "~1.4.10 || 1.12.0", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", "psr/log": "^1 || ^2 || ^3", "squizlabs/php_codesniffer": "3.7.2", From 25d5bc5b4695072692e5dc045d51ba5e1a34457c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Fri, 27 Sep 2024 19:32:00 +0200 Subject: [PATCH 2/5] Move orphan metadata to where it belongs The goal here was to retain compatibility with doctrine/rst-parser, which is no longer in use in the website. --- .github/workflows/documentation.yml | 5 ----- docs/en/reference/installation.rst | 2 ++ docs/en/sidebar.rst | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 65cbad613b..96caa7eba0 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -40,10 +40,5 @@ jobs: with: dependency-versions: "highest" - - name: "Add orphan metadata where needed" - run: | - printf '%s\n\n%s\n' ":orphan:" "$(cat docs/en/sidebar.rst)" > docs/en/sidebar.rst - printf '%s\n\n%s\n' ":orphan:" "$(cat docs/en/reference/installation.rst)" > docs/en/reference/installation.rst - - name: "Run guides-cli" run: "vendor/bin/guides -vvv --no-progress docs/en 2>&1 | grep -v 'No template found for rendering directive' | ( ! grep WARNING )" diff --git a/docs/en/reference/installation.rst b/docs/en/reference/installation.rst index dab1364f77..2c0d582300 100644 --- a/docs/en/reference/installation.rst +++ b/docs/en/reference/installation.rst @@ -1,3 +1,5 @@ +:orphan: + Installation ============ diff --git a/docs/en/sidebar.rst b/docs/en/sidebar.rst index df3032d65f..f67304e845 100644 --- a/docs/en/sidebar.rst +++ b/docs/en/sidebar.rst @@ -1,3 +1,5 @@ +:orphan: + .. toc:: .. tocheader:: Tutorials From 2432939e4fadc44bf5309be5f7d3cebd25499734 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 09:04:06 +0200 Subject: [PATCH 3/5] Bump doctrine/.github from 5.0.1 to 5.1.0 (#11616) Bumps [doctrine/.github](https://github.com/doctrine/.github) from 5.0.1 to 5.1.0. - [Release notes](https://github.com/doctrine/.github/releases) - [Commits](https://github.com/doctrine/.github/compare/5.0.1...5.1.0) --- updated-dependencies: - dependency-name: doctrine/.github dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/release-on-milestone-closed.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 659da17bac..390bdb5afc 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -24,4 +24,4 @@ on: jobs: coding-standards: - uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.0.1" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.1.0" diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 89d4fe8bf1..d54a784ebe 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -7,7 +7,7 @@ on: jobs: release: - uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.0.1" + uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.1.0" secrets: GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} From b7fd8241cf899a762cfccd980cc4e1657d7b78d4 Mon Sep 17 00:00:00 2001 From: n0099 Date: Tue, 1 Oct 2024 13:04:26 +0000 Subject: [PATCH 4/5] Update attributes-reference.rst --- docs/en/reference/attributes-reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/attributes-reference.rst b/docs/en/reference/attributes-reference.rst index 795eeebf31..8709cda627 100644 --- a/docs/en/reference/attributes-reference.rst +++ b/docs/en/reference/attributes-reference.rst @@ -14,7 +14,7 @@ Index - :ref:`#[AttributeOverride] ` - :ref:`#[Column] ` - :ref:`#[Cache] ` -- :ref:`#[ChangeTrackingPolicy ` +- :ref:`#[ChangeTrackingPolicy] ` - :ref:`#[CustomIdGenerator] ` - :ref:`#[DiscriminatorColumn] ` - :ref:`#[DiscriminatorMap] ` From b13564c6c063b7adc4a610c0ad4ff8bda0b90fe2 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 8 Oct 2024 12:25:31 +0200 Subject: [PATCH 5/5] Make nullable parameters explicit in generated entities (#11625) --- src/Tools/EntityGenerator.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Tools/EntityGenerator.php b/src/Tools/EntityGenerator.php index 04be655188..3c72da123a 100644 --- a/src/Tools/EntityGenerator.php +++ b/src/Tools/EntityGenerator.php @@ -767,6 +767,9 @@ private function generateEmbeddableConstructor(ClassMetadataInfo $metadata): str if ($fieldMapping['type'] === 'datetime') { $param = $this->getType($fieldMapping['type']) . ' ' . $param; + if (! empty($fieldMapping['nullable'])) { + $param = '?' . $param; + } } if (! empty($fieldMapping['nullable'])) { @@ -1385,6 +1388,9 @@ protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, if ($typeHint && ! isset($types[$typeHint])) { $variableType = '\\' . ltrim($variableType, '\\'); $methodTypeHint = '\\' . $typeHint . ' '; + if ($defaultValue === 'null') { + $methodTypeHint = '?' . $methodTypeHint; + } } $replacements = [