eclipse-pdt / pdt

PHP Development Tools project (PDT)
https://eclipse.org/pdt
Eclipse Public License 2.0
189 stars 46 forks source link

error inexistent listed #176

Closed RodrigoAliotti closed 1 year ago

RodrigoAliotti commented 1 year ago

Describe the bug When write : function( #[SensitiveParameter] the eclipse return a problem: SensitiveParameter cannot be resolved to a type

Describe the eclipse environment Eclipse Version 2023-06 (4.28.0), PDT version (8.0.0.202306050832)

Describe your system

To Reproduce Steps to reproduce the behavior:

  1. Create new php file
  2. write new function: function test(#[SensitiveParameter] String $aValue){ echo ' test'; }
  3. save file 4 Captura de tela_2023-06-16_12-17-45 .error is reported in problems in tab of eclipse
mlocati commented 1 year ago

At the beginning of your PHP file you define a namespace, right? If so, it's not a problem of PDT: you are telling PHP to use the SensitiveParameter attribute defined in your namespace. If you want to refer to the SensitiveParameter defined in the root namespace (that is, the one that comes with PHP 8.2), you have to use #[\SensitiveParameter] instead of #[SensitiveParameter].

zulus commented 1 year ago

If didn’t define Classes\SensitiveParameter or didn’t import \SensitiveParameter error is correct