问题标签 [phpdocumentor2]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
281 浏览

codeigniter - phpdoc codeigniter 文件夹类为空

我想在我的 codeigniter 项目中使用 PHP Documentor。我通过 pear 安装了 phpdocs,并尝试通过在我的应用程序目录中运行以下命令来使用它:

所有方法都被注释为docblocks.

我的结果是一个带有 index.html 文件的文件夹,但是当我打开时,我无法输入我的任何类。它返回给我一个错误:

文件未找到

更重要的是,我的课程目录是空的。出于好奇,我尝试在我干净的 php 文件上使用 phpdoc,它向我显示了正常的文档。

有人可以告诉我如何在 codeigniter 项目上使用 phpdoc 吗?也许还有其他软件可以提供类似的结果?

0 投票
2 回答
888 浏览

php - 使用composer在laravel中安装phpDocumentor失败

我正在尝试通过composer require phpdocumentor/phpdocumentor在 laravel 5.3 项目中使用 composer 来安装 phpdocumentor 以生成文档。我正在使用带有 ubuntu16.04 的 linux 机器,我的 php 版本是 7.0。我收到以下错误

问题是 laravel 需要 3.1 以上的 symfony/translation 版本,即^3.1.*phpdocumentor/phpdocumentor 仅在 2.8.9 之前支持 symfony/translation。

那么如果我想安装 phpdocumentor 和 laravel5.3 怎么办?

0 投票
1 回答
406 浏览

php - PHPDocumentor `-d` 导致文档为空,但 `-f` 按预期工作

  • 我在名为 src 的文件夹中有我的 PHP 代码。
  • 该 src 文件夹位于名为 lib 的文件夹中。
  • 我的文档将在 lib/docs 中。
  • 因此,src 和 lib 都位于同一个文件夹中。

现在,当我生成文档时:

  • 我试过了:php phpDocumentor.phar -f ../pdk/Something.php它工作正常!
  • 我试过了:php phpDocumentor.phar -d ../pdk但它不起作用,文档已生成但它是空的。甚至Something.php 都没有生成它的文档。
0 投票
1 回答
6602 浏览

php - Optional nullable parameters in PHPDoc

Imagine that we have method with optional nullable argument (PHP 7.0) like in this example:

Unfortunately it's not clear from the PHPDoc documentation, what is the right way to mark the second argument optional and nullable.

Typically I use "Type2|null" notation:

Actually this is my preferable way, because it explicitly describes all the possible types. But I heard complaints that is not obvious from the doc if the parameter is optional or not.

I'm aware of, seams like, unofficial convention "(optional)"

I don't like this approach, because, technically, you can explicitly provide NULL as a second argument. And it's not clear from the phpdoc.

Generally speaking, I can even use them together:

But it doesn't look nice, IMHO.

Could you provide me some feedback or, even better, some links to corresponding coding standards / style guides?

0 投票
1 回答
340 浏览

php - phpDocumentor 使用极低版本的 phpDocumentor Reflection Docblock 依赖问题

但是,当我执行时,我正在尝试安装的dev-master版本:phpdocumentor/phpdocumentor

我收到以下问题:

我的作曲家配置是:

我遇到的问题是我当前的phpdocumentor/reflection-docblock版本是4.3.0.

当我尝试执行此操作时:

然后我得到一个问题:

我不太确定如何解决这个依赖问题。我应该只下载源代码吗?

0 投票
1 回答
210 浏览

php - 有没有办法抑制 get 和 set 方法的“无摘要”

当使用具有良好命名属性的 php 类记录每个属性getset方法时,phpdoc 生成的错误报告充满了错误,例如:

方法 getFirstName()
没有摘要 方法 setFirstName( ) 没有摘要

对于每个属性。我正在使用默认模板。如果firstName已经记录在案:

为 get 和 set 方法提供摘要感觉是多余的。

有没有办法使用 phpDocumentor 中的现有标签之一来避免错误报告中出现“无摘要”?我无法开始@inheritdoc工作,因为这些方法没有覆盖其基类中的任何内容,或者在某些情况下将没有基类。

我查看了docblock 模板 /**#@+/**#@-*/标签,但无法让它们在一组封闭的方法中应用摘要。我只尝试了简短的摘要,也尝试了长摘要。

如果不是这样记录类的干方法是什么?

0 投票
0 回答
67 浏览

php - 内联类型注释的状态

多年来,我一直在使用Eclipse/Zend 类型注释来帮助编辑器的代码智能感知,而常规的 phpDocumentor 文档块还不够:

......但我不确定它们现在是否被广泛使用。

PHP-FIG在PSR-5 PHPDoc Standard的上下文中为这个特性提出了一个新的语法

…但是 PSR-5 被列为废弃并且据我所知 phpDocumentor还没有实现它

PhpStorm 只支持所有变体:

甚至 Zend Framework 代码库似乎都混合了它们。

是否有广泛使用的语法或接近事实标准的东西?是否在一些主要的 PHP 项目中进行过讨论?

0 投票
1 回答
70 浏览

phpdocumentor2 - How to change the file extension for phpdocumentor 2 twig writer

I'm trying to output markdown instead of html with a phpDocumentor 2 template. I am outputting markdown fine but not able to change the filename extension for classes.

The artifact makes sense when it's a single transformation. When query=indexes.classesis used how does it decide that the filename should be [class].html?

I've tried artifact="{CLASS}.md", artifact="{{CLASS}}.md", artifact=".md" but it always treats them literally.

<transformations> <transformation query="indexes.classes" writer="twig" source="templates/docsify-twig/class.md.twig" /> <transformation writer="twig" source="templates/responsive-twig/reports/markers.html.twig" artifact="markers.html"/> </transformations>

0 投票
0 回答
202 浏览

php - “@php_bin@”不是内部或外部命令、可运行程序或批处理文件

我正在使用http://phpdox.de/getting-started.html。尝试将其配置为生成我的项目的 API 文档。

我的 wamp 服务器和 php 安装在 C:\wamp64\bin\php\php7.2.14 文件夹中。

我想在 G:\website\pe-gold3\documentor\phpdox 文件夹中实现。

我已经从G:\website\pe-gold3\documentor\phpdox 文件夹中的https://github.com/theseer/phpdox下载了包。

下载 phpdox.phar 文件并将其粘贴到 G:\website\pe-gold3\documentor\phpdox 文件夹中。

创建的 composer.json 已经安装在 C:\wamp64\bin\php\php7.2.14 文件夹中。

在 G:\website\pe-gold3\documentor\phpdox 文件夹中创建了 phpdox.xml 文件。

尝试运行 phpdox 命令但它给出了给定的错误:'"@php_bin@"' 不是内部或外部命令、可运行程序或批处理文件。

请让我知道我应该如何配置它并获取我的项目的 api 文档。

0 投票
1 回答
760 浏览

php - 安装 phpdoc/phpDocumentor 包后无法运行 phpdoc 命令

虽然我按照说明安装 phpDocumentor,但命令行似乎没有响应phpdoc

给定错误: 找不到命令'phpdoc',你的意思是:来自deb phploc的命令'phploc'来自deb phpdox的命令'phpdox'尝试:sudo apt install

我按照这些步骤安装 phpdoc,它似乎工作

pear channel-discover pear.phpdoc.org

pear install phpdoc/phpDocumentor

安装完成后,我尝试运行 phpdoc -h 但它不起作用。

使用:7.2.16

操作系统:Ubuntu 18.04.2 LTS

我感谢任何尝试提供帮助。