C.57 PHPStanTask

The PHPStanTask executes PHPStan - a PHP static analysis tool - with given configuration.

Table C.71: Base attributes

NameTypeDescriptionDefaultRequired
commandStringPHPStan command nameanalyseNo
executableStringPath to PHPStan executablephpstanNo
checkReturnBooleanWhether to check the return code.falseNo
passthruBooleanWhether to echo PHPStan's output on the console.falseNo

Table C.72: Analyse command attributes

NameTypeDescriptionDefaultRequired
configurationStringPath to configuration No
levelStringAnalyse level No
noProgressStringNO progress flagfalseNo
debugStringDebug flagfalseNo
autoloadFileStringPath to autoload file No
errorFormatStringError format No
memoryLimitStringMemory limit No
pathsStringPaths (space separated) No

Table C.73: List command attributes

NameTypeDescriptionDefaultRequired
formatStringHelp format No
rawStringRaw flagfalseNo
namespaceStringNamespace No

Table C.74: Help command attributes

NameTypeDescriptionDefaultRequired
formatStringHelp format No
rawStringRaw flagfalseNo
commandNameStringCommand name No

Table C.75: Common attributes

NameTypeDescriptionDefaultRequired
helpStringHelp flagfalseNo
quietStringQuiet flagfalseNo
versionStringVersion flagfalseNo
ansiStringANSI flagfalseNo
noAnsiStringNo ANSI flagfalseNo
noInteractionStringNo interaction flagfalseNo
verboseStringVerbose flagfalseNo

C.57.1 Supported Nested Tags

C.57.2 Example

                <phpstan
                command="analyse"
                configuration="anyConfiguration"
                level="anyLevel"
                noProgress="true"
                debug="true"
                autoloadFile="anyAutoloadFile"
                errorFormat="anyErrorFormat"
                memoryLimit="anyMemoryLimit"
                paths="path1 path2"
                />
            
                <phpstan command="analyse">
                <fileset refid="files-to-analyse"/>
                </phpstan>