getDocComment(); if($docComment === false || (preg_match("/^\s*\*\s*\@see .+::_generateMethodAnnotations\(\)$/m", $docComment) !== 1 && preg_match("/^\s*\*\s*@generate-registry-docblock$/m", $docComment) !== 1)){ continue; } echo "Found registry in $file\n"; $replacement = RegistryUtils::_generateMethodAnnotations($matches[1], $className::getAll()); $newContents = str_replace($docComment, $replacement, $contents); if($newContents !== $contents){ echo "Writing changed file $file\n"; file_put_contents($file, $newContents); }else{ echo "No changes made to file $file\n"; } }