-
Notifications
You must be signed in to change notification settings - Fork 886
Added missing comments to phpDocs #1285
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
Conversation
|
There is also a even simpler solution: Set the PHPStorm (or other IDE) to the proper setting: Only primary level (0) for checking. By default using anything higher usually exposes a risk of false positives or forgetting things when refactoring and is considered not the best practice and unreliable even :) So while I don't say this here is bad, I think this can easiest be fixed in the IDE itself + code sniffer. |
Codecov Report
@@ Coverage Diff @@
## master #1285 +/- ##
=======================================
Coverage 74.83% 74.83%
=======================================
Files 35 35
Lines 4777 4777
=======================================
Hits 3575 3575
Misses 1202 1202Continue to review full report at Codecov.
|
|
@dereuromark Checking the code goes not only on the comments, but since the IDE highlights this place, as wrong, I want to fix this with minimal effort. |
|
Actually, no :) A code sniffer should always be already installed. You could just copy and paste the file and assert then without additional baggage even. But you seemed to have missed my point then. |
|
In the
Only the method /**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/@dereuromark Do you think this is superfluous? @chinpei215 @robmorgan @shadowhand @rquadling @cyrusboadway @coatesap |
|
You could simply overwrite the default class/template and add your own comments. From my teams 'migration_base_class' => \OurProject\Migration\AbstractMigration::class,
'templates' => [
'file' => './lib/OurProject/Migration/Phinx/Templates/Master.template',
],sort of thing. |
|
I think the root cause of the problem is that two useless I think we should use In conclusion, I would like to suggest removing those useless |
|
Closing as throws should really mainly be for the ones implementable, not the real error cases not to be handled. |
Hello! I very often create my own migrations using the
vendor/bin/phinx create CreateTestTablecommand and it creates the next class.This code is correct and simple, even contains a detailed PHPDocs.
I want to create a new table
testand add an integer numeric field "num" to it.This will also be a valid code, migration is correctly executed. But comments in the PHPDocs will be incorrect. It will be necessary to add the following text to the commentary.
And these actions must be repeated each time the
addColumnmethod is used in the migration. If you do not do this, my code editor (PHPStorm) swears at the line with the call to theaddColumnfunction.And most developers are faced with this problem when writing their migrations. I propose to simplify the writing of migrations and to indicate this text in advance in the comments. This does not make the migration code complex, but it helps when writing migrations.
I propose the simplest and most obvious solution to this problem.