Skip to content

fix(deprecated): a promoted property marked @deprecated is reported on use - #14310

Merged
orklah merged 3 commits into
vimeo:masterfrom
jirkace:fix/10184-promoted-property-deprecated
Nov 21, 2026
Merged

orklah merged 3 commits into
vimeo:masterfrom
jirkace:fix/10184-promoted-property-deprecated

Conversation

@jirkace

@jirkace jirkace commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Psalm does not report DeprecatedProperty for a promoted constructor property whose docblock says @deprecated.

Before

<?php
class A {
    public function __construct(
        /** @deprecated */
        public int $foo,
    ) {}
}
echo (new A(1))->foo; // no issue

After

echo (new A(1))->foo; // DeprecatedProperty: A::$foo is marked deprecated

Fixes #10184

…n use vimeo#10184

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Performance: unchanged · Types: increased

Project Memory (MB) Wall (s) Issues Weighted (types) Taint
✅ laravel 1 765 74.8 $\color{gray}{\textsf{+1.3\%}}$ 26 015 53 212 673
✅ symfony 3 605 171.5 $\color{gray}{\textsf{-2.5\%}}$ 50 699 98 716 1 491
✅ doctrine-orm 393 22.3 $\color{gray}{\textsf{-0.1\%}}$ 3 480 6 161 0
✅ psl 632 27.4 $\color{gray}{\textsf{+0.7\%}}$ 1 300 5 456 1
✅ phpunit 471 20.1 1 744 3 459 18
✅ php-parser 236 13.9 $\color{gray}{\textsf{-0.1\%}}$ 17 133 21 035 0
✅ tempest 903 35.6 $\color{gray}{\textsf{-0.6\%}}$ 5 042 10 514 242
✅ amphp-amp 61 1.6 $\color{gray}{\textsf{+3.9\%}}$ 29 49 0
✅ webmozarts-assert 286 3.6 $\color{gray}{\textsf{-1.1\%}}$ 577 2 722 0
✅ guzzle-promises 55 1.6 $\color{gray}{\textsf{+4.6\%}}$ 158 435 2
✅ monolog 153 4.6 $\color{gray}{\textsf{+0.9\%}}$ 903 2 403 10
✅ drupal 4 850 227.8 $\color{gray}{\textsf{-0.1\%}}$ 97 581 $\color{red}{\textsf{+3}}$ $\color{gray}{\textsf{-0}}$ 169 333 $\color{red}{\textsf{+6}}$ 568
Total 13 412 604.8 $\color{gray}{\textsf{-0.6\%}}$ 204 661 $\color{red}{\textsf{+3}}$ $\color{gray}{\textsf{-0}}$ 373 495 $\color{red}{\textsf{+6}}$ 3 005
How to read this table
  • Memory: Psalm's own peak figure, threads=1. More than +5 % fails, unless the PR changes composer.json.
  • Wall: base and head run on the same runner; ±10 % is noise. Above +20 % warns, never fails. re-run: a reversed second run was taken and the faster kept.
  • Issues: head count over all categories, then $\color{red}{\textsf{+added}}$ $\color{green}{\textsf{-removed}}$ against base.
  • Weighted (types): type issues weighted by error level (levels 1–8 as is, always-errors 10, strictness checks 1). Taint and dead-code issues are not weighed. The projects' own code is pinned and their dependencies resolve identically for base and head, so a change means Psalm reports more, fewer or differently serious issues. A rise is not necessarily a regression.
  • Taint: head count of Tainted* issues, then $\color{orange}{\textsf{+added}}$ $\color{orange}{\textsf{-removed}}$ against base. Both are orange as either direction needs review: more can be new detection or false positives, fewer can be fixed false positives or lost detection.
  • Dead code: head count of unused-code issues, shown only when a run reported some (findUnusedCode). More is red, fewer is green.
  • Total: sum over the projects compared on both sides. Thresholds apply per project, not to the total.
  • Colors: $\color{red}{\textsf{red}}$ past a fail or warn threshold (or more issues), $\color{green}{\textsf{green}}$ an improvement past noise (or fewer issues), $\color{orange}{\textsf{orange}}$ needs review, $\color{gray}{\textsf{gray}}$ noise.
  • Performance: regressed if a head run crashed or timed out or a memory or wall delta is red, else improved if one is green, else unchanged. Its icon is the check result: ❌ fail · ⚠️ warn · ✅ pass; the icon next to each project is that project's result, 💥 = not comparable: base crashed or timed out (counts as ⚠️).
  • Types (heading): direction of the total weighted change, increased · decreased · unchanged. Taint and Dead code (heading): added and removed counts, present only when non-zero. Informational, never fails the check.
✅ drupal: issues +3 −0

Memory 4 850 → 4 850 MB (<0.1 %) · Wall 228.1 → 227.8 s (−0.1 %)

Weighted 169 327 → 169 333 (+6, <0.01 %): L2 +3

Issue type added removed
DeprecatedProperty 3 0

Added (3)

  • core/lib/Drupal/Core/Entity/Attribute/ConfigEntityType.php:64 DeprecatedProperty (error): Drupal\Core\Entity\Attribute\ConfigEntityType::$uri_callback is marked deprecated
  • core/lib/Drupal/Core/Entity/Attribute/ContentEntityType.php:72 DeprecatedProperty (error): Drupal\Core\Entity\Attribute\ContentEntityType::$uri_callback is marked deprecated
  • core/lib/Drupal/Core/Entity/Attribute/EntityType.php:70 DeprecatedProperty (error): Drupal\Core\Entity\Attribute\EntityType::$uri_callback is marked deprecated

head 5971ce2 · base 78d192b (merge-base) · workflow run

@jirkace

jirkace commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Behaviour change

  • A promoted constructor property with @deprecated in its docblock now reports DeprecatedProperty where it is read or written, like a declared property.
  • The assignment analyze runs for taint analysis (taintPromotedProperties) reaches the same check, so the declaration of the property does not report it (the synthetic fetch carries promoted_parameter); TaintTest case deprecatedPromotedPropertyIsNotUsedByItsOwnDeclaration fails without that.
  • Not covered: an attribute (#[Deprecated]) on the promoted parameter.
  • Run locally: the new cases, their neighbours (deprecatedProperty*FromInsideTheClass, taintPromotedProperty) and one full self-analysis (only the two PoolEventLoopDriverTest errors of my local vendor/, identical on master). Not run: the full suite (CI).

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Nov 21, 2026
@orklah
orklah merged commit 6ca8abe into vimeo:master Nov 21, 2026
69 of 70 checks passed
@orklah

orklah commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Thanks @jirkace!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:fix The PR will be included in 'Fixes' section of the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Constructor property promotion doesn't give a warning for deprecation

2 participants