Installation of Luemn Php_codesniffer

Source: Internet
Author: User
Tags coding standards

1.php_codesniffer is a package written by PHP5 in pear to check if a packet is violating a set of pre-set coding standards, which is an essential development tool to ensure that your code is concise and consistent, and even helps programmers to reduce some semantic errors.

Installation of 2.luemn Php_codesniffer

Switch to lumen project Root to perform composer require squizlabs/php_codesniffer

  

After installation, perform the view Help command. \vendor\bin\phpcbf-h as shown in the installation success.

  

3. Formatting code

(1). Check all files in the app Directory PSR2 specification command

Used under Windows. \vendor\bin\phpcs--STANDARD=PSR2./app

Used under Linux./vendor/bin/phpcs--STANDARD=PSR2./app

(2). You can format the code using PHPCBF

. \VENDOR\BIN\PHPCBF--STANDARD=PSR2--no-patch. \app

Installation of Luemn Php_codesniffer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.