Download the PHP package happytech/phpcs without Composer

On this page you can find all versions of the php package happytech/phpcs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpcs

About

PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.

Installation

  1. Install PHP_CodeSniffer

  2. In command line, go inside the phpcs Standards directory

    Under Linux Mint, the path is /usr/share/php/PHP/CodeSniffer/Standards/

  3. Checkout this repository

    git clone [email protected]:Microclimat/phpcs.git Happy
  4. Check the installed coding standards for "Happy"

    phpcs -i
  5. Set Happy like default standard

    phpcs --config-set default_standard Happy
  6. Done!

Options - Not required but recommanded

To use colors in output by default

    phpcs --config-set colors 1

Hiding warnings by default :

    phpcs --config-set show_warnings 0

Usage

Launch an analyse

    phpcs /path/to/code

Fixing Errors Automatically

    phpcbf /path/to/code

Ignoring

    <?php
    some_code();
    // @codingStandardsIgnoreStart
    this_will_be_ignored();
    // @codingStandardsIgnoreEnd
    some_other_code();

All documentation is here

Just for fun

Use this to show all commits with errors

    phpcs --report=gitblame /path/to/code

To register PHP Code Sniffer in IntelliJ IDEA

Open the Settings dialog box, and click Code Sniffer under the PHP node. In the PHP Code Sniffer path text box, specify the location of the Code Sniffer executable phpcs.bat. Type the path manually or click the Browse button browseButton.png and select the path in the dialog box, that opens. To check that the specified path to phpcs.bat ensures interaction between IntelliJ IDEA and Code Sniffer, that is, the tool can be launched from IntelliJ IDEA and IntelliJ IDEA will receive problem reports from it, click the Validate button. This validation is equal to running the phpcs --version command. If validation passes successfully, IntelliJ IDEA displays the information on the detected Code Sniffer version.

To configure PHP Code Sniffer as a IntelliJ IDEA inspection

Open the Settings dialog box, and click Inspections. On the Inspections page that opens, select the PHP Code Sniffer validation check box under the PHP node. On the right-hand pane of the page, configure the PHP Code Sniffer tool using the controls in the Options area: From the Severity drop-down list, choose the severity degree for the Code Sniffer inspection. The selected value determines how serious the detected discrepancies will be treated by IntelliJ IDEA and presented in the inspection results. In the Coding standard drop-down list, appoint the coding style to check your code against. The list contains all the coding standards installed inside the main PHP_CodeSniffer directory structure. Use one of the predefined coding standards or choose Custom to appoint your own standard. Optionally, select the Ignore warnings check box to have only errors reported and suppress reporting warnings. This option is equal to the -n command line argument.

To use PHP CS on sublime Text

Use http://benmatselby.github.io/sublime-phpcs/ On win7 : Preference > Package Settings > Php Code Sniffer > Settings - User

and change PATH with your own values

Using phpcs with GrumPHP (inspection before commit)

First of all, you'll need grumphp : https://github.com/phpro/grumphp

Follow the instructions, and add a task of type phpcs into your grumphp.yml (edit it like in the below example).

You should have this written in your file :

Go in your project's root folder, launch a terminal and type

This will add the Happy convention and phpcs to your vendors and update your composer.json

Next, try to commit !


All versions of phpcs with dependencies

PHP Build Version
Package Version
Requires php Version >=5.1.2
squizlabs/php_codesniffer Version ^2.6.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package happytech/phpcs contains the following files

Loading the files please wait ...