Skip to content

Commit 193731a

Browse files
TomasVotrubajaapio
authored andcommitted
remove tests and validation that are now covered by typehints
1 parent 76b771c commit 193731a

37 files changed

+79
-380
lines changed

src/DocBlock.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,8 @@ public function getContext(): Types\Context
102102

103103
/**
104104
* Returns the current location.
105-
*
106-
* @return Location
107105
*/
108-
public function getLocation(): Location
106+
public function getLocation(): ?Location
109107
{
110108
return $this->location;
111109
}

src/DocBlock/Tags/Author.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ final class Author extends BaseTag implements Factory\StaticMethod
3737
*/
3838
public function __construct(string $authorName, string $authorEmail)
3939
{
40-
Assert::string($authorName);
41-
Assert::string($authorEmail);
4240
if ($authorEmail && !filter_var($authorEmail, FILTER_VALIDATE_EMAIL)) {
4341
throw new \InvalidArgumentException('The author tag does not have a valid e-mail address');
4442
}

src/DocBlock/Tags/Covers.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public static function create(
5050
FqsenResolver $resolver = null,
5151
TypeContext $context = null
5252
) {
53-
Assert::string($body);
5453
Assert::notEmpty($body);
5554

5655
$parts = preg_split('/\s+/Su', $body, 2);

src/DocBlock/Tags/Deprecated.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ public function __construct($version = null, Description $description = null)
5656
* @return static
5757
*/
5858
public static function create(
59-
string $body,
59+
?string $body,
6060
DescriptionFactory $descriptionFactory = null,
6161
TypeContext $context = null
6262
) {
63-
Assert::nullOrString($body);
6463
if (empty($body)) {
6564
return new static();
6665
}
@@ -82,17 +81,15 @@ public static function create(
8281
/**
8382
* Gets the version section of the tag.
8483
*
85-
* @return string
84+
* @return string|null
8685
*/
87-
public function getVersion(): string
86+
public function getVersion()
8887
{
8988
return $this->version;
9089
}
9190

9291
/**
9392
* Returns a string representation for this tag.
94-
*
95-
* @return string
9693
*/
9794
public function __toString(): string
9895
{

src/DocBlock/Tags/Generic.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public static function create(
5353
DescriptionFactory $descriptionFactory = null,
5454
TypeContext $context = null
5555
) {
56-
Assert::string($body);
5756
Assert::stringNotEmpty($name);
5857
Assert::notNull($descriptionFactory);
5958

src/DocBlock/Tags/Link.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public function __construct(string $link, Description $description = null)
4646
*/
4747
public static function create(string $body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null)
4848
{
49-
Assert::string($body);
5049
Assert::notNull($descriptionFactory);
5150

5251
$parts = preg_split('/\s+/Su', $body, 2);

src/DocBlock/Tags/Param.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ final class Param extends BaseTag implements Factory\StaticMethod
4444
*/
4545
public function __construct(string $variableName, Type $type = null, bool $isVariadic = false, Description $description = null)
4646
{
47-
Assert::string($variableName);
48-
Assert::boolean($isVariadic);
49-
5047
$this->variableName = $variableName;
5148
$this->type = $type;
5249
$this->isVariadic = $isVariadic;

src/DocBlock/Tags/Property.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class Property extends BaseTag implements Factory\StaticMethod
4040
*/
4141
public function __construct(string $variableName, Type $type = null, Description $description = null)
4242
{
43-
Assert::string($variableName);
44-
4543
$this->variableName = $variableName;
4644
$this->type = $type;
4745
$this->description = $description;

src/DocBlock/Tags/PropertyRead.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class PropertyRead extends BaseTag implements Factory\StaticMethod
4040
*/
4141
public function __construct(string $variableName, Type $type = null, Description $description = null)
4242
{
43-
Assert::string($variableName);
44-
4543
$this->variableName = $variableName;
4644
$this->type = $type;
4745
$this->description = $description;

src/DocBlock/Tags/PropertyWrite.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class PropertyWrite extends BaseTag implements Factory\StaticMethod
4040
*/
4141
public function __construct(string $variableName, Type $type = null, Description $description = null)
4242
{
43-
Assert::string($variableName);
44-
4543
$this->variableName = $variableName;
4644
$this->type = $type;
4745
$this->description = $description;

0 commit comments

Comments
 (0)