2 回答
TA贡献1806条经验 获得超5个赞
++ composer require --dev phpdocumentor/phpdocumentor dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
++ php -v
PHP 7.2.19-0ubuntu0.19.04.2 (cli) (built: Aug 13 2019 11:45:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.19-0ubuntu0.19.04.2, Copyright (c) 1999-2018, by Zend Technologies
++ cat src/Assembler.php
<?php
/**
* File summary.
*/
namespace Xyz;
/**
* @package Abc
*/
class Assembler {
function assemble(?string $string) {
}
}
++ php vendor/bin/phpdoc -f src/Assembler.php --template=responsive
Collecting files .. OK
Initializing parser .. OK
Parsing files
Parsing /mnt/shared-ntfs/Downloads/test-phpdoc/src/Assembler.php
Parse Error: Syntax error, unexpected '?', expecting T_VARIABLE on line 13 No summary was found for this file
Storing cache in "/mnt/shared-ntfs/Downloads/test-phpdoc/output/build" .. OK
Load cache .. 0.001s
Preparing template "responsive" .. 0.006s
Preparing 13 transformations .. 0.000s
Build "elements" index .. 0.000s
Replace textual FQCNs with object aliases .. 0.000s
Resolve @link and @see tags in descriptions .. 0.000s
Enriches inline example tags with their sources .. 0.000s
Build "packages" index .. 0.001s
Build "namespaces" index and add namespaces to "elements" .. 0.000s
Collect all markers embedded in tags .. 0.000s
Transform analyzed project into artifacts ..
Applying 13 transformations
Initialize writer "phpDocumentor\Plugin\Core\Transformer\Writer\FileIo"
Initialize writer "phpDocumentor\Plugin\Core\Transformer\Writer\Xml"
Initialize writer "phpDocumentor\Plugin\Core\Transformer\Writer\Xsl"
Initialize writer "phpDocumentor\Plugin\Graphs\Writer\Graph"
Execute transformation using writer "FileIo"
Execute transformation using writer "FileIo"
Execute transformation using writer "FileIo"
Execute transformation using writer "xml"
Execute transformation using writer "xsl"
Execute transformation using writer "xsl"
Execute transformation using writer "xsl"
Execute transformation using writer "xsl"
Execute transformation using writer "xsl"
Execute transformation using writer "xsl"
Execute transformation using writer "xsl"
Execute transformation using writer "xsl"
Execute transformation using writer "Graph"
0.133s
Analyze results and write report to log .. 0.000s
解析错误:语法错误,意外的“?”,第 13 行应为 T_VARIABLE 未找到此文件的摘要
php 7.2 和 phpdoc 有没有可能真的不能达成一致?是否有任何与 php 7.2 兼容的 phpdoc 版本?
- 2 回答
- 0 关注
- 356 浏览
添加回答
举报