InterfaceDoc.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\apidoc\models;
  8. /**
  9. * Represents API documentation information for an `interface`.
  10. *
  11. * @author Carsten Brandt <mail@cebe.cc>
  12. * @since 2.0
  13. */
  14. class InterfaceDoc extends TypeDoc
  15. {
  16. public $parentInterfaces = [];
  17. // will be set by Context::updateReferences()
  18. public $implementedBy = [];
  19. /**
  20. * @param \phpDocumentor\Reflection\InterfaceReflector $reflector
  21. * @param Context $context
  22. * @param array $config
  23. */
  24. public function __construct($reflector = null, $context = null, $config = [])
  25. {
  26. parent::__construct($reflector, $context, $config);
  27. if ($reflector === null) {
  28. return;
  29. }
  30. foreach ($reflector->getParentInterfaces() as $interface) {
  31. $this->parentInterfaces[] = ltrim($interface, '\\');
  32. }
  33. foreach ($this->methods as $method) {
  34. $method->isAbstract = true;
  35. }
  36. // interface can not have properties
  37. $this->properties = null;
  38. }
  39. }