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/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/.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 }} 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", 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] ` 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 diff --git a/src/Tools/EntityGenerator.php b/src/Tools/EntityGenerator.php index 2c17ca33c9..f47d177a78 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'])) { @@ -1398,6 +1401,9 @@ protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, if ($typeHint && ! isset($types[$typeHint])) { $variableType = '\\' . ltrim($variableType, '\\'); $methodTypeHint = '\\' . $typeHint . ' '; + if ($defaultValue === 'null') { + $methodTypeHint = '?' . $methodTypeHint; + } } $replacements = [