-
Cài đặt PHP-Code-Sniffer
composer global require "squizlabs/php_codesniffer=*" -
Thêm bộ quy tắc Framgia PHP https://github.com/wataridori/framgia-php-codesniffer
-
Cài đặt Sublime Text package https://packagecontrol.io/packages/Phpcs.
Cấu hình: Preferences => Package Settings => PHP Code Sniffer => Settings User
{ "phpcs_executable_path": "ABSOLUTE_PATH_OF_phpcs", "phpcs_additional_args": { "--standard": "Framgia", "-n": "" }, }
-
Other Sublime Text setting
{ // End of file is always newline "ensure_newline_at_eof_on_save": true, // Using space "translate_tabs_to_spaces": true, // Strip whitespace "trim_trailing_white_space_on_save": true "rulers": [ 80, // Soft limit 120 // Hard limit ], "indent_guide_options": [ "draw_normal", "draw_active" ], "show_encoding": true, "show_line_endings": true, }
-
With PHPStorm: https://confluence.jetbrains.com/display/PhpStorm/PHP+Code+Sniffer+in+PhpStorm
- posted by: Lâm Ngọc Khương
- site: https://ngockhuong.com
- email: [email protected]