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

8
namespace yii\apidoc\models;
9 10 11 12 13 14 15 16 17 18 19 20 21

/**
 * Class ClassDoc
 */
class ClassDoc extends BaseDoc
{
	public $parentClass;

	public $isAbstract;
	public $isFinal;

	public $interfaces = [];
	public $traits = [];
22 23
	// will be set by Context::updateReferences()
	public $subclasses = [];
24

25
	// TODO
26 27 28 29 30 31 32 33 34 35
	public $properties = [];
	public $methods = [];
	public $events = [];
	public $constants = [];


	/**
	 * @param \phpDocumentor\Reflection\ClassReflector $reflector
	 * @param array $config
	 */
36
	public function __construct($reflector, $config = [])
37
	{
38
		parent::__construct($reflector, $config);
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58

		$this->parentClass = ltrim($reflector->getParentClass(), '\\');
		if (empty($this->parentClass)) {
			$this->parentClass = null;
		}
		$this->isAbstract = $reflector->isAbstract();
		$this->isFinal = $reflector->isFinal();

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

		// TODO methods

		// TODO properties
	}
}