Usage

Use own or downloaded sniffer

Plugin happens to run in test & generate-sources phase. Goal for running PHP CodeSniffer tests is check and for downloading download.

you have PHP CodeSniffer as part of you project already and want to use the same.

    com.umakantpatil
    phpcodesniffer-maven-plugin
    0.0.1
    
        /home/user/your/project/target/php-codesniffer/
        /home/user/your/project/target/php-build/bin/php
        /home/user/your/project/src/main
    
    
        
            sniff-test
            test
            
                check
            
        
    

        
If you want plugin to download PHP CodeSniffer for you, then mention the version and path to store it.


    com.umakantpatil
    phpcodesniffer-maven-plugin
    0.0.1
    
        /home/user/your/project/build/php-codesniffer
        2.4.0
        /home/user/your/project/target/php-build/bin/php
        /home/user/your/project/src/main
    
    
        
            sniff-test
            test
            
                check
            
        
        
            sniff-download
            generate-sources
            
                download
            
        
    

        

More configs

Custom ruleset has to be passed in configuration, so that sniffer understands want kind of rules you want to enable for your project.
/home/user/your/project/src/test/rules/psr2.xml
        
Plugin also allows to set memory for PHP while running checks in configuration. Default is 250M. This is optional and you may not want to worry about it.
200M
        

Copyright © 2015- Umakant Patil. All rights resevered.            PHP CodeSniffer is copyright of Squiz Pty Ltd.