相关疑难解决方法(0)

PHPDoc用于可变长度的参数数组

是否有一种语法来记录采用单个配置数组的函数,而不是单个参数?

我正在考虑CodeIgniter样式的库,它使用类似于此的机制:

<?php

//
// Library definition
//

class MyLibrary {
  var $foo;
  var $bar;
  var $baz;
  // ... and many more vars...


  /* Following is how CodeIgniter documents their built-in libraries,
   * which is mostly useless.  AFAIK they should be specifying a name
   * and description for their @param (which they don't) and omitting
   * @return for constructors 
   */

  /** 
   * @access public
   * @param array
   * @return void
   */
  function MyLibrary($config = array()) {
    foreach ($config as $key …
Run Code Online (Sandbox Code Playgroud)

php comments codeigniter phpdoc

11
推荐指数
1
解决办法
7007
查看次数

PHPStorm + PHPdoc - 我可以输入提示单个数组元素吗?

我有:

$myarr['DB'] = new DB();
$myarr['config'] = new config();
Run Code Online (Sandbox Code Playgroud)

我可以以某种方式让PHPStorm知道究竟是什么内部的钥匙?现在我只看到变量和类属性,但不是数组键.

php phpdoc phpstorm

9
推荐指数
1
解决办法
4026
查看次数

标签 统计

php ×2

phpdoc ×2

codeigniter ×1

comments ×1

phpstorm ×1