Browse Source

added documentation about #5175

tags/2.0.0-rc
Carsten Brandt 10 years ago
parent
commit
6b353bb5df
  1. 1
      extensions/apidoc/helpers/ApiMarkdownTrait.php
  2. 15
      extensions/apidoc/models/TypeDoc.php

1
extensions/apidoc/helpers/ApiMarkdownTrait.php

@ -36,6 +36,7 @@ trait ApiMarkdownTrait
// Collection resolves relative types
$typeName = (new Collection([$typeName], $context->phpDocContext))->__toString();
}
/** @var $type TypeDoc */
$type = static::$renderer->apiContext->getType($typeName);
if ($type === null) {
static::$renderer->apiContext->errors[] = [

15
extensions/apidoc/models/TypeDoc.php

@ -37,6 +37,21 @@ class TypeDoc extends BaseDoc
public $namespace;
/**
* Finds subject (method or property) by name
*
* If there is a property with the same as a method, the method will be returned if the name is not stated
* explicitly by prefixing with `$`.
*
* Example for method `attributes()` and property `$attributes` which both may exist:
*
* - `$subjectName = '$attributes'` finds a property or nothing.
* - `$subjectName = 'attributes()'` finds a method or nothing.
* - `$subjectName = 'attributes'` finds the method if it exists, if not it will find the property.
*
* @param $subjectName
* @return null|MethodDoc|PropertyDoc
*/
public function findSubject($subjectName)
{
if ($subjectName[0] != '$') {

Loading…
Cancel
Save