PHPDocs doesn't work properly
I use the pattern "/**" to add PHPDocs to my coding.
I experienced in one PHP file different behaviours of Eclipse. For some functions Eclipse behaves as expected, it generates the whole template with all parameters of the function and the closing "**/".
For some functions the doesn't work correctly. It generates sometimes the beginning of the template but without the function parameters and sometimes without the parameters and without closing the comment, e.g.
/**
*
function foo ($p1,$p2) {
}
Does anybody know the reason? Eclipse is up-to-date (Version: 2023-03 (4.27.0) Build id: 20230309-1520).
After some test I could isolate the issue. The following code demonstrates it:
<?php
function html2print($txt) {
$txt = html2chars($txt);
$txt = html2uml($txt);
}
function telnr_flat($telnr,$anlcut=0) {
if ($anlcut) $telnr = preg_replace("/\-[0-9]*/","",$telnr);
$telnr = preg_replace("/\+([0-9]*) /","00$1",$telnr);
}
?>
If you try to insert "/**"before the first function obviously the terminating string "*/"is automatically found in the line with the preg_replace statement. Therefore Eclipse doesn't finish its normal includes.
Thanks Dirk