Skip to content

Conversation

@kenjis
Copy link
Member

@kenjis kenjis commented Nov 20, 2023

Description

The @var tag defines which type of data is represented by a value of a Constant, Property or Variable.
https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#518-var

It is better that we can write @var to constants like this:

/**
 * @var class-string<Model>
 */
public const $model = Widget::class;

From #4766 (comment)

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

If we want to write @var to constants, we can write.
@samsonasik
Copy link
Member

RemoveVarTagFromClassConstantRector is custom rule, if it disabled, it can also be removed from utils dir if no longer used.

@kenjis
Copy link
Member Author

kenjis commented Nov 21, 2023

Removed the file.

@kenjis kenjis merged commit 1d6b7ac into codeigniter4:develop Nov 22, 2023
@kenjis kenjis deleted the disable-RemoveVarTagFromClassConstantRector branch November 22, 2023 00:03
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

Successfully merging this pull request may close these issues.

2 participants