new require("lib/Sniff/SyntaxTree/ChainedMethodCallsPerLineConventions")(sourceCode, mediator, tokenIterator)
Parameters:
Name | Type | Description |
---|---|---|
sourceCode |
module:lib/SourceCode | |
mediator |
module:lib/Mediator | |
tokenIterator |
module:lib/TokenIterator |
A module representing a sniffer.
Methods
-
<protected, inner> findIdentifier(node)
-
Find identifier of a given chained call
Parameters:
Name Type Description node
Object (CallExpression) -
<protected, inner> findProperties(node)
-
Extract all the properties of a given chained call
Parameters:
Name Type Description node
Object (CallExpression) -
<protected, inner> iterateChain(node, fn)
-
Iterate through the chain
Parameters:
Name Type Description node
Object (CallExpression) fn
function Callback -
<protected, inner> run(rule, node, pNode)
-
Run the sniffer according a given rule if a given node type matches the case
Parameters:
Name Type Description rule
Object node
Object pNode
Object -
<protected, inner> sniffMembersOnDistinctLines(members)
-
Iterate members and trigger violations every time a member found on the same line with previous one
Parameters:
Name Type Description members
Object[] -
<inner> validateRule(rule)
-
Check the contract
Parameters:
Name Type Description rule
Object