1
0
Fork 0

Improve inline documentation and code style

pull/53/head
Felix Becker 2016-10-08 12:51:55 +02:00
parent c962f81924
commit 6cb916e28d
3 changed files with 45 additions and 3 deletions

View File

@ -11,14 +11,52 @@ use PhpParser\NodeVisitor\NameResolver;
class PhpDocument class PhpDocument
{ {
/**
* The LanguageClient instance (to report errors etc)
*
* @var LanguageClient
*/
private $client; private $client;
/**
* The Project this document belongs to (to register definitions etc)
*
* @var Project
*/
private $project; private $project;
/**
* The PHPParser instance
*
* @var Parser
*/
private $parser; private $parser;
/**
* The URI of the document
*
* @var string
*/
private $uri; private $uri;
/**
* The content of the document
*
* @var string
*/
private $content; private $content;
/**
* @var SymbolInformation[]
*/
private $symbols = []; 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) public function __construct(string $uri, Project $project, LanguageClient $client, Parser $parser)
{ {
$this->uri = $uri; $this->uri = $uri;
@ -54,6 +92,7 @@ class PhpDocument
* Updates the content on this document. * Updates the content on this document.
* *
* @param string $content * @param string $content
* @return void
*/ */
public function updateContent(string $content) public function updateContent(string $content)
{ {

View File

@ -13,7 +13,7 @@ class Project
* An associative array [string => PhpDocument] * An associative array [string => PhpDocument]
* that maps URIs to loaded PhpDocuments * that maps URIs to loaded PhpDocuments
* *
* @var array * @var PhpDocument[]
*/ */
private $documents; private $documents;

View File

@ -28,6 +28,9 @@ class TextDocument
*/ */
private $client; private $client;
/**
* @var Project
*/
private $project; private $project;
public function __construct(Project $project, LanguageClient $client) public function __construct(Project $project, LanguageClient $client)