Ariel Mejia Posted on May 17, 2021 • Updated on Aug 3, 2021 Code sniffer is a package to apply syntax rules to our php code to follow PSR-standards, here a guide to install and use it: Install code sniffer
Enter fullscreen mode Exit fullscreen mode Add a configuration file
Enter fullscreen mode Exit fullscreen mode You can add your configuration rules, here a good example to use it in a laravel
projects:
Enter fullscreen mode Exit fullscreen mode Another more advance example could be:
Enter fullscreen mode Exit fullscreen mode Feel free to use whatever configuration that makes sense for your project. Execute the code sniffer fixerOn terminal execute this command:
Enter fullscreen mode Exit fullscreen mode Or using the configuration
Enter fullscreen mode Exit fullscreen mode You can add more flags to customize the behavior of the fixer, here another example:
Enter fullscreen mode Exit fullscreen mode You can install husky with |