mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 18:13:13 +00:00
remove tests and validation that are now covered by typehints
This commit is contained in:
committed by
Jaap van Otterdijk
parent
76b771c23e
commit
193731a153
@@ -37,8 +37,6 @@ final class Author extends BaseTag implements Factory\StaticMethod
|
||||
*/
|
||||
public function __construct(string $authorName, string $authorEmail)
|
||||
{
|
||||
Assert::string($authorName);
|
||||
Assert::string($authorEmail);
|
||||
if ($authorEmail && !filter_var($authorEmail, FILTER_VALIDATE_EMAIL)) {
|
||||
throw new \InvalidArgumentException('The author tag does not have a valid e-mail address');
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ final class Covers extends BaseTag implements Factory\StaticMethod
|
||||
FqsenResolver $resolver = null,
|
||||
TypeContext $context = null
|
||||
) {
|
||||
Assert::string($body);
|
||||
Assert::notEmpty($body);
|
||||
|
||||
$parts = preg_split('/\s+/Su', $body, 2);
|
||||
|
||||
@@ -56,11 +56,10 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod
|
||||
* @return static
|
||||
*/
|
||||
public static function create(
|
||||
string $body,
|
||||
?string $body,
|
||||
DescriptionFactory $descriptionFactory = null,
|
||||
TypeContext $context = null
|
||||
) {
|
||||
Assert::nullOrString($body);
|
||||
if (empty($body)) {
|
||||
return new static();
|
||||
}
|
||||
@@ -82,17 +81,15 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod
|
||||
/**
|
||||
* Gets the version section of the tag.
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getVersion(): string
|
||||
public function getVersion()
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation for this tag.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
|
||||
@@ -53,7 +53,6 @@ class Generic extends BaseTag implements Factory\StaticMethod
|
||||
DescriptionFactory $descriptionFactory = null,
|
||||
TypeContext $context = null
|
||||
) {
|
||||
Assert::string($body);
|
||||
Assert::stringNotEmpty($name);
|
||||
Assert::notNull($descriptionFactory);
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ final class Link extends BaseTag implements Factory\StaticMethod
|
||||
*/
|
||||
public static function create(string $body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null)
|
||||
{
|
||||
Assert::string($body);
|
||||
Assert::notNull($descriptionFactory);
|
||||
|
||||
$parts = preg_split('/\s+/Su', $body, 2);
|
||||
|
||||
@@ -44,9 +44,6 @@ final class Param extends BaseTag implements Factory\StaticMethod
|
||||
*/
|
||||
public function __construct(string $variableName, Type $type = null, bool $isVariadic = false, Description $description = null)
|
||||
{
|
||||
Assert::string($variableName);
|
||||
Assert::boolean($isVariadic);
|
||||
|
||||
$this->variableName = $variableName;
|
||||
$this->type = $type;
|
||||
$this->isVariadic = $isVariadic;
|
||||
|
||||
@@ -40,8 +40,6 @@ class Property extends BaseTag implements Factory\StaticMethod
|
||||
*/
|
||||
public function __construct(string $variableName, Type $type = null, Description $description = null)
|
||||
{
|
||||
Assert::string($variableName);
|
||||
|
||||
$this->variableName = $variableName;
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
|
||||
@@ -40,8 +40,6 @@ class PropertyRead extends BaseTag implements Factory\StaticMethod
|
||||
*/
|
||||
public function __construct(string $variableName, Type $type = null, Description $description = null)
|
||||
{
|
||||
Assert::string($variableName);
|
||||
|
||||
$this->variableName = $variableName;
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
|
||||
@@ -40,8 +40,6 @@ class PropertyWrite extends BaseTag implements Factory\StaticMethod
|
||||
*/
|
||||
public function __construct(string $variableName, Type $type = null, Description $description = null)
|
||||
{
|
||||
Assert::string($variableName);
|
||||
|
||||
$this->variableName = $variableName;
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
|
||||
@@ -45,7 +45,6 @@ final class Return_ extends BaseTag implements Factory\StaticMethod
|
||||
DescriptionFactory $descriptionFactory = null,
|
||||
TypeContext $context = null
|
||||
) {
|
||||
Assert::string($body);
|
||||
Assert::allNotNull([$typeResolver, $descriptionFactory]);
|
||||
|
||||
$parts = preg_split('/\s+/Su', $body, 2);
|
||||
|
||||
@@ -52,7 +52,6 @@ class See extends BaseTag implements Factory\StaticMethod
|
||||
DescriptionFactory $descriptionFactory = null,
|
||||
TypeContext $context = null
|
||||
) {
|
||||
Assert::string($body);
|
||||
Assert::allNotNull([$resolver, $descriptionFactory]);
|
||||
|
||||
$parts = preg_split('/\s+/Su', $body, 2);
|
||||
|
||||
@@ -56,7 +56,7 @@ final class Since extends BaseTag implements Factory\StaticMethod
|
||||
* @return static
|
||||
*/
|
||||
public static function create(
|
||||
string $body,
|
||||
?string $body,
|
||||
DescriptionFactory $descriptionFactory = null,
|
||||
TypeContext $context = null
|
||||
) {
|
||||
@@ -78,10 +78,8 @@ final class Since extends BaseTag implements Factory\StaticMethod
|
||||
|
||||
/**
|
||||
* Gets the version section of the tag.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion(): string
|
||||
public function getVersion(): ?string
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ final class Throws extends BaseTag implements Factory\StaticMethod
|
||||
DescriptionFactory $descriptionFactory = null,
|
||||
TypeContext $context = null
|
||||
) {
|
||||
Assert::string($body);
|
||||
Assert::allNotNull([$typeResolver, $descriptionFactory]);
|
||||
|
||||
$parts = preg_split('/\s+/Su', $body, 2);
|
||||
|
||||
@@ -50,7 +50,6 @@ final class Uses extends BaseTag implements Factory\StaticMethod
|
||||
DescriptionFactory $descriptionFactory = null,
|
||||
TypeContext $context = null
|
||||
) {
|
||||
Assert::string($body);
|
||||
Assert::allNotNull([$resolver, $descriptionFactory]);
|
||||
|
||||
$parts = preg_split('/\s+/Su', $body, 2);
|
||||
|
||||
@@ -40,8 +40,6 @@ class Var_ extends BaseTag implements Factory\StaticMethod
|
||||
*/
|
||||
public function __construct(string $variableName, Type $type = null, Description $description = null)
|
||||
{
|
||||
Assert::string($variableName);
|
||||
|
||||
$this->variableName = $variableName;
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
|
||||
@@ -56,11 +56,10 @@ final class Version extends BaseTag implements Factory\StaticMethod
|
||||
* @return static
|
||||
*/
|
||||
public static function create(
|
||||
string $body,
|
||||
?string $body,
|
||||
DescriptionFactory $descriptionFactory = null,
|
||||
TypeContext $context = null
|
||||
) {
|
||||
Assert::nullOrString($body);
|
||||
if (empty($body)) {
|
||||
return new static();
|
||||
}
|
||||
@@ -78,10 +77,8 @@ final class Version extends BaseTag implements Factory\StaticMethod
|
||||
|
||||
/**
|
||||
* Gets the version section of the tag.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion(): string
|
||||
public function getVersion(): ?string
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user