Add PHPStan and bump to max level (#139)

* composer: put require- together

* add phpstan

* add phpstan to travis

* phpstan fixes

* phpstan fixes

* phpstan fixes

* drop null defaults since every property is null by default

* DescriptionFactory: fix parse nullable type

* travis: add phpstan max

* travis: fix phpstan config
This commit is contained in:
Tomáš Votruba
2017-12-02 19:12:29 +01:00
committed by Jaap van Otterdijk
parent c19b4d170c
commit bab88701ea
22 changed files with 1028 additions and 41 deletions
+7 -7
View File
@@ -22,16 +22,16 @@ final class DocBlock
private $summary = '';
/** @var DocBlock\Description The actual description for this docblock. */
private $description = null;
private $description;
/** @var Tag[] An array containing all the tags in this docblock; except inline. */
private $tags = [];
/** @var Types\Context Information about the context of this DocBlock. */
private $context = null;
/** @var Types\Context|null Information about the context of this DocBlock. */
private $context;
/** @var Location Information about the location of this DocBlock. */
private $location = null;
/** @var Location|null Information about the location of this DocBlock. */
private $location;
/** @var bool Is this DocBlock (the start of) a template? */
private $isTemplateStart = false;
@@ -81,7 +81,7 @@ final class DocBlock
/**
* Returns the current context.
*/
public function getContext(): Types\Context
public function getContext(): ?Types\Context
{
return $this->context;
}
@@ -182,7 +182,7 @@ final class DocBlock
/**
* Remove a tag from this DocBlock.
*
* @param Tag $tag The tag to remove.
* @param Tag $tagToRemove The tag to remove.
*/
public function removeTag(Tag $tagToRemove): void
{