相关疑难解决方法(0)

在PHPDoc中记录数组选项的最佳方法?

我正在努力编写可读且易于理解的文档,该文档描述了传递给函数的Array选项的多树结构.

这是一个示例数组结构.

$arr = [
   'fields' => [
       'title' => [
           'name'     => 'Document.title',
           'format'   => 'string',
           'readonly' => true
       ]
   ]
];
Run Code Online (Sandbox Code Playgroud)

上述数组有许多可能的选项,但这用作理解该结构的函数的参数.

function doSomething(array $arr) { ... }
Run Code Online (Sandbox Code Playgroud)

我想记录如何在PHPDoc中构建数组,但我不确定正确的方法是什么.

这就是我现在拥有的.

/**
 * Holds configuration settings for each field in a model.
 * Defining the field options
 *
 * array['fields'] array Defines the feilds to be shown by scaffolding.
 * array['fields'][fieldName] array Defines the options for a field, or just enables the field if array is not applied.
 * …
Run Code Online (Sandbox Code Playgroud)

php cakephp phpdoc

49
推荐指数
6
解决办法
5万
查看次数

标签 统计

cakephp ×1

php ×1

phpdoc ×1