TraitDoc.php 634 Bytes
Newer Older
1 2
<?php
/**
3 4 5
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
6 7
 */

8
namespace yii\apidoc\models;
9

10
class TraitDoc extends TypeDoc
11 12
{
	// classes using the trait
13 14
	// will be set by Context::updateReferences()
	public $usedBy = [];
15 16 17 18 19 20 21

	public $traits = [];

	/**
	 * @param \phpDocumentor\Reflection\TraitReflector $reflector
	 * @param array $config
	 */
22
	public function __construct($reflector, $config = [])
23
	{
24
		parent::__construct($reflector, $config);
25 26 27 28 29 30

		foreach($reflector->getTraits() as $trait) {
			$this->traits[] = ltrim($trait, '\\');
		}
	}
}