Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline reference {@see mymethod()} is not correctly resolved to FQSEN #1980

Open
oschildt opened this issue May 14, 2018 · 1 comment
Open
Milestone

Comments

@oschildt
Copy link

oschildt commented May 14, 2018

Description:

Inline reference {@see mymethod()} is not correctly resolved to FQSEN. When using @see as the tag, it is OK.

  • Version used: master-dev
  • Install method: composer
  • php version: 7.2
  • Operating system and version: Windows 10

Use this code and generate the doc using clean template:

<?php
/**
 * This file contains the implementation of the interface IRecordsetManager 
 * in the class RecordsetManager for working with record sets.
 *
 * @package Database
 */
 
namespace SmartFactory;

use SmartFactory\Interfaces\IRecordsetManager;
use SmartFactory\DatabaseWorkers\DBWorker;

/**
 * Class for working with record sets.
 */
class RecordsetManager implements IRecordsetManager
{
  /**
   * This is internal auxiliary function for saving a record set from an array
   * with key field values as array dimensions.
   *
   * It expand this multidimensional
   * array into the set of flat records suitable for call {@see saveRecord()}.
   *
   * @return boolean
   * Returns true if the subarray has been processed successfully, otherwise false.
   *
   * @see saveRecord()
   */
  protected function process_subarray()
  {
    return true;
  } // process_subarray

  /**
   * Saves a record from an array in the form "field_name" => "value" into the table.
   *
   * @return boolean
   * Returns true if the record has been successfully saved, otherwise false.
   */
  public function saveRecord()
  {
    return true;
  } // saveRecord
} // RecordsetManager

Expected Behavior

There is the doc block for the method process_subarray(). This block contains the reference @see saveRecord() - both as inline one and as a separate tag.

Both references should be resolved as:

\SmartFactory\RecordsetManager::saveRecord()

Actual Behavior

The tag reference @see saveRecord() is correctly resolved as:

\SmartFactory\RecordsetManager::saveRecord()

The inline reference {@see saveRecord()} is resolved wrong as:

\SmartFactory\saveRecord().

@oschildt oschildt changed the title Inline reference (@see mymethod()) is not correctly resolved to FQSEN Inline reference {@see mymethod()} is not correctly resolved to FQSEN May 14, 2018
@jaapio
Copy link
Member

jaapio commented Jun 12, 2018

I think this behavior is as intented. when you want to reference the current class you will need to add @see self::mymethod other wise phpdocumentor will assume that there is a function mymethod in your namespace. Since we are processing each file separate we cannot detect if this is really the case.

@ashnazg I'm missing this description in psr-5. Should we add that?

@jaapio jaapio added this to the PSR milestone Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants