From bef9ec877efe49b0b708b4ce2e95aea6086ecdc8 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 6 Jan 2025 11:12:26 +0100 Subject: [PATCH 1/3] Remove deprecate use of tagged argument in favor of tagged_iterator (#2410) ## Description I now get this error on a 7.2 project: > Since symfony/dependency-injection 7.2: Type "tagged" is deprecated for tag , use "tagged_iterator" instead in ".../vendor/nelmio/api-doc-bundle/src/DependencyInjection/../../config/services.xml". tagged_iterator exists on https://symfony.com/doc/5.x/service_container/tags.html so I believe this is safe to use already for v4 / symfony 5.4+. ## What type of PR is this? (check all applicable) - [x] Bug Fix ## Checklist - [ ] I have made corresponding changes to the documentation (`docs/`) - [x] I have made corresponding changes to the changelog (`CHANGELOG.md`) --- CHANGELOG.md | 3 +++ config/services.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cb1f2175..9216f5a93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## 4.33.6 +* Fixed Symfony 7.2 deprecation of tagged arguments + ## 4.33.5 * Added new optional parameter `$context` to` PropertyDescriberInterface::supports()` diff --git a/config/services.xml b/config/services.xml index be9c3cc56..c9789b580 100644 --- a/config/services.xml +++ b/config/services.xml @@ -102,7 +102,7 @@ - + From e9be0ec7d3ba0effea75327e2b61217100e0611e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 11:14:56 +0100 Subject: [PATCH 2/3] chore(deps): bump codecov/codecov-action from 4 to 5 (#2400) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
Release notes

Sourced from codecov/codecov-action's releases.

v5.0.0

v5 Release

v5 of the Codecov GitHub Action will use the Codecov Wrapper to encapsulate the CLI. This will help ensure that the Action gets updates quicker.

Migration Guide

The v5 release also coincides with the opt-out feature for tokens for public repositories. In the Global Upload Token section of the settings page of an organization in codecov.io, you can set the ability for Codecov to receive a coverage reports from any source. This will allow contributors or other members of a repository to upload without needing access to the Codecov token. For more details see how to upload without a token.

[!WARNING]
The following arguments have been changed

  • file (this has been deprecated in favor of files)
  • plugin (this has been deprecated in favor of plugins)

The following arguments have been added:

  • binary
  • gcov_args
  • gcov_executable
  • gcov_ignore
  • gcov_include
  • report_type
  • skip_validation
  • swift_project

You can see their usage in the action.yml file.

What's Changed

... (truncated)

Changelog

Sourced from codecov/codecov-action's changelog.

4.0.0-beta.2

Fixes

  • #1085 not adding -n if empty to do-upload command

4.0.0-beta.1

v4 represents a move from the universal uploader to the Codecov CLI. Although this will unlock new features for our users, the CLI is not yet at feature parity with the universal uploader.

Breaking Changes

  • No current support for aarch64 and alpine architectures.
  • Tokenless uploading is unsuported
  • Various arguments to the Action have been removed

3.1.4

Fixes

  • #967 Fix typo in README.md
  • #971 fix: add back in working dir
  • #969 fix: CLI option names for uploader

Dependencies

  • #970 build(deps-dev): bump @​types/node from 18.15.12 to 18.16.3
  • #979 build(deps-dev): bump @​types/node from 20.1.0 to 20.1.2
  • #981 build(deps-dev): bump @​types/node from 20.1.2 to 20.1.4

3.1.3

Fixes

  • #960 fix: allow for aarch64 build

Dependencies

  • #957 build(deps-dev): bump jest-junit from 15.0.0 to 16.0.0
  • #958 build(deps): bump openpgp from 5.7.0 to 5.8.0
  • #959 build(deps-dev): bump @​types/node from 18.15.10 to 18.15.12

3.1.2

Fixes

  • #718 Update README.md
  • #851 Remove unsupported path_to_write_report argument
  • #898 codeql-analysis.yml
  • #901 Update README to contain correct information - inputs and negate feature
  • #955 fix: add in all the extra arguments for uploader

Dependencies

  • #819 build(deps): bump openpgp from 5.4.0 to 5.5.0
  • #835 build(deps): bump node-fetch from 3.2.4 to 3.2.10
  • #840 build(deps): bump ossf/scorecard-action from 1.1.1 to 2.0.4
  • #841 build(deps): bump @​actions/core from 1.9.1 to 1.10.0
  • #843 build(deps): bump @​actions/github from 5.0.3 to 5.1.1
  • #869 build(deps): bump node-fetch from 3.2.10 to 3.3.0
  • #872 build(deps-dev): bump jest-junit from 13.2.0 to 15.0.0
  • #879 build(deps): bump decode-uri-component from 0.2.0 to 0.2.2

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov/codecov-action&package-manager=github_actions&previous-version=4&new-version=5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index ba4c6e3c4..8c80bb50a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -121,7 +121,7 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Upload code coverage to Codecov.io - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: fail_ci_if_error: true env: From 8e5694150fb0f7acfeff437ce14d1fd3bb3292ca Mon Sep 17 00:00:00 2001 From: Andreas Heigl Date: Mon, 6 Jan 2025 11:15:49 +0100 Subject: [PATCH 3/3] fix: set nullable true when default value is null (#2390) ## Description When reflection shows that the default parameter of a a property is null, then the `nullable` parameter is set to `true` for that property. Currently that needs to be set via the attribute but that is a bit redundant as the information is already available from reflection This change only does that for properties and for setter methods. Right now getter methods that allow a null value to be returned are not taken into account for setting the `nullable` property. This resets the state prior to v4.25.0 and is related to #2330 This is a refactor of #2377 ## What type of PR is this? (check all applicable) - [x] Bug Fix - [ ] Feature - [x] Refactor - [ ] Deprecation - [ ] Breaking Change - [ ] Documentation Update - [ ] CI ## Checklist - [ ] I have made corresponding changes to the documentation (`docs/`) - [ ] I have made corresponding changes to the changelog (`CHANGELOG.md`) --- .../Annotations/ReflectionReader.php | 71 ++++++++++++++++--- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/src/ModelDescriber/Annotations/ReflectionReader.php b/src/ModelDescriber/Annotations/ReflectionReader.php index 4ea3f26f9..f59d14a05 100644 --- a/src/ModelDescriber/Annotations/ReflectionReader.php +++ b/src/ModelDescriber/Annotations/ReflectionReader.php @@ -54,6 +54,11 @@ public function updateProperty( if ($reflection instanceof \ReflectionMethod) { $methodDefault = $this->getDefaultFromMethodReflection($reflection); if (Generator::UNDEFINED !== $methodDefault) { + if (null === $methodDefault) { + $property->nullable = true; + + return; + } $property->default = $methodDefault; return; @@ -61,9 +66,14 @@ public function updateProperty( } if ($reflection instanceof \ReflectionProperty) { - $methodDefault = $this->getDefaultFromPropertyReflection($reflection); - if (Generator::UNDEFINED !== $methodDefault) { - $property->default = $methodDefault; + $propertyDefault = $this->getDefaultFromPropertyReflection($reflection); + if (Generator::UNDEFINED !== $propertyDefault) { + if (Generator::UNDEFINED === $property->nullable && null === $propertyDefault) { + $property->nullable = true; + + return; + } + $property->default = $propertyDefault; return; } @@ -77,6 +87,7 @@ public function updateProperty( if ($parameter->name !== $serializedName) { continue; } + if (!$parameter->isDefaultValueAvailable()) { continue; } @@ -89,7 +100,12 @@ public function updateProperty( continue; } - $property->default = $parameter->getDefaultValue(); + $default = $parameter->getDefaultValue(); + if (Generator::UNDEFINED === $property->nullable && null === $default) { + $property->nullable = true; + } + + $property->default = $default; } } @@ -117,10 +133,6 @@ private function getDefaultFromMethodReflection(\ReflectionMethod $reflection) return Generator::UNDEFINED; } - if (null === $param->getDefaultValue()) { - return Generator::UNDEFINED; - } - return $param->getDefaultValue(); } @@ -134,12 +146,49 @@ public function getDefaultFromPropertyReflection(\ReflectionProperty $reflection return Generator::UNDEFINED; } - $defaultValue = $reflection->getDeclaringClass()->getDefaultProperties()[$propertyName] ?? null; + if (PHP_VERSION_ID < 80000) { + return $reflection->getDeclaringClass()->getDefaultProperties()[$propertyName] ?? Generator::UNDEFINED; + } + + if (!$reflection->hasDefaultValue()) { + return Generator::UNDEFINED; + } - if (null === $defaultValue) { + if ($this->hasImplicitNullDefaultValue($reflection)) { return Generator::UNDEFINED; } - return $defaultValue; + return $reflection->getDefaultValue(); + } + + /** + * Check whether the default value is an implicit null. + * + * An implicit null would be any null value that is not explicitly set and + * contradicts a set DocBlock @ var annotation + * + * So a property without an explicit value but an `@var int` docblock + * would be considered as not having an implicit null default value as + * that contradicts the annotation. + * + * A property without a default value and no docblock would be considered + * to have an explicit NULL default value to be set though. + */ + private function hasImplicitNullDefaultValue(\ReflectionProperty $reflection): bool + { + if (null !== $reflection->getDefaultValue()) { + return false; + } + + if (false === $reflection->getDocComment()) { + return true; + } + + $docComment = $reflection->getDocComment(); + if (!preg_match('/@var\s+([^\s]+)/', $docComment, $matches)) { + return true; + } + + return false === strpos(strtolower($matches[1]), 'null'); } }