coding-standard
laravel-ide-helper
coding-standard | laravel-ide-helper | |
---|---|---|
9 | 31 | |
1,358 | 13,888 | |
0.9% | - | |
8.2 | 8.3 | |
about 2 months ago | 4 days ago | |
PHP | PHP | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
coding-standard
-
Laravel code-quality tools
If you go through the imports in the config/insights.php file, you'll see that it mostly uses rules from NunoMaduro\PhpInsights and SlevomatCodingStandard\Sniffs. The former is PHP Insight's in-house insights and the latter is the sniffs from the Slevomat coding standard. In most cases, you'll only ever reach for those two.
-
Does CodeSniffer/ECS have the possibility to detect large methods/functions?
However, you can get cognitive complexity in phpcs with the slevomat ruleset. This ruleset is used as a base for the Doctrine coding standard.
-
Searching expecific rules for php-cs-fixer
I think you can use the Slevomat Coding Standards to solve both issues.
-
Tools you’ve used to increase code quality and/or productivity?
I also make heavy use of Codesniffer with PSR12 as a base and a load of the rules from https://github.com/slevomat/coding-standard - learning how to use Codesniffer and setting up a comprehensive coding standard can be incredibly helpful when working as part of a team.
-
Recommendations for productivity tools/libraries?
You should check out https://github.com/slevomat/coding-standard for some very useful additional rules.
-
Strict operators on known return values
no need for muscle memory, there's a phpcs rule for that 🙂
-
How do you enforce a consistent code style in your projects?
Codesniffer. Though the requirements may differ between projects I typically use PSR12 as a starting point, plus disallowing long array syntax, enforcing a need for DocBlocks, and a few others. I find https://github.com/slevomat/coding-standard is also a good source of useful sniffs.
-
Why "on" == 0 evaluates to true?
Well, as we have this phpcs rule in our coding standard, it is forbidden (for us) 😉 Maybe, forbidden is not a good word, though.
laravel-ide-helper
-
Elevate Your Laravel Eloquent Queries with Tappable Scopes
This works well, but it does make it harder for the IDE to handle unless you’re using something like the Laravel IDE Helper package.
-
VSCode for PHP and Laravel
barryvdh/laravel-ide-helper: IDE Helper for Laravel
-
Best practice for code-completion after retrieving an Eloquent model using Model::first()
Perhaps https://github.com/barryvdh/laravel-ide-helper? I haven’t used it in a while so can’t remember if it will specifically help with the results of methods like first().
-
What are some Good VS Code Extensions for PHP/Laravel?
This. As well as adding https://github.com/barryvdh/laravel-ide-helper as a dev package. Then run the artisan commands to generate helper files.
-
learning laravel and I see variable declarations? like this /** @var User $user */
As an addition to what others have said - For Laravel development specifically, it is worth adding the https://github.com/barryvdh/laravel-ide-helper package to your dev dependencies.
-
why do i get this error on vscode but, when i send a request to it works !!!!
https://github.com/barryvdh/laravel-ide-helper has helped me with this in the past.
-
Thoughts on "Hard Coding" properties for auto complete?
What you're looking for is: https://github.com/barryvdh/laravel-ide-helper
-
Why aren't certain methods showing on my model?
Laravel has some magic inside of it, that's why create() doesn't show up in your IDE completion. Not sure if it works in VS Code, but the ide-helper package helps PhpStorm to understand the internals of Laravel better.
-
Visual Studio Supremacy
Why do you need an IDE for PHP? Its not compiled, there’s no GUI etc. You can get autocompletion etc for laravel in VS Code too with https://github.com/barryvdh/laravel-ide-helper
-
Running Laravel IDE Helper Generator automatically
There is no exception in this case when using the package barryvdh/laravel-ide-helper that generates helper files that enable your IDE to provide accurate autocompletion.
What are some alternatives?
laravel-code-style - Automatic code formatting for Laravel projects
larastan - ⚗️ Adds code analysis to Laravel improving developer productivity and code quality.
phpcs-laravel - The PHP_Codesniffer configuration I use across Laravel projects
vscode-intelephense - PHP intellisense for Visual Studio Code
VIP-Coding-Standards - PHP_CodeSniffer ruleset to enforce WordPress VIP coding standards.
phpinsights - 🔰 Instant PHP quality checks from your console
GrumPHP - A PHP code-quality tool
Psalm - A static analysis tool for finding errors in PHP applications
easy-coding-standard - The Easiest way to add coding standard to your PHP project
psalm-plugin-laravel - A Psalm plugin for Laravel
PHP-CS-Fixer - A tool to automatically fix PHP Coding Standards issues [Moved to: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer]
Laravel 6 - Powerful REPL for the Laravel framework.