romanzipp / Laravel-Model-Doc

📝 Generate PHPDoc comments for Laravel Models
MIT License
22 stars 6 forks source link

EOL and DateTime #13

Closed insperedia closed 2 years ago

insperedia commented 2 years ago

As I understand default PHPStorm EOL is \n, the code wants \r\n. So I included automatic eol detection, may be suboptimal but working. Also if the column has DateTime type it is written in Docs as a string which makes static analysis tools unhappy.

Also in my particular project, I needed a setting opposite to ignore, like includeOnly. I did not include it in Pull Request as it an edge case, I think it could be valuable. In my case, I continue to develop partially done code which already has extensive PhpDocs for old models.

romanzipp commented 2 years ago

As far as I know, Laravel will not cast a MySQL DATETIME column to a PHP DateTime object. The recommended use would be appending the columns name to the $casts (or $dates) model attribute: https://laravel.com/docs/9.x/eloquent-mutators#attribute-casting

insperedia commented 2 years ago

Yes, you right