Improve inline documentation and code style
parent
c962f81924
commit
6cb916e28d
|
@ -11,14 +11,52 @@ use PhpParser\NodeVisitor\NameResolver;
|
|||
|
||||
class PhpDocument
|
||||
{
|
||||
/**
|
||||
* The LanguageClient instance (to report errors etc)
|
||||
*
|
||||
* @var LanguageClient
|
||||
*/
|
||||
private $client;
|
||||
|
||||
/**
|
||||
* The Project this document belongs to (to register definitions etc)
|
||||
*
|
||||
* @var Project
|
||||
*/
|
||||
private $project;
|
||||
|
||||
/**
|
||||
* The PHPParser instance
|
||||
*
|
||||
* @var Parser
|
||||
*/
|
||||
private $parser;
|
||||
|
||||
/**
|
||||
* The URI of the document
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $uri;
|
||||
|
||||
/**
|
||||
* The content of the document
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $content;
|
||||
|
||||
/**
|
||||
* @var SymbolInformation[]
|
||||
*/
|
||||
private $symbols = [];
|
||||
|
||||
/**
|
||||
* @param string $uri The URI of the document
|
||||
* @param Project $project The Project this document belongs to (to register definitions etc)
|
||||
* @param LanguageClient $client The LanguageClient instance (to report errors etc)
|
||||
* @param Parser $parser The PHPParser instance
|
||||
*/
|
||||
public function __construct(string $uri, Project $project, LanguageClient $client, Parser $parser)
|
||||
{
|
||||
$this->uri = $uri;
|
||||
|
@ -54,6 +92,7 @@ class PhpDocument
|
|||
* Updates the content on this document.
|
||||
*
|
||||
* @param string $content
|
||||
* @return void
|
||||
*/
|
||||
public function updateContent(string $content)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ class Project
|
|||
* An associative array [string => PhpDocument]
|
||||
* that maps URIs to loaded PhpDocuments
|
||||
*
|
||||
* @var array
|
||||
* @var PhpDocument[]
|
||||
*/
|
||||
private $documents;
|
||||
|
||||
|
|
|
@ -28,6 +28,9 @@ class TextDocument
|
|||
*/
|
||||
private $client;
|
||||
|
||||
/**
|
||||
* @var Project
|
||||
*/
|
||||
private $project;
|
||||
|
||||
public function __construct(Project $project, LanguageClient $client)
|
||||
|
|
Loading…
Reference in New Issue