When creating a readonly class, I end up with these errors:
34 | ERROR | Inline doc block comments are not allowed; use "// Comment." instead (moodle.Commenting.InlineComment.DocBlock)
42 | ERROR | Expected MOODLE_INTERNAL check or config.php inclusion. Change in global state detected.
| | (moodle.Files.MoodleInternal.MoodleInternalGlobalState)
After removing readonly, there are no errors.
The workaround I'm currently using is to add readonly to all class properties instead.