File: libs/codesniffer/usage.txt

Recommend this page to a friend!
  Classes of Michael Cummings  >  PHP SQL Parser Class  >  libs/codesniffer/usage.txt  >  Download  
File: libs/codesniffer/usage.txt
Role: Documentation
Content type: text/plain
Description: Documentation
Class: PHP SQL Parser Class
Parse SQL to extract the SQL query structure
Author: By
Last change:
Date: 2 years ago
Size: 848 bytes
 

 

Contents

Class file image Download
Install PHP_CodeSniffer:
========================

pear install PHP_CodeSniffer


Check the code with:
====================

phpcs --standard=/path/to/the/PhOSCo/folder /path/to/the/src/folder >/tmp/code-errors.txt
vi /tmp/code-errors.txt


Or integrate it as external tool into Eclipse:
==============================================

* Open External tool configuration window
* set the name to "CodeSniffer"
* set /usr/bin/phpcs as Location
* set --standard="${project_loc}/libs/codesniffer/PhOSCo" "${selected_resource_loc}" as Arguments
* on the Build tab set the parameters as needed
* click "Apply" and "Close"

* select one of the folders or *.php files
* execute the external tool "CodeSniffer"
* review the errors within the console output within Eclipse

correct all listed errors (...I hate it)!
=========================================

For more information send a message to info at phpclasses dot org.