diff --git a/resources/examples/Showtimes/Representations/Movie.php b/resources/examples/Showtimes/Representations/Movie.php index 8486876..ec8f869 100644 --- a/resources/examples/Showtimes/Representations/Movie.php +++ b/resources/examples/Showtimes/Representations/Movie.php @@ -86,7 +86,7 @@ public function create() /** * @api-data external_urls (object) - External URLs * @api-version >=1.1 - * @api-see \Mill\Examples\Showtimes\Representations\Movie::getExternalUrls external_urls + * @api-see self::getExternalUrls external_urls */ 'external_urls' => $this->getExternalUrls(), diff --git a/src/Config.php b/src/Config.php index 657e9b4..23aa0e9 100644 --- a/src/Config.php +++ b/src/Config.php @@ -923,6 +923,7 @@ public function doesErrorRepresentationNeedAnErrorCode($representation) */ private function getClassFQNFromFile($file) { + /** @var resource $fp */ $fp = fopen($file, 'r'); $class = $namespace = $buffer = ''; $i = 0; diff --git a/src/Parser/Representation/RepresentationParser.php b/src/Parser/Representation/RepresentationParser.php index 991b072..b245a1c 100644 --- a/src/Parser/Representation/RepresentationParser.php +++ b/src/Parser/Representation/RepresentationParser.php @@ -110,6 +110,10 @@ public function parseAnnotations(array $tags, $original_content) // If we matched an `@api-see` annotation, then let's parse it out into viable annotations. if (!empty($has_see)) { list($see_class, $see_method) = explode('::', array_shift($has_see)); + if (in_array(strtolower($see_class), ['self', 'static'])) { + $see_class = $this->class; + } + $prefix = array_shift($has_see); $parser = new self($see_class); diff --git a/tests/_fixtures/Representations/RepresentationWithOnlyApiSee.php b/tests/_fixtures/Representations/RepresentationWithOnlyApiSee.php index 85a2f3f..00a077d 100644 --- a/tests/_fixtures/Representations/RepresentationWithOnlyApiSee.php +++ b/tests/_fixtures/Representations/RepresentationWithOnlyApiSee.php @@ -1,6 +1,8 @@ create(); } }