Skip to content

Commit 8cec49b

Browse files
authored
Merge pull request #1872 from jim-parry/docs/config
Docs: fix phpdoc config
2 parents 1828637 + 057c4d1 commit 8cec49b

2 files changed

Lines changed: 81 additions & 5 deletions

File tree

contributing/styleguide.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,82 @@ Control Structures
247247
if ( $foo ) $bar += $baz;
248248
else $baz = 'bar';
249249

250+
Docblocks
251+
=========
252+
253+
We use phpDocumentor (phpdoc) to generate the API docs, for all of the source
254+
code inside the `system` folder.
255+
256+
It wants to see a file summary docblock at the top of a PHP file,
257+
before any PHP statements, and then a docblock before each documentable
258+
component, namely any class/interface/trait, and all public and protected
259+
methods/functions/variables. The docblock for a method or function
260+
is expected to describe the parameters, return value, and any exceptions
261+
thrown.
262+
263+
Deviations from the above are considered errors by phpdoc.
264+
265+
An example::
266+
267+
<?php
268+
269+
/**
270+
* CodeIgniter
271+
*
272+
* An open source application development framework for PHP
273+
*
274+
...
275+
*
276+
* @package CodeIgniter
277+
* @author CodeIgniter Dev Team
278+
* @copyright 2014-2019 British Columbia Institute of Technology (https://bcit.ca/)
279+
* @license https://opensource.org/licenses/MIT MIT License
280+
* @link https://codeigniter.com
281+
* @since Version 3.0.0
282+
* @filesource
283+
*/
284+
namespace CodeIgniter\Fruit;
285+
use CodeIgniter\Config\BaseConfig;
286+
287+
/**
288+
* Base class for entities in the CodeIgniter\Fruit module.
289+
*
290+
* @property $group
291+
* @property $name
292+
* @property $description
293+
*
294+
* @package CodeIgniter\Fruit
295+
*/
296+
abstract class BaseFruit
297+
{
298+
299+
/**
300+
* The group a fruit belongs to.
301+
*
302+
* @var string
303+
*/
304+
protected $group;
305+
306+
/**
307+
* Fruit constructor.
308+
*
309+
* @param BaseConfig $config
310+
*/
311+
public function __construct(BaseConfig $Config)
312+
{
313+
$this->group = 'Unknown';
314+
}
315+
316+
//--------------------------------------------------------------------
317+
318+
/**
319+
* Model a fruit ripening over time.
320+
*
321+
* @param array $params
322+
*/
323+
abstract public function ripen(array $params);
324+
}
325+
250326
Other
251327
=====
252328

phpdoc.dist.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
<target>api/build/</target>
99
</transformer>
1010
<files>
11-
<directory>./system</directory>
12-
<ignore>./vendor/*</ignore>
13-
<ignore>./tests/*</ignore>
11+
<directory>system</directory>
12+
<ignore>vendor/*</ignore>
13+
<ignore>tests/*</ignore>
1414
<ignore>Kint/*</ignore>
1515
</files>
1616

1717
<logging>
18-
<level>warn</level>
18+
<level>err</level>
1919
<paths>
2020
<default>api/log/{DATE}.log</default>
2121
<errors>api/{DATE}.errors.log</errors>
2222
</paths>
2323
</logging>
2424

2525
<transformations>
26-
<template name="responsive" />
26+
<template name="responsive-twig" />
2727
</transformations>
2828
</phpdoc>

0 commit comments

Comments
 (0)