Package de.whitewashing.php.cs.command

Source Code of de.whitewashing.php.cs.command.CodeSnifferBuilder

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package de.whitewashing.php.cs.command;

import de.whitewashing.php.cs.ui.options.CodeSnifferOptions;

/**
* Simple factory/singleton that creates a unique CodeSniffer instance based
* on the user's preferences and the underlying system settings.
*
* @author manu
*/
public class CodeSnifferBuilder {

    private static CodeSniffer codeSniffer = null;

    public static CodeSniffer createOrReturn() {
        if (codeSniffer == null) {
            return create();
        }
        return codeSniffer;
    }

    public static CodeSniffer create() {
        CodeSnifferOptions options = new CodeSnifferOptions();
        return (codeSniffer = new CodeSniffer(options.getShellScript(), options.getCodingStandard(), options.hasShowWarnings()));
    }
}
TOP

Related Classes of de.whitewashing.php.cs.command.CodeSnifferBuilder

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.