我正在尝试在我的WAMPServer设置上运行PHPDocumentor.它运行正常,但我想排除某些目录,例如\ sqlbuddy \,它不包含我自己的代码.具有讽刺意味的是,PHPDocumentor似乎忽略了我的--ignore开关.我尝试了几种表达相同方法的方法,但结果相同.下面是我运行它的命令:
php.exe "C:\Users\username\Documents\PhpDocumentor\phpdoc" -t "C:\Program Files\wamp\www\docs" -o HTML:default:default -d "C:\Program Files\wamp\www" --ignore sqlbuddy\ --ignore docs\
Run Code Online (Sandbox Code Playgroud)
非常感谢.
我想知道如何在phpdoc评论中逃避phpdoc评论.
例如,我怎么写这个:
/**
* Some documentation...
*
* <code>
* /**
* * Example example phpdoc.
* */
* </code>
*/
Run Code Online (Sandbox Code Playgroud)
显然上面的例子不起作用.
我尝试用*替换星号,但它会很好地打印"*"......
如何记录可变数量的参数?我正在用PHP和JavaScript编写应用程序.目前我有(在JavaScript中):
/**
* Description
* @param {String} description
*/
function fn()
{
// arguments holds all strings.
}
Run Code Online (Sandbox Code Playgroud)
那么,我该如何编写n个字符串参数?
我想知道是否有办法强制phpDocumentor打印出你可以用来获取和设置动态的方法__call().
在我的简单getter的情况下,我希望它循环遍历所有私有变量并只是附加get到它们(当然,大写第一个字母).
我已切换到PHP 5.3和名称空间。看来@package标记现在是多余且无用的。
phpDoc是否仍然需要它,或者我现在可以忽略该标签吗?
谢谢
想象一下以下假设的类结构,而不是一个非常罕见的场景,所有PHPdoc提示设置正确:
class BaseFilter {
/** ...base methods... */
}
class TextFilter extends BaseFilter {
public function setMinLength($len)
{
/** ...irrelevant */
}
}
class SomethingWithFilters
{
/**
* @param BaseFilter $filter A valid filter to be added.
* @return BaseFilter The filter that was added for easy chaining
*/
public function addFilter(BaseFilter $filter)
{
$this->filters[] = $filter;
return $filter;
}
/** @var BaseFilter[] A list of filters */
private $filters = [];
}
Run Code Online (Sandbox Code Playgroud)
现在我使用以下代码:
$myClass = new SomethingWithFilters();
$myClass->addFilter(new TextFilter())->setMinLength(8); …Run Code Online (Sandbox Code Playgroud) 我有一个类,该类在如下方法中包含文件:
在class.php文件中:
class A {
const CONST1 = 5;
/** @var int $a */
var $a = 5;
public function call()
{
include( 'b.php' );
}
public function do_some_magic()
{
// magic stuff...
}
public static function static_func()
{
// some code...
}
}
Run Code Online (Sandbox Code Playgroud)
文件b.php:
<?php
/** @var A $this */
/** @var A self */ // This doesn't work
$this->do_some_magic();
echo '['.$this->a.']';
self::static_func();
echo '['.self::CONST1.']';
Run Code Online (Sandbox Code Playgroud)
我将PhpStorm用作IDE,并在b.php文件中使用,如果要转到变量的定义do_some_magic()或定义,a它将正确地转到文件中的相应方法或变量定义class.php,但是如果要转到常量CONST1的定义或静态方法的定义,static_func() …
我试图让PHPDocumentor在本地XAMPP安装上运行.可悲的是,我很难使用包管理器来完成它.关于包管理器的一些基本问题首先:
我如何知道安装包的位置?例如:我使用Composer安装了PHPDocumentor.我转到我的C:\ xampp\htdocs \并运行命令:
作曲家需要"phpdocumentor/phpdocumentor:2.*"
这将phpdocumentor安装在xampp\htdocs \中的"vendor"文件夹中
如果我想卸载软件包,我只需删除"供应商"目录吗?
无法找到
dotGraphViz包的命令.GraphViz是否已正确安装并存在于您的路径中?
为了解决这个问题,我尝试了以下方法:
当我的指针位于htdocs文件夹中并指向文件夹的路径时,安装了包图/ graphviz:
C:\xampp\htdocs\vendor\graph\graphviz
...graph\graphviz\src
...graph\graphviz\tests
Run Code Online (Sandbox Code Playgroud)
以上都没有解决问题.根据这个链接,我必须将\ graphiz\bin目录添加到路径,但是没有"bin"目录?
任何人都可以帮我解决这个问题吗?
最好的问候,Abayob
将匿名函数作为参数传递时,应如何记录它?例如:
// Call my_function(), passing 2 arguments.
my_function( 'foo', function() {
// Body of the anon function I'd like to document.
} );
Run Code Online (Sandbox Code Playgroud)
提前致谢。
我正在使用Closure::call(http://php.net/manual/en/closure.call.php)在类上下文中调用外部闭包.
这是一个简单的复制品:
class Foo {
private $bar = 'baz';
/**
* Executes a closure in $this context and returns whatever the closure returns.
*
* @param \Closure $closure
* @return mixed
*/
public function callClosureInThisContext(\Closure $closure) {
return $closure->call($this);
}
}
class Closures {
/**
* @return \Closure
*/
public function getClosureForFoo() : \Closure {
return function () {
// how do I tell my IDE that in this context $this is actually class Foo,
// …Run Code Online (Sandbox Code Playgroud) phpdoc ×10
php ×8
phpstorm ×2
closures ×1
dynamic ×1
graphviz ×1
ide ×1
javascript ×1
jsdoc ×1
late-binding ×1
namespaces ×1
php-5.3 ×1
polymorphism ×1