Add PHPDoc blocks to AbstractMigration#1052
Conversation
cfbd10f to
b45758d
Compare
|
Why would it be useful? |
|
Hey,
You have a description of the methods on the site, why not place the documentation in the code to save programmers from the need to google or research the code in depth to understand its work? |
That's a good point, maybe there is valuable information here that could be fit in the comments. |
|
I got it. So, do I understand correctly, if I add a more useful description for the P.S. I took a description of all methods from the official site (for method |
| } | ||
|
|
||
| /** | ||
| * Description of this migration. |
There was a problem hiding this comment.
Tautological, either improve or remove
| * | ||
| * @return string |
There was a problem hiding this comment.
Nothing new here, let's remove it
| * | |
| * @return string |
| * | ||
| * @param bool $condition | ||
| * @param string $message |
There was a problem hiding this comment.
| * | |
| * @param bool $condition | |
| * @param string $message |
| } | ||
|
|
||
| /** | ||
| * Warn with a message if some condition is met. |
There was a problem hiding this comment.
That's made fairly clear just by reading the signature (you don't have to read the code inside the method)
| } | ||
|
|
||
| /** | ||
| * Write some debug information to the console. |
There was a problem hiding this comment.
debug information is written with debug(), this is a notice.
| * | ||
| * @param string $message |
There was a problem hiding this comment.
| * | |
| * @param string $message |
phpcs.xml.dist
Outdated
| <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation"> | ||
| <exclude-pattern>lib/Doctrine/Migrations/AbstractMigration.php</exclude-pattern> | ||
| </rule> | ||
|
|
It's the opposite actually, if we merge the PR, then it means you will have added a more useful description for that method, but that will probably not be enough, since other methods need a better description too. |
b45758d to
62f6570
Compare
| /** | ||
| * Description of this migration. | ||
| * | ||
| * Describe what this migration does in simple terms. This information is displayed when you view the list of migrations. | ||
| */ |
There was a problem hiding this comment.
| /** | |
| * Description of this migration. | |
| * | |
| * Describe what this migration does in simple terms. This information is displayed when you view the list of migrations. | |
| */ | |
| /** | |
| * Describe what this migration does in simple terms. This information is displayed when you view the list of migrations. | |
| */ |
| /** | ||
| * Write some debug information to the console. | ||
| * | ||
| * Debug information is written with debug(). |
There was a problem hiding this comment.
🤔 I mean it should, but it's actually written with notice(), so that comment is just misleading
Summary
Add PHPDoc blocks to AbstractMigration methods. This could be useful for those who use
@inheritdocannotation (like me:)).