Module: lib/Cli

lib/Cli

new require("lib/Cli")(fsContainer, pathContainer)

CLI services
Parameters:
Name Type Description
fsContainer type
pathContainer type
Source:
A module representing Cli
Source:

Members

<inner> fileCount :number

Type:
  • number
Source:

Methods

<inner> applyToEveryFileInDir(pathArg, fn)

Apply callback to every file within the directory recursively
Parameters:
Name Type Description
pathArg string
fn dirIteratorCb
Source:

<inner> applyToEveryFileInPath(pathArg, fn)

Apply callback to every file within the path recursively
Parameters:
Name Type Description
pathArg string
fn dirIteratorCb
Source:

<inner> applyToFile(pathArg, fn)

Apply callback to the file
Parameters:
Name Type Description
pathArg string
fn dirIteratorCb
Source:

<inner> define(factory)

Override AMD `define` function for RequireJS
Parameters:
Name Type Description
factory function
Source:

<inner> extractExistingReportBody(file) → {string}

If checkstyle already exists (e.g. built by phpcs), extend it with actual report body
Parameters:
Name Type Description
file string
Source:
Returns:
Type
string

<inner> findPathsInCliArgs(args) → {string[]}

Find file name or path given in CLI arguments
Parameters:
Name Type Description
args string[]
Source:
Returns:
Type
string[]

<inner> getElapsedTime() → {String}

Determine script execution time
Source:
Returns:
Type
String

<inner> getProjectInfo() → {Object}

Get object with project info
Source:
Returns:
Type
Object

<inner> parseCliOptions(args, options) → {Object}

Populate options with ones founds in args
Parameters:
Name Type Description
args Array
options Object reference
Source:
Returns:
Type
Object

<inner> printFooter()

Display footer information
Source:

<inner> printHeader(version)

Display header information (copyright)
Parameters:
Name Type Description
version string
Source:

<inner> printSuccess(standard)

Display boy in the case of successful bypass
Parameters:
Name Type Description
standard string
Source:

<inner> readRealtimeConfig(pathArg) → {Object}

Find in project root (any parent) directory and read local sniffer configuration Just like .jshintrc
Parameters:
Name Type Description
pathArg string
Source:
Returns:
Type
Object