企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# C.74 PhpDependTask This task runs [PHP\_Depend](http://pdepend.org), a software analyzer and metric tool for PHP Code. You need an installed version of this software to use this task. **NB:** if you have installed the PHP\_Depend Phar file, make sure you set the `pharLocation` attribute! Table C.99:聽Attributes NameTypeDescriptionDefaultRequired`file``String`Path to source file or pathn/aOnly when there are *no* nested `fileset` elements`configFile``String`Path to PHP\_Depend configuration filen/aNo`allowedFileExtensions``String`Comma-separated list of valid file extensions (without dot) for analyzed files.php,php5No`excludeDirectories``String`Comma-separated list of directory patterns to ignore.`.git`, `.svn`, `CVS`No`excludePackages``String`Comma-separated list of packages to ignore.n/aNo`withoutAnnotations``Boolean`Should the parse ignore doc comment annotations?`false`No`supportBadDocumentation``Boolean`Should PHP\_Depend treat `+global` as a regular project package?`false`No`debug``Boolean`Enable debug output?`false`No`haltonerror``Boolean`Stop the build process if errors occurred during the run.`false`No`pharlocation``String`Location of the PHP\_Depend Phar file.n/aNo C.74.1 Example ``` <phpdepend file="path/to/source"> <logger type="phpunit-xml" outfile="reports/metrics.xml"/> </phpdepend> ``` Running code analysis for source files in the given path. ``` <phpdepend> <fileset dir="${builddir}"> <include name="apps/**/*.php" /> <include name="lib/de/**/*.php" /> </fileset> <logger type="jdepend-xml" outfile="reports/jdepend.xml"/> <analyzer type="coderank-mode" value="method"/> </phpdepend> ``` Running code analysis for source files in the fileset pathes with CodeRank strategy `method`. C.74.2 Supported Nested Tags - `fileset` This nested tag is required when the `file` attribute is not set. - `logger` The results of the analysis can be parsed by differed loggers. At least one logger is required. Output will always be sent to a file. Table C.100:聽Attributes NameTypeDescriptionDefaultRequired`type``String`The name of the logger. Valid loggers are: `jdepend-chart`, `jdepend-xml`, `overview-pyramid`, `phpunit-xml` and `summary-xml`.n/aYes`outfile``String`Path to write output file to.n/aYes - `analyzer` Some additional analyzers can be added to the runner. Table C.101:聽Attributes NameTypeDescriptionDefaultRequired`type``String`The name of the analyzer. Valid analyzers are: `coderank-mode`.n/aYes`value``String`The value for the analyzer.n/aYes