Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline doc block comments are not allowed when using readonly as first property modifier #187

Open
matthewhilton opened this issue Oct 28, 2024 · 1 comment

Comments

@matthewhilton
Copy link

When using the readonly keyword first, instead of second (as was fixed in #120), moodle-cs is giving the error Inline doc block comments are not allowed

For example,
This does not work (readonly first):

public function __construct(
    /** @var string some info */
    readonly public string $test
) {

But this does work (readonly second):

public function __construct(
    /** @var string some info */
    public readonly string $test
) {

I cant find any official php docs about what order is the best/correct, but if one is preferred it might be worth enforcing a specific order as an additional check ?

@matthewhilton matthewhilton changed the title Inline doc block comments are not allowed when using readonly promoted constructor values Inline doc block comments are not allowed when using readonly as first property modifier Oct 28, 2024
@andrewnicols
Copy link
Contributor

andrewnicols commented Oct 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants