Search code examples
phpeclipsephpdoceclipse-pdt

false phpdoc errors in eclipse PDT


I currently use Eclipse Photon PDT for an old PHP application. In this application there's lot of phpdoc comments but some of them are marked as errors.

  • for "@param unknown $form" => "unknown cannot be resolved to a type".
  • idem for "@return Ambigous <multitype:string , multitype:>" => "Ambigous cannot be resolved to a type".

Does someone know how to disable these errors? (because of that all my project files are marked with the error icon and I cannot see which files really have errors).


Solution

  • Easiest short-term fix is to disable that level of error checking:

    Project -> Properties

    PHP -> Validation -> Errors/Warnings

    Enable project specific settings

    Undefined type -> change from Error to Ignore

    Better long-term fix is to use the expected type of mixed when the type is unknown or could be most anything.