add PHP 7.1 typehints

This commit is contained in:
TomasVotruba
2017-11-30 10:27:01 +01:00
committed by Jaap van Otterdijk
parent f9d1a0c177
commit 4a9675841b
64 changed files with 410 additions and 430 deletions
+5 -8
View File
@@ -46,10 +46,10 @@ final class DocBlock
*/ */
public function __construct( public function __construct(
string $summary = '', string $summary = '',
DocBlock\Description $description = null, ?DocBlock\Description $description = null,
array $tags = [], array $tags = [],
Types\Context $context = null, ?Types\Context $context = null,
Location $location = null, ?Location $location = null,
bool $isTemplateStart = false, bool $isTemplateStart = false,
bool $isTemplateEnd = false bool $isTemplateEnd = false
) { ) {
@@ -84,7 +84,6 @@ final class DocBlock
/** /**
* Returns the current context. * Returns the current context.
* *
* @return Types\Context
*/ */
public function getContext(): Types\Context public function getContext(): Types\Context
{ {
@@ -118,7 +117,6 @@ final class DocBlock
* *
* @see self::isTemplateEnd() for the check whether a closing marker was provided. * @see self::isTemplateEnd() for the check whether a closing marker was provided.
* *
* @return boolean
*/ */
public function isTemplateStart(): bool public function isTemplateStart(): bool
{ {
@@ -130,7 +128,6 @@ final class DocBlock
* *
* @see self::isTemplateStart() for a more complete description of the Docblock Template functionality. * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality.
* *
* @return boolean
*/ */
public function isTemplateEnd(): bool public function isTemplateEnd(): bool
{ {
@@ -193,7 +190,7 @@ final class DocBlock
* *
* @param Tag $tag The tag to remove. * @param Tag $tag The tag to remove.
*/ */
public function removeTag(Tag $tagToRemove) public function removeTag(Tag $tagToRemove): void
{ {
foreach ($this->tags as $key => $tag) { foreach ($this->tags as $key => $tag) {
if ($tag === $tagToRemove) { if ($tag === $tagToRemove) {
@@ -208,7 +205,7 @@ final class DocBlock
* *
* @param Tag $tag The tag to add. * @param Tag $tag The tag to add.
*/ */
private function addTag(Tag $tag) private function addTag(Tag $tag): void
{ {
$this->tags[] = $tag; $this->tags[] = $tag;
} }
+1 -1
View File
@@ -81,7 +81,7 @@ class Description
* Renders this description as a string where the provided formatter will format the tags in the expected string * Renders this description as a string where the provided formatter will format the tags in the expected string
* format. * format.
*/ */
public function render(Formatter $formatter = null): string public function render(?Formatter $formatter = null): string
{ {
if ($formatter === null) { if ($formatter === null) {
$formatter = new PassthroughFormatter(); $formatter = new PassthroughFormatter();
+2 -3
View File
@@ -49,11 +49,10 @@ class DescriptionFactory
* Returns the parsed text of this description. * Returns the parsed text of this description.
* *
* *
* @return Description
*/ */
public function create(string $contents, TypeContext $context = null): Description public function create(string $contents, ?TypeContext $context = null): Description
{ {
list($text, $tags) = $this->parse($this->lex($contents), $context); [$text, $tags] = $this->parse($this->lex($contents), $context);
return new Description($text, $tags); return new Description($text, $tags);
} }
+3 -4
View File
@@ -44,7 +44,7 @@ class ExampleFinder
/** /**
* Registers the project's root directory where an 'examples' folder can be expected. * Registers the project's root directory where an 'examples' folder can be expected.
*/ */
public function setSourceDirectory(string $directory = '') public function setSourceDirectory(string $directory = ''): void
{ {
$this->sourceDirectory = $directory; $this->sourceDirectory = $directory;
} }
@@ -62,7 +62,7 @@ class ExampleFinder
* *
* @param string[] $directories * @param string[] $directories
*/ */
public function setExampleDirectories(array $directories) public function setExampleDirectories(array $directories): void
{ {
$this->exampleDirectories = $directories; $this->exampleDirectories = $directories;
} }
@@ -89,9 +89,8 @@ class ExampleFinder
* 4. Checks the path relative to the current working directory for the given filename * 4. Checks the path relative to the current working directory for the given filename
* *
* *
* @return string|null
*/ */
private function getExampleFileContents(string $filename) private function getExampleFileContents(string $filename): ?string
{ {
$normalizedPath = null; $normalizedPath = null;
+8 -9
View File
@@ -39,7 +39,7 @@ use Webmozart\Assert\Assert;
final class StandardTagFactory implements TagFactory final class StandardTagFactory implements TagFactory
{ {
/** PCRE regular expression matching a tag name. */ /** PCRE regular expression matching a tag name. */
const REGEX_TAGNAME = '[\w\-\_\\\\]+'; public const REGEX_TAGNAME = '[\w\-\_\\\\]+';
/** /**
* @var string[] An array with a tag as a key, and an FQCN to a class that handles it as an array value. * @var string[] An array with a tag as a key, and an FQCN to a class that handles it as an array value.
@@ -92,7 +92,7 @@ final class StandardTagFactory implements TagFactory
* *
* @see self::registerTagHandler() to add a new tag handler to the existing default list. * @see self::registerTagHandler() to add a new tag handler to the existing default list.
*/ */
public function __construct(FqsenResolver $fqsenResolver, array $tagHandlers = null) public function __construct(FqsenResolver $fqsenResolver, ?array $tagHandlers = null)
{ {
$this->fqsenResolver = $fqsenResolver; $this->fqsenResolver = $fqsenResolver;
if ($tagHandlers !== null) { if ($tagHandlers !== null) {
@@ -105,13 +105,13 @@ final class StandardTagFactory implements TagFactory
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function create(string $tagLine, TypeContext $context = null): Tag public function create(string $tagLine, ?TypeContext $context = null): Tag
{ {
if (! $context) { if (! $context) {
$context = new TypeContext(''); $context = new TypeContext('');
} }
list($tagName, $tagBody) = $this->extractTagParts($tagLine); [$tagName, $tagBody] = $this->extractTagParts($tagLine);
if ($tagBody !== '' && $tagBody[0] === '[') { if ($tagBody !== '' && $tagBody[0] === '[') {
throw new \InvalidArgumentException( throw new \InvalidArgumentException(
@@ -125,7 +125,7 @@ final class StandardTagFactory implements TagFactory
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function addParameter(string $name, $value) public function addParameter(string $name, $value): void
{ {
$this->serviceLocator[$name] = $value; $this->serviceLocator[$name] = $value;
} }
@@ -133,7 +133,7 @@ final class StandardTagFactory implements TagFactory
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function addService($service, $alias = null) public function addService($service, $alias = null): void
{ {
$this->serviceLocator[$alias ?: get_class($service)] = $service; $this->serviceLocator[$alias ?: get_class($service)] = $service;
} }
@@ -141,7 +141,7 @@ final class StandardTagFactory implements TagFactory
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function registerTagHandler(string $tagName, string $handler) public function registerTagHandler(string $tagName, string $handler): void
{ {
Assert::stringNotEmpty($tagName); Assert::stringNotEmpty($tagName);
Assert::stringNotEmpty($handler); Assert::stringNotEmpty($handler);
@@ -184,9 +184,8 @@ final class StandardTagFactory implements TagFactory
* body was invalid. * body was invalid.
* *
* *
* @return Tag|null
*/ */
private function createTag(string $body, string $name, TypeContext $context) private function createTag(string $body, string $name, TypeContext $context): ?Tag
{ {
$handlerClassName = $this->findHandlerClassName($name, $context); $handlerClassName = $this->findHandlerClassName($name, $context);
$arguments = $this->getArgumentsForParametersFromWiring( $arguments = $this->getArgumentsForParametersFromWiring(
+6 -3
View File
@@ -17,11 +17,14 @@ use phpDocumentor\Reflection\DocBlock\Tags\Formatter;
interface Tag interface Tag
{ {
public function getName(); public function getName(): string;
/**
* @return Tag Class that implements Tag
*/
public static function create(string $body); public static function create(string $body);
public function render(Formatter $formatter = null); public function render(?Formatter $formatter = null): string;
public function __toString(); public function __toString(): string;
} }
+4 -5
View File
@@ -35,10 +35,9 @@ interface TagFactory
* *
* These parameters are injected at the last moment and will override any existing parameter with those names. * These parameters are injected at the last moment and will override any existing parameter with those names.
* *
* @param string $name
* @param mixed $value * @param mixed $value
*/ */
public function addParameter(string $name, $value); public function addParameter(string $name, $value): void;
/** /**
* Registers a service with the Service Locator using the FQCN of the class or the alias, if provided. * Registers a service with the Service Locator using the FQCN of the class or the alias, if provided.
@@ -51,7 +50,7 @@ interface TagFactory
* *
* @param object $service * @param object $service
*/ */
public function addService($service); public function addService($service): void;
/** /**
* Factory method responsible for instantiating the correct sub type. * Factory method responsible for instantiating the correct sub type.
@@ -62,7 +61,7 @@ interface TagFactory
* *
* @return Tag A new tag object. * @return Tag A new tag object.
*/ */
public function create(string $tagLine, TypeContext $context = null): ?Tag; public function create(string $tagLine, ?TypeContext $context = null): ?Tag;
/** /**
* Registers a handler for tags. * Registers a handler for tags.
@@ -82,5 +81,5 @@ interface TagFactory
* @throws \InvalidArgumentException if the handler is not an existing class * @throws \InvalidArgumentException if the handler is not an existing class
* @throws \InvalidArgumentException if the handler does not implement the {@see Tag} interface * @throws \InvalidArgumentException if the handler does not implement the {@see Tag} interface
*/ */
public function registerTagHandler(string $tagName, string $handler); public function registerTagHandler(string $tagName, string $handler): void;
} }
+1 -1
View File
@@ -42,7 +42,7 @@ abstract class BaseTag implements DocBlock\Tag
return $this->description; return $this->description;
} }
public function render(Formatter $formatter = null) public function render(?Formatter $formatter = null): string
{ {
if ($formatter === null) { if ($formatter === null) {
$formatter = new Formatter\PassthroughFormatter(); $formatter = new Formatter\PassthroughFormatter();
+4 -5
View File
@@ -33,7 +33,7 @@ final class Covers extends BaseTag implements Factory\StaticMethod
/** /**
* Initializes this tag. * Initializes this tag.
*/ */
public function __construct(Fqsen $refers, Description $description = null) public function __construct(Fqsen $refers, ?Description $description = null)
{ {
$this->refers = $refers; $this->refers = $refers;
$this->description = $description; $this->description = $description;
@@ -44,9 +44,9 @@ final class Covers extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
FqsenResolver $resolver = null, ?FqsenResolver $resolver = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::notEmpty($body); Assert::notEmpty($body);
@@ -61,7 +61,6 @@ final class Covers extends BaseTag implements Factory\StaticMethod
/** /**
* Returns the structural element this tag refers to. * Returns the structural element this tag refers to.
* *
* @return Fqsen
*/ */
public function getReference(): Fqsen public function getReference(): Fqsen
{ {
+5 -6
View File
@@ -29,7 +29,7 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod
* PCRE regular expression matching a version vector. * PCRE regular expression matching a version vector.
* Assumes the "x" modifier. * Assumes the "x" modifier.
*/ */
const REGEX_VECTOR = '(?: public const REGEX_VECTOR = '(?:
# Normal release vectors. # Normal release vectors.
\d\S* \d\S*
| |
@@ -44,7 +44,7 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod
/** @var string The version vector. */ /** @var string The version vector. */
private $version = ''; private $version = '';
public function __construct($version = null, Description $description = null) public function __construct($version = null, ?Description $description = null)
{ {
Assert::nullOrStringNotEmpty($version); Assert::nullOrStringNotEmpty($version);
@@ -57,8 +57,8 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
?string $body, ?string $body,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
if (empty($body)) { if (empty($body)) {
return new static(); return new static();
@@ -81,9 +81,8 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod
/** /**
* Gets the version section of the tag. * Gets the version section of the tag.
* *
* @return string|null
*/ */
public function getVersion() public function getVersion(): ?string
{ {
return $this->version; return $this->version;
} }
@@ -15,5 +15,8 @@ namespace phpDocumentor\Reflection\DocBlock\Tags\Factory;
interface StaticMethod interface StaticMethod
{ {
/**
* @return mixed
*/
public static function create(string $body); public static function create(string $body);
} }
+1 -1
View File
@@ -15,5 +15,5 @@ namespace phpDocumentor\Reflection\DocBlock\Tags\Factory;
interface Strategy interface Strategy
{ {
public function create($body); public function create($body): void;
} }
-1
View File
@@ -21,7 +21,6 @@ interface Formatter
* Formats a tag into a string representation according to a specific format, such as Markdown. * Formats a tag into a string representation according to a specific format, such as Markdown.
* *
* *
* @return string
*/ */
public function format(Tag $tag): string; public function format(Tag $tag): string;
} }
+4 -4
View File
@@ -30,7 +30,7 @@ class Generic extends BaseTag implements Factory\StaticMethod
* @param string $name Name of the tag. * @param string $name Name of the tag.
* @param Description $description The contents of the given tag. * @param Description $description The contents of the given tag.
*/ */
public function __construct(string $name, Description $description = null) public function __construct(string $name, ?Description $description = null)
{ {
$this->validateTagName($name); $this->validateTagName($name);
@@ -47,8 +47,8 @@ class Generic extends BaseTag implements Factory\StaticMethod
public static function create( public static function create(
string $body, string $body,
string $name = '', string $name = '',
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::stringNotEmpty($name); Assert::stringNotEmpty($name);
Assert::notNull($descriptionFactory); Assert::notNull($descriptionFactory);
@@ -69,7 +69,7 @@ class Generic extends BaseTag implements Factory\StaticMethod
/** /**
* Validates if the tag name matches the expected format, otherwise throws an exception. * Validates if the tag name matches the expected format, otherwise throws an exception.
*/ */
private function validateTagName(string $name) private function validateTagName(string $name): void
{ {
if (! preg_match('/^' . StandardTagFactory::REGEX_TAGNAME . '$/u', $name)) { if (! preg_match('/^' . StandardTagFactory::REGEX_TAGNAME . '$/u', $name)) {
throw new \InvalidArgumentException( throw new \InvalidArgumentException(
+2 -2
View File
@@ -31,7 +31,7 @@ final class Link extends BaseTag implements Factory\StaticMethod
/** /**
* Initializes a link to a URL. * Initializes a link to a URL.
*/ */
public function __construct(string $link, Description $description = null) public function __construct(string $link, ?Description $description = null)
{ {
$this->link = $link; $this->link = $link;
$this->description = $description; $this->description = $description;
@@ -40,7 +40,7 @@ final class Link extends BaseTag implements Factory\StaticMethod
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function create(string $body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) public static function create(string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null): Link
{ {
Assert::notNull($descriptionFactory); Assert::notNull($descriptionFactory);
+8 -8
View File
@@ -43,9 +43,9 @@ final class Method extends BaseTag implements Factory\StaticMethod
public function __construct( public function __construct(
$methodName, $methodName,
array $arguments = [], array $arguments = [],
Type $returnType = null, ?Type $returnType = null,
$static = false, $static = false,
Description $description = null ?Description $description = null
) { ) {
Assert::stringNotEmpty($methodName); Assert::stringNotEmpty($methodName);
Assert::boolean($static); Assert::boolean($static);
@@ -66,10 +66,10 @@ final class Method extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
TypeResolver $typeResolver = null, ?TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ): Method {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([ $typeResolver, $descriptionFactory ]); Assert::allNotNull([ $typeResolver, $descriptionFactory ]);
@@ -123,7 +123,7 @@ final class Method extends BaseTag implements Factory\StaticMethod
return null; return null;
} }
list(, $static, $returnType, $methodName, $arguments, $description) = $matches; [, $static, $returnType, $methodName, $arguments, $description] = $matches;
$static = $static === 'static'; $static = $static === 'static';
@@ -193,7 +193,7 @@ final class Method extends BaseTag implements Factory\StaticMethod
return $this->returnType; return $this->returnType;
} }
public function __toString() public function __toString(): string
{ {
$arguments = []; $arguments = [];
foreach ($this->arguments as $argument) { foreach ($this->arguments as $argument) {
+5 -7
View File
@@ -37,7 +37,7 @@ final class Param extends BaseTag implements Factory\StaticMethod
/** @var bool determines whether this is a variadic argument */ /** @var bool determines whether this is a variadic argument */
private $isVariadic = false; private $isVariadic = false;
public function __construct(string $variableName, Type $type = null, bool $isVariadic = false, Description $description = null) public function __construct(string $variableName, ?Type $type = null, bool $isVariadic = false, ?Description $description = null)
{ {
$this->variableName = $variableName; $this->variableName = $variableName;
$this->type = $type; $this->type = $type;
@@ -50,9 +50,9 @@ final class Param extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
TypeResolver $typeResolver = null, ?TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
@@ -99,9 +99,8 @@ final class Param extends BaseTag implements Factory\StaticMethod
/** /**
* Returns the variable's type or null if unknown. * Returns the variable's type or null if unknown.
* *
* @return Type|null
*/ */
public function getType() public function getType(): ?Type
{ {
return $this->type; return $this->type;
} }
@@ -109,7 +108,6 @@ final class Param extends BaseTag implements Factory\StaticMethod
/** /**
* Returns whether this tag is variadic. * Returns whether this tag is variadic.
* *
* @return boolean
*/ */
public function isVariadic(): bool public function isVariadic(): bool
{ {
+5 -6
View File
@@ -34,7 +34,7 @@ class Property extends BaseTag implements Factory\StaticMethod
/** @var string */ /** @var string */
protected $variableName = ''; protected $variableName = '';
public function __construct(string $variableName, Type $type = null, Description $description = null) public function __construct(string $variableName, ?Type $type = null, ?Description $description = null)
{ {
$this->variableName = $variableName; $this->variableName = $variableName;
$this->type = $type; $this->type = $type;
@@ -46,9 +46,9 @@ class Property extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
TypeResolver $typeResolver = null, ?TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
@@ -89,9 +89,8 @@ class Property extends BaseTag implements Factory\StaticMethod
/** /**
* Returns the variable's type or null if unknown. * Returns the variable's type or null if unknown.
* *
* @return Type|null
*/ */
public function getType() public function getType(): ?Type
{ {
return $this->type; return $this->type;
} }
+5 -6
View File
@@ -34,7 +34,7 @@ class PropertyRead extends BaseTag implements Factory\StaticMethod
/** @var string */ /** @var string */
protected $variableName = ''; protected $variableName = '';
public function __construct(string $variableName, Type $type = null, Description $description = null) public function __construct(string $variableName, ?Type $type = null, ?Description $description = null)
{ {
$this->variableName = $variableName; $this->variableName = $variableName;
$this->type = $type; $this->type = $type;
@@ -46,9 +46,9 @@ class PropertyRead extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
TypeResolver $typeResolver = null, ?TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
@@ -89,9 +89,8 @@ class PropertyRead extends BaseTag implements Factory\StaticMethod
/** /**
* Returns the variable's type or null if unknown. * Returns the variable's type or null if unknown.
* *
* @return Type|null
*/ */
public function getType() public function getType(): ?Type
{ {
return $this->type; return $this->type;
} }
+5 -6
View File
@@ -34,7 +34,7 @@ class PropertyWrite extends BaseTag implements Factory\StaticMethod
/** @var string */ /** @var string */
protected $variableName = ''; protected $variableName = '';
public function __construct(string $variableName, Type $type = null, Description $description = null) public function __construct(string $variableName, ?Type $type = null, ?Description $description = null)
{ {
$this->variableName = $variableName; $this->variableName = $variableName;
$this->type = $type; $this->type = $type;
@@ -46,9 +46,9 @@ class PropertyWrite extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
TypeResolver $typeResolver = null, ?TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
@@ -89,9 +89,8 @@ class PropertyWrite extends BaseTag implements Factory\StaticMethod
/** /**
* Returns the variable's type or null if unknown. * Returns the variable's type or null if unknown.
* *
* @return Type|null
*/ */
public function getType() public function getType(): ?Type
{ {
return $this->type; return $this->type;
} }
+1 -1
View File
@@ -18,5 +18,5 @@ namespace phpDocumentor\Reflection\DocBlock\Tags\Reference;
*/ */
interface Reference interface Reference
{ {
public function __toString(); public function __toString(): string;
} }
+1 -1
View File
@@ -34,7 +34,7 @@ final class Url implements Reference
$this->uri = $uri; $this->uri = $uri;
} }
public function __toString() public function __toString(): string
{ {
return $this->uri; return $this->uri;
} }
+5 -7
View File
@@ -30,7 +30,7 @@ final class Return_ extends BaseTag implements Factory\StaticMethod
/** @var Type */ /** @var Type */
private $type; private $type;
public function __construct(Type $type, Description $description = null) public function __construct(Type $type, ?Description $description = null)
{ {
$this->type = $type; $this->type = $type;
$this->description = $description; $this->description = $description;
@@ -41,9 +41,9 @@ final class Return_ extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
TypeResolver $typeResolver = null, ?TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
@@ -57,15 +57,13 @@ final class Return_ extends BaseTag implements Factory\StaticMethod
/** /**
* Returns the type section of the variable. * Returns the type section of the variable.
*
* @return Type
*/ */
public function getType(): Type public function getType(): Type
{ {
return $this->type; return $this->type;
} }
public function __toString() public function __toString(): string
{ {
return $this->type . ' ' . $this->description; return $this->type . ' ' . $this->description;
} }
+4 -5
View File
@@ -35,7 +35,7 @@ class See extends BaseTag implements Factory\StaticMethod
/** /**
* Initializes this tag. * Initializes this tag.
*/ */
public function __construct(Reference $refers, Description $description = null) public function __construct(Reference $refers, ?Description $description = null)
{ {
$this->refers = $refers; $this->refers = $refers;
$this->description = $description; $this->description = $description;
@@ -46,9 +46,9 @@ class See extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
FqsenResolver $resolver = null, ?FqsenResolver $resolver = null,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::allNotNull([$resolver, $descriptionFactory]); Assert::allNotNull([$resolver, $descriptionFactory]);
@@ -66,7 +66,6 @@ class See extends BaseTag implements Factory\StaticMethod
/** /**
* Returns the ref of this tag. * Returns the ref of this tag.
* *
* @return Reference
*/ */
public function getReference(): Reference public function getReference(): Reference
{ {
+4 -4
View File
@@ -29,7 +29,7 @@ final class Since extends BaseTag implements Factory\StaticMethod
* PCRE regular expression matching a version vector. * PCRE regular expression matching a version vector.
* Assumes the "x" modifier. * Assumes the "x" modifier.
*/ */
const REGEX_VECTOR = '(?: public const REGEX_VECTOR = '(?:
# Normal release vectors. # Normal release vectors.
\d\S* \d\S*
| |
@@ -44,7 +44,7 @@ final class Since extends BaseTag implements Factory\StaticMethod
/** @var string The version vector. */ /** @var string The version vector. */
private $version = ''; private $version = '';
public function __construct($version = null, Description $description = null) public function __construct($version = null, ?Description $description = null)
{ {
Assert::nullOrStringNotEmpty($version); Assert::nullOrStringNotEmpty($version);
@@ -57,8 +57,8 @@ final class Since extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
?string $body, ?string $body,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
if (empty($body)) { if (empty($body)) {
return new static(); return new static();
+5 -5
View File
@@ -32,7 +32,7 @@ final class Source extends BaseTag implements Factory\StaticMethod
/** @var int|null The number of lines, relative to the starting line. NULL means "to the end". */ /** @var int|null The number of lines, relative to the starting line. NULL means "to the end". */
private $lineCount = null; private $lineCount = null;
public function __construct($startingLine, $lineCount = null, Description $description = null) public function __construct($startingLine, $lineCount = null, ?Description $description = null)
{ {
Assert::integerish($startingLine); Assert::integerish($startingLine);
Assert::nullOrIntegerish($lineCount); Assert::nullOrIntegerish($lineCount);
@@ -47,8 +47,8 @@ final class Source extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::notNull($descriptionFactory); Assert::notNull($descriptionFactory);
@@ -87,12 +87,12 @@ final class Source extends BaseTag implements Factory\StaticMethod
* @return int|null The number of lines, relative to the starting line. NULL * @return int|null The number of lines, relative to the starting line. NULL
* means "to the end". * means "to the end".
*/ */
public function getLineCount() public function getLineCount(): ?int
{ {
return $this->lineCount; return $this->lineCount;
} }
public function __toString() public function __toString(): string
{ {
return $this->startingLine return $this->startingLine
. ($this->lineCount !== null ? ' ' . $this->lineCount : '') . ($this->lineCount !== null ? ' ' . $this->lineCount : '')
+5 -6
View File
@@ -30,7 +30,7 @@ final class Throws extends BaseTag implements Factory\StaticMethod
/** @var Type */ /** @var Type */
private $type; private $type;
public function __construct(Type $type, Description $description = null) public function __construct(Type $type, ?Description $description = null)
{ {
$this->type = $type; $this->type = $type;
$this->description = $description; $this->description = $description;
@@ -41,9 +41,9 @@ final class Throws extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
TypeResolver $typeResolver = null, ?TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
@@ -58,14 +58,13 @@ final class Throws extends BaseTag implements Factory\StaticMethod
/** /**
* Returns the type section of the variable. * Returns the type section of the variable.
* *
* @return Type
*/ */
public function getType(): Type public function getType(): Type
{ {
return $this->type; return $this->type;
} }
public function __toString() public function __toString(): string
{ {
return $this->type . ' ' . $this->description; return $this->type . ' ' . $this->description;
} }
+4 -5
View File
@@ -33,7 +33,7 @@ final class Uses extends BaseTag implements Factory\StaticMethod
/** /**
* Initializes this tag. * Initializes this tag.
*/ */
public function __construct(Fqsen $refers, Description $description = null) public function __construct(Fqsen $refers, ?Description $description = null)
{ {
$this->refers = $refers; $this->refers = $refers;
$this->description = $description; $this->description = $description;
@@ -44,9 +44,9 @@ final class Uses extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
FqsenResolver $resolver = null, ?FqsenResolver $resolver = null,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::allNotNull([$resolver, $descriptionFactory]); Assert::allNotNull([$resolver, $descriptionFactory]);
@@ -61,7 +61,6 @@ final class Uses extends BaseTag implements Factory\StaticMethod
/** /**
* Returns the structural element this tag refers to. * Returns the structural element this tag refers to.
* *
* @return Fqsen
*/ */
public function getReference(): Fqsen public function getReference(): Fqsen
{ {
+5 -6
View File
@@ -34,7 +34,7 @@ class Var_ extends BaseTag implements Factory\StaticMethod
/** @var string */ /** @var string */
protected $variableName = ''; protected $variableName = '';
public function __construct(string $variableName, Type $type = null, Description $description = null) public function __construct(string $variableName, ?Type $type = null, ?Description $description = null)
{ {
$this->variableName = $variableName; $this->variableName = $variableName;
$this->type = $type; $this->type = $type;
@@ -46,9 +46,9 @@ class Var_ extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
string $body, string $body,
TypeResolver $typeResolver = null, ?TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
@@ -89,9 +89,8 @@ class Var_ extends BaseTag implements Factory\StaticMethod
/** /**
* Returns the variable's type or null if unknown. * Returns the variable's type or null if unknown.
* *
* @return Type|null
*/ */
public function getType() public function getType(): ?Type
{ {
return $this->type; return $this->type;
} }
+4 -4
View File
@@ -29,7 +29,7 @@ final class Version extends BaseTag implements Factory\StaticMethod
* PCRE regular expression matching a version vector. * PCRE regular expression matching a version vector.
* Assumes the "x" modifier. * Assumes the "x" modifier.
*/ */
const REGEX_VECTOR = '(?: public const REGEX_VECTOR = '(?:
# Normal release vectors. # Normal release vectors.
\d\S* \d\S*
| |
@@ -44,7 +44,7 @@ final class Version extends BaseTag implements Factory\StaticMethod
/** @var string The version vector. */ /** @var string The version vector. */
private $version = ''; private $version = '';
public function __construct($version = null, Description $description = null) public function __construct($version = null, ?Description $description = null)
{ {
Assert::nullOrStringNotEmpty($version); Assert::nullOrStringNotEmpty($version);
@@ -57,8 +57,8 @@ final class Version extends BaseTag implements Factory\StaticMethod
*/ */
public static function create( public static function create(
?string $body, ?string $body,
DescriptionFactory $descriptionFactory = null, ?DescriptionFactory $descriptionFactory = null,
TypeContext $context = null ?TypeContext $context = null
) { ) {
if (empty($body)) { if (empty($body)) {
return new static(); return new static();
+2 -4
View File
@@ -41,7 +41,6 @@ final class DocBlockFactory implements DocBlockFactoryInterface
* *
* @param string[] $additionalTags * @param string[] $additionalTags
* *
* @return DocBlockFactory
*/ */
public static function createInstance(array $additionalTags = []): DocBlockFactory public static function createInstance(array $additionalTags = []): DocBlockFactory
{ {
@@ -64,9 +63,8 @@ final class DocBlockFactory implements DocBlockFactoryInterface
* @param object|string $docblock A string containing the DocBlock to parse or an object supporting the * @param object|string $docblock A string containing the DocBlock to parse or an object supporting the
* getDocComment method (such as a ReflectionClass object). * getDocComment method (such as a ReflectionClass object).
* *
* @return DocBlock
*/ */
public function create($docblock, Types\Context $context = null, Location $location = null): DocBlock public function create($docblock, ?Types\Context $context = null, ?Location $location = null): DocBlock
{ {
if (is_object($docblock)) { if (is_object($docblock)) {
if (!method_exists($docblock, 'getDocComment')) { if (!method_exists($docblock, 'getDocComment')) {
@@ -99,7 +97,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface
); );
} }
public function registerTagHandler($tagName, $handler) public function registerTagHandler($tagName, $handler): void
{ {
$this->tagFactory->registerTagHandler($tagName, $handler); $this->tagFactory->registerTagHandler($tagName, $handler);
} }
+1 -4
View File
@@ -9,15 +9,12 @@ interface DocBlockFactoryInterface
* *
* @param string[] $additionalTags * @param string[] $additionalTags
* *
* @return DocBlockFactory
*/ */
public static function createInstance(array $additionalTags = []): DocBlockFactory; public static function createInstance(array $additionalTags = []): DocBlockFactory;
/** /**
* @param string|object $docblock * @param string|object $docblock
* @param Location $location
* *
* @return DocBlock
*/ */
public function create($docblock, Types\Context $context = null, Location $location = null): DocBlock; public function create($docblock, ?Types\Context $context = null, ?Location $location = null): DocBlock;
} }
@@ -24,12 +24,12 @@ final class DocblocksWithAnnotationsTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
public function testDocblockWithAnnotations() public function testDocblockWithAnnotations(): void
{ {
$docComment = <<<DOCCOMMENT $docComment = <<<DOCCOMMENT
/** /**
@@ -28,12 +28,12 @@ class InterpretingDocBlocksTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
public function testInterpretingASimpleDocBlock() public function testInterpretingASimpleDocBlock(): void
{ {
/** /**
* @var DocBlock $docblock * @var DocBlock $docblock
@@ -56,7 +56,7 @@ DESCRIPTION;
$this->assertEmpty($docblock->getTags()); $this->assertEmpty($docblock->getTags());
} }
public function testInterpretingTags() public function testInterpretingTags(): void
{ {
/** /**
* @var DocBlock $docblock * @var DocBlock $docblock
@@ -78,7 +78,7 @@ DESCRIPTION;
$this->assertSame('', (string)$seeTag->getDescription()); $this->assertSame('', (string)$seeTag->getDescription());
} }
public function testDescriptionsCanEscapeAtSignsAndClosingBraces() public function testDescriptionsCanEscapeAtSignsAndClosingBraces(): void
{ {
/** /**
* @var string $docComment * @var string $docComment
@@ -24,12 +24,12 @@ class ReconstitutingADocBlockTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
public function testReconstituteADocBlock() public function testReconstituteADocBlock(): void
{ {
/** /**
* @var string $docComment * @var string $docComment
+2 -2
View File
@@ -26,12 +26,12 @@ class UsingTagsTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
public function testAddingYourOwnTagUsingAStaticMethodAsFactory() public function testAddingYourOwnTagUsingAStaticMethodAsFactory(): void
{ {
/** /**
* @var object[] $customTagObjects * @var object[] $customTagObjects
@@ -27,7 +27,7 @@ class DescriptionFactoryTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -38,7 +38,7 @@ class DescriptionFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
* @dataProvider provideSimpleExampleDescriptions * @dataProvider provideSimpleExampleDescriptions
*/ */
public function testDescriptionCanParseASimpleString($contents) public function testDescriptionCanParseASimpleString($contents): void
{ {
$tagFactory = m::mock(TagFactory::class); $tagFactory = m::mock(TagFactory::class);
$tagFactory->shouldReceive('create')->never(); $tagFactory->shouldReceive('create')->never();
@@ -55,7 +55,7 @@ class DescriptionFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
* @dataProvider provideEscapeSequences * @dataProvider provideEscapeSequences
*/ */
public function testEscapeSequences($contents, $expected) public function testEscapeSequences($contents, $expected): void
{ {
$tagFactory = m::mock(TagFactory::class); $tagFactory = m::mock(TagFactory::class);
$tagFactory->shouldReceive('create')->never(); $tagFactory->shouldReceive('create')->never();
@@ -75,7 +75,7 @@ class DescriptionFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
* @uses phpDocumentor\Reflection\Types\Context * @uses phpDocumentor\Reflection\Types\Context
*/ */
public function testDescriptionCanParseAStringWithInlineTag() public function testDescriptionCanParseAStringWithInlineTag(): void
{ {
$contents = 'This is text for a {@link http://phpdoc.org/ description} that uses an inline tag.'; $contents = 'This is text for a {@link http://phpdoc.org/ description} that uses an inline tag.';
$context = new Context(''); $context = new Context('');
@@ -100,7 +100,7 @@ class DescriptionFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
* @uses phpDocumentor\Reflection\Types\Context * @uses phpDocumentor\Reflection\Types\Context
*/ */
public function testDescriptionCanParseAStringStartingWithInlineTag() public function testDescriptionCanParseAStringStartingWithInlineTag(): void
{ {
$contents = '{@link http://phpdoc.org/ This} is text for a description that starts with an inline tag.'; $contents = '{@link http://phpdoc.org/ This} is text for a description that starts with an inline tag.';
$context = new Context(''); $context = new Context('');
@@ -121,7 +121,7 @@ class DescriptionFactoryTest extends TestCase
* @covers ::create * @covers ::create
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testIfSuperfluousStartingSpacesAreRemoved() public function testIfSuperfluousStartingSpacesAreRemoved(): void
{ {
$factory = new DescriptionFactory(m::mock(TagFactory::class)); $factory = new DescriptionFactory(m::mock(TagFactory::class));
$descriptionText = <<<DESCRIPTION $descriptionText = <<<DESCRIPTION
+5 -5
View File
@@ -26,7 +26,7 @@ class DescriptionTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -38,7 +38,7 @@ class DescriptionTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
*/ */
public function testDescriptionCanRenderUsingABodyWithPlaceholdersAndTags() public function testDescriptionCanRenderUsingABodyWithPlaceholdersAndTags(): void
{ {
$body = 'This is a %1$s body.'; $body = 'This is a %1$s body.';
$expected = 'This is a {@internal significant} body.'; $expected = 'This is a {@internal significant} body.';
@@ -63,7 +63,7 @@ class DescriptionTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
*/ */
public function testDescriptionCanBeCastToString() public function testDescriptionCanBeCastToString(): void
{ {
$body = 'This is a %1$s body.'; $body = 'This is a %1$s body.';
$expected = 'This is a {@internal significant} body.'; $expected = 'This is a {@internal significant} body.';
@@ -79,7 +79,7 @@ class DescriptionTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
*/ */
public function testDescriptionTagsGetter() public function testDescriptionTagsGetter(): void
{ {
$body = '@JoinTable(name="table", joinColumns=%1$s, inverseJoinColumns=%2$s)'; $body = '@JoinTable(name="table", joinColumns=%1$s, inverseJoinColumns=%2$s)';
@@ -109,7 +109,7 @@ class DescriptionTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
*/ */
public function testDescriptionMultipleTagsCanBeCastToString() public function testDescriptionMultipleTagsCanBeCastToString(): void
{ {
$body = '@JoinTable(name="table", joinColumns=%1$s, inverseJoinColumns=%2$s)'; $body = '@JoinTable(name="table", joinColumns=%1$s, inverseJoinColumns=%2$s)';
+3 -3
View File
@@ -18,12 +18,12 @@ class ExampleFinderTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
public function setUp() public function setUp(): void
{ {
$this->fixture = new ExampleFinder(); $this->fixture = new ExampleFinder();
} }
@@ -34,7 +34,7 @@ class ExampleFinderTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Example * @uses \phpDocumentor\Reflection\DocBlock\Tags\Example
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testFileNotFound() public function testFileNotFound(): void
{ {
$example = new Example('./example.php', false, 1, 0, new Description('Test')); $example = new Example('./example.php', false, 1, 0, new Description('Test'));
$this->assertSame('** File not found : ./example.php **', $this->fixture->find($example)); $this->assertSame('** File not found : ./example.php **', $this->fixture->find($example));
+5 -5
View File
@@ -26,7 +26,7 @@ class SerializerTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -40,7 +40,7 @@ class SerializerTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses phpDocumentor\Reflection\DocBlock\Tags\Generic * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic
*/ */
public function testReconstructsADocCommentFromADocBlock() public function testReconstructsADocCommentFromADocBlock(): void
{ {
$expected = <<<'DOCCOMMENT' $expected = <<<'DOCCOMMENT'
/** /**
@@ -74,7 +74,7 @@ DOCCOMMENT;
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses phpDocumentor\Reflection\DocBlock\Tags\Generic * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic
*/ */
public function testAddPrefixToDocBlock() public function testAddPrefixToDocBlock(): void
{ {
$expected = <<<'DOCCOMMENT' $expected = <<<'DOCCOMMENT'
aa/** aa/**
@@ -108,7 +108,7 @@ DOCCOMMENT;
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses phpDocumentor\Reflection\DocBlock\Tags\Generic * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic
*/ */
public function testAddPrefixToDocBlockExceptFirstLine() public function testAddPrefixToDocBlockExceptFirstLine(): void
{ {
$expected = <<<'DOCCOMMENT' $expected = <<<'DOCCOMMENT'
/** /**
@@ -142,7 +142,7 @@ DOCCOMMENT;
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses phpDocumentor\Reflection\DocBlock\Tags\Generic * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic
*/ */
public function testWordwrapsAroundTheGivenAmountOfCharacters() public function testWordwrapsAroundTheGivenAmountOfCharacters(): void
{ {
$expected = <<<'DOCCOMMENT' $expected = <<<'DOCCOMMENT'
/** /**
+15 -15
View File
@@ -36,7 +36,7 @@ class StandardTagFactoryTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -49,7 +49,7 @@ class StandardTagFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testCreatingAGenericTag() public function testCreatingAGenericTag(): void
{ {
$expectedTagName = 'unknown-tag'; $expectedTagName = 'unknown-tag';
$expectedDescriptionText = 'This is a description'; $expectedDescriptionText = 'This is a description';
@@ -81,7 +81,7 @@ class StandardTagFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\Tags\Author * @uses phpDocumentor\Reflection\DocBlock\Tags\Author
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
*/ */
public function testCreatingASpecificTag() public function testCreatingASpecificTag(): void
{ {
$context = new Context(''); $context = new Context('');
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class)); $tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class));
@@ -102,7 +102,7 @@ class StandardTagFactoryTest extends TestCase
* @uses \phpDocumentor\Reflection\Fqsen * @uses \phpDocumentor\Reflection\Fqsen
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen * @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen
*/ */
public function testAnEmptyContextIsCreatedIfNoneIsProvided() public function testAnEmptyContextIsCreatedIfNoneIsProvided(): void
{ {
$fqsen = '\Tag'; $fqsen = '\Tag';
$resolver = m::mock(FqsenResolver::class) $resolver = m::mock(FqsenResolver::class)
@@ -130,7 +130,7 @@ class StandardTagFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\Tags\Author * @uses phpDocumentor\Reflection\DocBlock\Tags\Author
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
*/ */
public function testPassingYourOwnSetOfTagHandlers() public function testPassingYourOwnSetOfTagHandlers(): void
{ {
$context = new Context(''); $context = new Context('');
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class), ['user' => Author::class]); $tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class), ['user' => Author::class]);
@@ -149,7 +149,7 @@ class StandardTagFactoryTest extends TestCase
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
* @expectedExceptionMessage The tag "@user[myuser" does not seem to be wellformed, please check it for errors * @expectedExceptionMessage The tag "@user[myuser" does not seem to be wellformed, please check it for errors
*/ */
public function testExceptionIsThrownIfProvidedTagIsNotWellformed() public function testExceptionIsThrownIfProvidedTagIsNotWellformed(): void
{ {
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class)); $tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class));
$tagFactory->create('@user[myuser'); $tagFactory->create('@user[myuser');
@@ -160,7 +160,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::addParameter * @covers ::addParameter
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService
*/ */
public function testAddParameterToServiceLocator() public function testAddParameterToServiceLocator(): void
{ {
$resolver = m::mock(FqsenResolver::class); $resolver = m::mock(FqsenResolver::class);
$tagFactory = new StandardTagFactory($resolver); $tagFactory = new StandardTagFactory($resolver);
@@ -177,7 +177,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::addService * @covers ::addService
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct
*/ */
public function testAddServiceToServiceLocator() public function testAddServiceToServiceLocator(): void
{ {
$service = new PassthroughFormatter(); $service = new PassthroughFormatter();
@@ -196,7 +196,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::addService * @covers ::addService
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct
*/ */
public function testInjectConcreteServiceForInterfaceToServiceLocator() public function testInjectConcreteServiceForInterfaceToServiceLocator(): void
{ {
$interfaceName = Formatter::class; $interfaceName = Formatter::class;
$service = new PassthroughFormatter(); $service = new PassthroughFormatter();
@@ -219,7 +219,7 @@ class StandardTagFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::create * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::create
* @uses phpDocumentor\Reflection\DocBlock\Tags\Author * @uses phpDocumentor\Reflection\DocBlock\Tags\Author
*/ */
public function testRegisteringAHandlerForANewTag() public function testRegisteringAHandlerForANewTag(): void
{ {
$resolver = m::mock(FqsenResolver::class); $resolver = m::mock(FqsenResolver::class);
$tagFactory = new StandardTagFactory($resolver); $tagFactory = new StandardTagFactory($resolver);
@@ -237,7 +237,7 @@ class StandardTagFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testHandlerRegistrationFailsIfProvidedTagNameIsNamespaceButNotFullyQualified() public function testHandlerRegistrationFailsIfProvidedTagNameIsNamespaceButNotFullyQualified(): void
{ {
$resolver = m::mock(FqsenResolver::class); $resolver = m::mock(FqsenResolver::class);
$tagFactory = new StandardTagFactory($resolver); $tagFactory = new StandardTagFactory($resolver);
@@ -251,7 +251,7 @@ class StandardTagFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testHandlerRegistrationFailsIfProvidedHandlerIsEmpty() public function testHandlerRegistrationFailsIfProvidedHandlerIsEmpty(): void
{ {
$resolver = m::mock(FqsenResolver::class); $resolver = m::mock(FqsenResolver::class);
$tagFactory = new StandardTagFactory($resolver); $tagFactory = new StandardTagFactory($resolver);
@@ -265,7 +265,7 @@ class StandardTagFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testHandlerRegistrationFailsIfProvidedHandlerIsNotAnExistingClassName() public function testHandlerRegistrationFailsIfProvidedHandlerIsNotAnExistingClassName(): void
{ {
$resolver = m::mock(FqsenResolver::class); $resolver = m::mock(FqsenResolver::class);
$tagFactory = new StandardTagFactory($resolver); $tagFactory = new StandardTagFactory($resolver);
@@ -279,7 +279,7 @@ class StandardTagFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testHandlerRegistrationFailsIfProvidedHandlerDoesNotImplementTheTagInterface() public function testHandlerRegistrationFailsIfProvidedHandlerDoesNotImplementTheTagInterface(): void
{ {
$resolver = m::mock(FqsenResolver::class); $resolver = m::mock(FqsenResolver::class);
$tagFactory = new StandardTagFactory($resolver); $tagFactory = new StandardTagFactory($resolver);
@@ -295,7 +295,7 @@ class StandardTagFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\Docblock\Tags\Return_ * @uses phpDocumentor\Reflection\Docblock\Tags\Return_
* @uses phpDocumentor\Reflection\Docblock\Tags\BaseTag * @uses phpDocumentor\Reflection\Docblock\Tags\BaseTag
*/ */
public function testReturntagIsMappedCorrectly() public function testReturntagIsMappedCorrectly(): void
{ {
$context = new Context(''); $context = new Context('');
+11 -11
View File
@@ -25,7 +25,7 @@ class AuthorTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -34,7 +34,7 @@ class AuthorTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Author('Mike van Riel', '[email protected]'); $fixture = new Author('Mike van Riel', '[email protected]');
@@ -48,7 +48,7 @@ class AuthorTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Author('Mike van Riel', '[email protected]'); $fixture = new Author('Mike van Riel', '[email protected]');
@@ -59,7 +59,7 @@ class AuthorTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Author('Mike van Riel', '[email protected]'); $fixture = new Author('Mike van Riel', '[email protected]');
@@ -73,7 +73,7 @@ class AuthorTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getAuthorName * @covers ::getAuthorName
*/ */
public function testHasTheAuthorName() public function testHasTheAuthorName(): void
{ {
$expected = 'Mike van Riel'; $expected = 'Mike van Riel';
@@ -86,7 +86,7 @@ class AuthorTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getEmail * @covers ::getEmail
*/ */
public function testHasTheAuthorMailAddress() public function testHasTheAuthorMailAddress(): void
{ {
$expected = '[email protected]'; $expected = '[email protected]';
@@ -99,7 +99,7 @@ class AuthorTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testInitializationFailsIfEmailIsNotValid() public function testInitializationFailsIfEmailIsNotValid(): void
{ {
new Author('Mike van Riel', 'mike'); new Author('Mike van Riel', 'mike');
} }
@@ -108,7 +108,7 @@ class AuthorTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::__toString * @covers ::__toString
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Author('Mike van Riel', '[email protected]'); $fixture = new Author('Mike van Riel', '[email protected]');
@@ -119,7 +119,7 @@ class AuthorTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::__toString * @covers ::__toString
*/ */
public function testStringRepresentationWithEmtpyEmail() public function testStringRepresentationWithEmtpyEmail(): void
{ {
$fixture = new Author('Mike van Riel', ''); $fixture = new Author('Mike van Riel', '');
@@ -130,7 +130,7 @@ class AuthorTest extends TestCase
* @covers ::create * @covers ::create
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::<public> * @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::<public>
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$fixture = Author::create('Mike van Riel <[email protected]>'); $fixture = Author::create('Mike van Riel <[email protected]>');
@@ -143,7 +143,7 @@ class AuthorTest extends TestCase
* @covers ::create * @covers ::create
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::<public> * @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::<public>
*/ */
public function testFactoryMethodReturnsNullIfItCouldNotReadBody() public function testFactoryMethodReturnsNullIfItCouldNotReadBody(): void
{ {
$this->assertNull(Author::create('dfgr<')); $this->assertNull(Author::create('dfgr<'));
} }
+9 -9
View File
@@ -31,7 +31,7 @@ class CoversTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -41,7 +41,7 @@ class CoversTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Covers(new Fqsen('\DateTime'), new Description('Description')); $fixture = new Covers(new Fqsen('\DateTime'), new Description('Description'));
@@ -56,7 +56,7 @@ class CoversTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Covers(new Fqsen('\DateTime'), new Description('Description')); $fixture = new Covers(new Fqsen('\DateTime'), new Description('Description'));
@@ -68,7 +68,7 @@ class CoversTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Covers(new Fqsen('\DateTime'), new Description('Description')); $fixture = new Covers(new Fqsen('\DateTime'), new Description('Description'));
@@ -82,7 +82,7 @@ class CoversTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getReference * @covers ::getReference
*/ */
public function testHasReferenceToFqsen() public function testHasReferenceToFqsen(): void
{ {
$expected = new Fqsen('\DateTime'); $expected = new Fqsen('\DateTime');
@@ -96,7 +96,7 @@ class CoversTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -110,7 +110,7 @@ class CoversTest extends TestCase
* @covers ::__toString * @covers ::__toString
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Covers(new Fqsen('\DateTime'), new Description('Description')); $fixture = new Covers(new Fqsen('\DateTime'), new Description('Description'));
@@ -126,7 +126,7 @@ class CoversTest extends TestCase
* @uses \phpDocumentor\Reflection\Fqsen * @uses \phpDocumentor\Reflection\Fqsen
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = m::mock(FqsenResolver::class); $resolver = m::mock(FqsenResolver::class);
@@ -150,7 +150,7 @@ class CoversTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfBodyIsNotEmpty() public function testFactoryMethodFailsIfBodyIsNotEmpty(): void
{ {
$this->assertNull(Covers::create('')); $this->assertNull(Covers::create(''));
} }
+6 -6
View File
@@ -28,7 +28,7 @@ class DeprecatedTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -38,7 +38,7 @@ class DeprecatedTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Deprecated('1.0', new Description('Description')); $fixture = new Deprecated('1.0', new Description('Description'));
@@ -53,7 +53,7 @@ class DeprecatedTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Deprecated('1.0', new Description('Description')); $fixture = new Deprecated('1.0', new Description('Description'));
@@ -65,7 +65,7 @@ class DeprecatedTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Deprecated('1.0', new Description('Description')); $fixture = new Deprecated('1.0', new Description('Description'));
@@ -146,7 +146,7 @@ class DeprecatedTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethodCreatesEmptyDeprecatedTag() public function testFactoryMethodCreatesEmptyDeprecatedTag(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$descriptionFactory->shouldReceive('create')->never(); $descriptionFactory->shouldReceive('create')->never();
@@ -162,7 +162,7 @@ class DeprecatedTest extends TestCase
* @covers ::create * @covers ::create
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated::__construct
*/ */
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex() public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex(): void
{ {
$this->assertEquals(new Deprecated(), Deprecated::create('dkhf<')); $this->assertEquals(new Deprecated(), Deprecated::create('dkhf<'));
} }
+7 -7
View File
@@ -15,7 +15,7 @@ class ExampleTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -26,7 +26,7 @@ class ExampleTest extends TestCase
* @covers ::getContent * @covers ::getContent
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
*/ */
public function testExampleWithoutContent() public function testExampleWithoutContent(): void
{ {
$tag = Example::create('"example1.php"'); $tag = Example::create('"example1.php"');
$this->assertEquals('"example1.php"', $tag->getContent()); $this->assertEquals('"example1.php"', $tag->getContent());
@@ -41,7 +41,7 @@ class ExampleTest extends TestCase
* @covers ::getDescription * @covers ::getDescription
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
*/ */
public function testWithDescription() public function testWithDescription(): void
{ {
$tag = Example::create('"example1.php" some text'); $tag = Example::create('"example1.php" some text');
$this->assertEquals('example1.php', $tag->getFilePath()); $this->assertEquals('example1.php', $tag->getFilePath());
@@ -55,7 +55,7 @@ class ExampleTest extends TestCase
* @covers ::getStartingLine * @covers ::getStartingLine
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
*/ */
public function testStartlineIsParsed() public function testStartlineIsParsed(): void
{ {
$tag = Example::create('"example1.php" 10'); $tag = Example::create('"example1.php" 10');
$this->assertEquals('example1.php', $tag->getFilePath()); $this->assertEquals('example1.php', $tag->getFilePath());
@@ -70,7 +70,7 @@ class ExampleTest extends TestCase
* @covers ::getDescription * @covers ::getDescription
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
*/ */
public function testAllowOmitingLineCount() public function testAllowOmitingLineCount(): void
{ {
$tag = Example::create('"example1.php" 10 some text'); $tag = Example::create('"example1.php" 10 some text');
$this->assertEquals('example1.php', $tag->getFilePath()); $this->assertEquals('example1.php', $tag->getFilePath());
@@ -86,7 +86,7 @@ class ExampleTest extends TestCase
* @covers ::getLineCount * @covers ::getLineCount
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
*/ */
public function testLengthIsParsed() public function testLengthIsParsed(): void
{ {
$tag = Example::create('"example1.php" 10 5'); $tag = Example::create('"example1.php" 10 5');
$this->assertEquals('example1.php', $tag->getFilePath()); $this->assertEquals('example1.php', $tag->getFilePath());
@@ -103,7 +103,7 @@ class ExampleTest extends TestCase
* @covers ::getDescription * @covers ::getDescription
* @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag
*/ */
public function testFullExample() public function testFullExample(): void
{ {
$tag = Example::create('"example1.php" 10 5 test text'); $tag = Example::create('"example1.php" 10 5 test text');
$this->assertEquals('example1.php', $tag->getFilePath()); $this->assertEquals('example1.php', $tag->getFilePath());
@@ -30,7 +30,7 @@ class AlignFormatterTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -45,7 +45,7 @@ class AlignFormatterTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Version * @uses \phpDocumentor\Reflection\DocBlock\Tags\Version
* @uses \phpDocumentor\Reflection\Types\String_ * @uses \phpDocumentor\Reflection\Types\String_
*/ */
public function testFormatterCallsToStringAndReturnsAStandardRepresentation() public function testFormatterCallsToStringAndReturnsAStandardRepresentation(): void
{ {
$tags = [ $tags = [
new Param('foobar', new String_()), new Param('foobar', new String_()),
@@ -26,7 +26,7 @@ class PassthroughFormatterTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -37,7 +37,7 @@ class PassthroughFormatterTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic
*/ */
public function testFormatterCallsToStringAndReturnsAStandardRepresentation() public function testFormatterCallsToStringAndReturnsAStandardRepresentation(): void
{ {
$expected = '@unknown-tag This is a description'; $expected = '@unknown-tag This is a description';
@@ -55,7 +55,7 @@ class PassthroughFormatterTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic
*/ */
public function testFormatterToStringWitoutDescription() public function testFormatterToStringWitoutDescription(): void
{ {
$expected = '@unknown-tag'; $expected = '@unknown-tag';
$fixture = new PassthroughFormatter(); $fixture = new PassthroughFormatter();
+9 -9
View File
@@ -28,7 +28,7 @@ class GenericTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -37,7 +37,7 @@ class GenericTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Generic('generic', new Description('Description')); $fixture = new Generic('generic', new Description('Description'));
@@ -52,7 +52,7 @@ class GenericTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Generic('generic', new Description('Description')); $fixture = new Generic('generic', new Description('Description'));
@@ -64,7 +64,7 @@ class GenericTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Generic('generic', new Description('Description')); $fixture = new Generic('generic', new Description('Description'));
@@ -79,7 +79,7 @@ class GenericTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -94,7 +94,7 @@ class GenericTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Generic('generic', new Description('Description')); $fixture = new Generic('generic', new Description('Description'));
@@ -108,7 +108,7 @@ class GenericTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context(''); $context = new Context('');
@@ -129,7 +129,7 @@ class GenericTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfNameIsNotEmpty() public function testFactoryMethodFailsIfNameIsNotEmpty(): void
{ {
Generic::create('', ''); Generic::create('', '');
} }
@@ -139,7 +139,7 @@ class GenericTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfNameContainsIllegalCharacters() public function testFactoryMethodFailsIfNameContainsIllegalCharacters(): void
{ {
Generic::create('', 'name/myname'); Generic::create('', 'name/myname');
} }
+9 -9
View File
@@ -28,7 +28,7 @@ class LinkTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -38,7 +38,7 @@ class LinkTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Link('http://this.is.my/link', new Description('Description')); $fixture = new Link('http://this.is.my/link', new Description('Description'));
@@ -53,7 +53,7 @@ class LinkTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Link('http://this.is.my/link', new Description('Description')); $fixture = new Link('http://this.is.my/link', new Description('Description'));
@@ -65,7 +65,7 @@ class LinkTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Link('http://this.is.my/link', new Description('Description')); $fixture = new Link('http://this.is.my/link', new Description('Description'));
@@ -79,7 +79,7 @@ class LinkTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getLink * @covers ::getLink
*/ */
public function testHasLinkUrl() public function testHasLinkUrl(): void
{ {
$expected = 'http://this.is.my/link'; $expected = 'http://this.is.my/link';
@@ -93,7 +93,7 @@ class LinkTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -107,7 +107,7 @@ class LinkTest extends TestCase
* @covers ::__toString * @covers ::__toString
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Link('http://this.is.my/link', new Description('Description')); $fixture = new Link('http://this.is.my/link', new Description('Description'));
@@ -121,7 +121,7 @@ class LinkTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context(''); $context = new Context('');
@@ -145,7 +145,7 @@ class LinkTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethodCreatesEmptyLinkTag() public function testFactoryMethodCreatesEmptyLinkTag(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$descriptionFactory->shouldReceive('create')->never(); $descriptionFactory->shouldReceive('create')->never();
+30 -30
View File
@@ -37,7 +37,7 @@ class MethodTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -46,7 +46,7 @@ class MethodTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Method('myMethod'); $fixture = new Method('myMethod');
@@ -62,7 +62,7 @@ class MethodTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$arguments = [ $arguments = [
['name' => 'argument1', 'type' => new String_()], ['name' => 'argument1', 'type' => new String_()],
@@ -81,7 +81,7 @@ class MethodTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Method('myMethod'); $fixture = new Method('myMethod');
@@ -95,7 +95,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getMethodName * @covers ::getMethodName
*/ */
public function testHasMethodName() public function testHasMethodName(): void
{ {
$expected = 'myMethod'; $expected = 'myMethod';
@@ -108,7 +108,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getArguments * @covers ::getArguments
*/ */
public function testHasArguments() public function testHasArguments(): void
{ {
$arguments = [ $arguments = [
[ 'name' => 'argument1', 'type' => new String_() ] [ 'name' => 'argument1', 'type' => new String_() ]
@@ -123,7 +123,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getArguments * @covers ::getArguments
*/ */
public function testArgumentsMayBePassedAsString() public function testArgumentsMayBePassedAsString(): void
{ {
$arguments = ['argument1']; $arguments = ['argument1'];
$expected = [ $expected = [
@@ -139,7 +139,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getArguments * @covers ::getArguments
*/ */
public function testArgumentTypeCanBeInferredAsVoid() public function testArgumentTypeCanBeInferredAsVoid(): void
{ {
$arguments = [ [ 'name' => 'argument1' ] ]; $arguments = [ [ 'name' => 'argument1' ] ];
$expected = [ $expected = [
@@ -157,7 +157,7 @@ class MethodTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::getArguments * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::getArguments
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testRestArgumentIsParsedAsRegularArg() public function testRestArgumentIsParsedAsRegularArg(): void
{ {
$expected = [ $expected = [
[ 'name' => 'arg1', 'type' => new Void_() ], [ 'name' => 'arg1', 'type' => new Void_() ],
@@ -185,7 +185,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getReturnType * @covers ::getReturnType
*/ */
public function testHasReturnType() public function testHasReturnType(): void
{ {
$expected = new String_(); $expected = new String_();
@@ -198,7 +198,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getReturnType * @covers ::getReturnType
*/ */
public function testReturnTypeCanBeInferredAsVoid() public function testReturnTypeCanBeInferredAsVoid(): void
{ {
$fixture = new Method('myMethod', []); $fixture = new Method('myMethod', []);
@@ -209,7 +209,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::isStatic * @covers ::isStatic
*/ */
public function testMethodCanBeStatic() public function testMethodCanBeStatic(): void
{ {
$expected = false; $expected = false;
$fixture = new Method('myMethod', [], null, $expected); $fixture = new Method('myMethod', [], null, $expected);
@@ -225,7 +225,7 @@ class MethodTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -240,7 +240,7 @@ class MethodTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::isStatic * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::isStatic
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$arguments = [ $arguments = [
['name' => 'argument1', 'type' => new String_()], ['name' => 'argument1', 'type' => new String_()],
@@ -263,7 +263,7 @@ class MethodTest extends TestCase
* @uses \phpDocumentor\Reflection\Fqsen * @uses \phpDocumentor\Reflection\Fqsen
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver(); $resolver = new TypeResolver();
@@ -298,7 +298,7 @@ class MethodTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testReturnTypeThis() public function testReturnTypeThis(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver(); $resolver = new TypeResolver();
@@ -347,9 +347,9 @@ class MethodTest extends TestCase
public function testCollectionReturnTypes( public function testCollectionReturnTypes(
string $returnType, string $returnType,
string $expectedType, string $expectedType,
string $expectedValueType = null, ?string $expectedValueType = null,
string $expectedKeyType = null ?string $expectedKeyType = null
) { ): void {
$resolver = new TypeResolver(); $resolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$descriptionFactory->shouldReceive('create')->with('', null)->andReturn(new Description('')); $descriptionFactory->shouldReceive('create')->with('', null)->andReturn(new Description(''));
@@ -368,7 +368,7 @@ class MethodTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfBodyIsEmpty() public function testFactoryMethodFailsIfBodyIsEmpty(): void
{ {
Method::create(''); Method::create('');
} }
@@ -377,7 +377,7 @@ class MethodTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodReturnsNullIfBodyIsIncorrect() public function testFactoryMethodReturnsNullIfBodyIsIncorrect(): void
{ {
$this->assertNull(Method::create('body(')); $this->assertNull(Method::create('body('));
} }
@@ -386,7 +386,7 @@ class MethodTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfResolverIsNull() public function testFactoryMethodFailsIfResolverIsNull(): void
{ {
Method::create('body'); Method::create('body');
} }
@@ -395,7 +395,7 @@ class MethodTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
Method::create('body', new TypeResolver()); Method::create('body', new TypeResolver());
} }
@@ -404,7 +404,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testCreationFailsIfBodyIsNotString() public function testCreationFailsIfBodyIsNotString(): void
{ {
new Method([]); new Method([]);
} }
@@ -413,7 +413,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testCreationFailsIfBodyIsEmpty() public function testCreationFailsIfBodyIsEmpty(): void
{ {
new Method(''); new Method('');
} }
@@ -422,7 +422,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testCreationFailsIfStaticIsNotBoolean() public function testCreationFailsIfStaticIsNotBoolean(): void
{ {
new Method('body', [], null, []); new Method('body', [], null, []);
} }
@@ -431,7 +431,7 @@ class MethodTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testCreationFailsIfArgumentRecordContainsInvalidEntry() public function testCreationFailsIfArgumentRecordContainsInvalidEntry(): void
{ {
new Method('body', [ [ 'name' => 'myName', 'unknown' => 'nah' ] ]); new Method('body', [ [ 'name' => 'myName', 'unknown' => 'nah' ] ]);
} }
@@ -445,7 +445,7 @@ class MethodTest extends TestCase
* @uses \phpDocumentor\Reflection\Fqsen * @uses \phpDocumentor\Reflection\Fqsen
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testCreateMethodParenthesisMissing() public function testCreateMethodParenthesisMissing(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver(); $resolver = new TypeResolver();
@@ -479,7 +479,7 @@ class MethodTest extends TestCase
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
* @uses \phpDocumentor\Reflection\Types\Void_ * @uses \phpDocumentor\Reflection\Types\Void_
*/ */
public function testCreateWithoutReturnType() public function testCreateWithoutReturnType(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver(); $resolver = new TypeResolver();
@@ -516,7 +516,7 @@ class MethodTest extends TestCase
* @uses \phpDocumentor\Reflection\Types\Integer * @uses \phpDocumentor\Reflection\Types\Integer
* @uses \phpDocumentor\Reflection\Types\Object_ * @uses \phpDocumentor\Reflection\Types\Object_
*/ */
public function testCreateWithMixedReturnTypes() public function testCreateWithMixedReturnTypes(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver(); $resolver = new TypeResolver();
+13 -13
View File
@@ -30,7 +30,7 @@ class ParamTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -40,7 +40,7 @@ class ParamTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Param('myParameter', null, false, new Description('Description')); $fixture = new Param('myParameter', null, false, new Description('Description'));
@@ -56,7 +56,7 @@ class ParamTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Param('myParameter', new String_(), true, new Description('Description')); $fixture = new Param('myParameter', new String_(), true, new Description('Description'));
$this->assertSame('@param string ...$myParameter Description', $fixture->render()); $this->assertSame('@param string ...$myParameter Description', $fixture->render());
@@ -75,7 +75,7 @@ class ParamTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Param::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Param('myParameter'); $fixture = new Param('myParameter');
@@ -89,7 +89,7 @@ class ParamTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getVariableName * @covers ::getVariableName
*/ */
public function testHasVariableName() public function testHasVariableName(): void
{ {
$expected = 'myParameter'; $expected = 'myParameter';
@@ -102,7 +102,7 @@ class ParamTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getType * @covers ::getType
*/ */
public function testHasType() public function testHasType(): void
{ {
$expected = new String_(); $expected = new String_();
@@ -115,7 +115,7 @@ class ParamTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::isVariadic * @covers ::isVariadic
*/ */
public function testIfParameterIsVariadic() public function testIfParameterIsVariadic(): void
{ {
$fixture = new Param('myParameter', new String_(), false); $fixture = new Param('myParameter', new String_(), false);
$this->assertFalse($fixture->isVariadic()); $this->assertFalse($fixture->isVariadic());
@@ -129,7 +129,7 @@ class ParamTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -145,7 +145,7 @@ class ParamTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\String_ * @uses \phpDocumentor\Reflection\Types\String_
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Param('myParameter', new String_(), true, new Description('Description')); $fixture = new Param('myParameter', new String_(), true, new Description('Description'));
@@ -159,7 +159,7 @@ class ParamTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$typeResolver = new TypeResolver(); $typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
@@ -184,7 +184,7 @@ class ParamTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfEmptyBodyIsGiven() public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
Param::create('', new TypeResolver(), $descriptionFactory); Param::create('', new TypeResolver(), $descriptionFactory);
@@ -194,7 +194,7 @@ class ParamTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfResolverIsNull() public function testFactoryMethodFailsIfResolverIsNull(): void
{ {
Param::create('body'); Param::create('body');
} }
@@ -204,7 +204,7 @@ class ParamTest extends TestCase
* @uses \phpDocumentor\Reflection\TypeResolver * @uses \phpDocumentor\Reflection\TypeResolver
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
Param::create('body', new TypeResolver()); Param::create('body', new TypeResolver());
} }
+12 -12
View File
@@ -30,7 +30,7 @@ class PropertyReadTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -40,7 +40,7 @@ class PropertyReadTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new PropertyRead('myProperty', null, new Description('Description')); $fixture = new PropertyRead('myProperty', null, new Description('Description'));
@@ -55,7 +55,7 @@ class PropertyReadTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new PropertyRead('myProperty', new String_(), new Description('Description')); $fixture = new PropertyRead('myProperty', new String_(), new Description('Description'));
$this->assertSame('@property-read string $myProperty Description', $fixture->render()); $this->assertSame('@property-read string $myProperty Description', $fixture->render());
@@ -71,7 +71,7 @@ class PropertyReadTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new PropertyRead('myProperty'); $fixture = new PropertyRead('myProperty');
@@ -85,7 +85,7 @@ class PropertyReadTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getVariableName * @covers ::getVariableName
*/ */
public function testHasVariableName() public function testHasVariableName(): void
{ {
$expected = 'myProperty'; $expected = 'myProperty';
@@ -98,7 +98,7 @@ class PropertyReadTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getType * @covers ::getType
*/ */
public function testHasType() public function testHasType(): void
{ {
$expected = new String_(); $expected = new String_();
@@ -112,7 +112,7 @@ class PropertyReadTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -127,7 +127,7 @@ class PropertyReadTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\String_ * @uses \phpDocumentor\Reflection\Types\String_
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new PropertyRead('myProperty', new String_(), new Description('Description')); $fixture = new PropertyRead('myProperty', new String_(), new Description('Description'));
@@ -141,7 +141,7 @@ class PropertyReadTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$typeResolver = new TypeResolver(); $typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
@@ -170,7 +170,7 @@ class PropertyReadTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfEmptyBodyIsGiven() public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
PropertyRead::create('', new TypeResolver(), $descriptionFactory); PropertyRead::create('', new TypeResolver(), $descriptionFactory);
@@ -180,7 +180,7 @@ class PropertyReadTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfResolverIsNull() public function testFactoryMethodFailsIfResolverIsNull(): void
{ {
PropertyRead::create('body'); PropertyRead::create('body');
} }
@@ -190,7 +190,7 @@ class PropertyReadTest extends TestCase
* @uses \phpDocumentor\Reflection\TypeResolver * @uses \phpDocumentor\Reflection\TypeResolver
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
PropertyRead::create('body', new TypeResolver()); PropertyRead::create('body', new TypeResolver());
} }
+12 -12
View File
@@ -30,7 +30,7 @@ class PropertyTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -40,7 +40,7 @@ class PropertyTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Property('myProperty', null, new Description('Description')); $fixture = new Property('myProperty', null, new Description('Description'));
@@ -55,7 +55,7 @@ class PropertyTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Property('myProperty', new String_(), new Description('Description')); $fixture = new Property('myProperty', new String_(), new Description('Description'));
$this->assertSame('@property string $myProperty Description', $fixture->render()); $this->assertSame('@property string $myProperty Description', $fixture->render());
@@ -71,7 +71,7 @@ class PropertyTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Property::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\Property::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Property('myProperty'); $fixture = new Property('myProperty');
@@ -85,7 +85,7 @@ class PropertyTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getVariableName * @covers ::getVariableName
*/ */
public function testHasVariableName() public function testHasVariableName(): void
{ {
$expected = 'myProperty'; $expected = 'myProperty';
@@ -98,7 +98,7 @@ class PropertyTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getType * @covers ::getType
*/ */
public function testHasType() public function testHasType(): void
{ {
$expected = new String_(); $expected = new String_();
@@ -112,7 +112,7 @@ class PropertyTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -127,7 +127,7 @@ class PropertyTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\String_ * @uses \phpDocumentor\Reflection\Types\String_
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Property('myProperty', new String_(), new Description('Description')); $fixture = new Property('myProperty', new String_(), new Description('Description'));
@@ -141,7 +141,7 @@ class PropertyTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$typeResolver = new TypeResolver(); $typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
@@ -165,7 +165,7 @@ class PropertyTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfEmptyBodyIsGiven() public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
Property::create('', new TypeResolver(), $descriptionFactory); Property::create('', new TypeResolver(), $descriptionFactory);
@@ -175,7 +175,7 @@ class PropertyTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfResolverIsNull() public function testFactoryMethodFailsIfResolverIsNull(): void
{ {
Property::create('body'); Property::create('body');
} }
@@ -185,7 +185,7 @@ class PropertyTest extends TestCase
* @uses \phpDocumentor\Reflection\TypeResolver * @uses \phpDocumentor\Reflection\TypeResolver
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
Property::create('body', new TypeResolver()); Property::create('body', new TypeResolver());
} }
+12 -12
View File
@@ -30,7 +30,7 @@ class PropertyWriteTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -40,7 +40,7 @@ class PropertyWriteTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new PropertyWrite('myProperty', null, new Description('Description')); $fixture = new PropertyWrite('myProperty', null, new Description('Description'));
@@ -55,7 +55,7 @@ class PropertyWriteTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new PropertyWrite('myProperty', new String_(), new Description('Description')); $fixture = new PropertyWrite('myProperty', new String_(), new Description('Description'));
$this->assertSame('@property-write string $myProperty Description', $fixture->render()); $this->assertSame('@property-write string $myProperty Description', $fixture->render());
@@ -71,7 +71,7 @@ class PropertyWriteTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new PropertyWrite('myProperty'); $fixture = new PropertyWrite('myProperty');
@@ -85,7 +85,7 @@ class PropertyWriteTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getVariableName * @covers ::getVariableName
*/ */
public function testHasVariableName() public function testHasVariableName(): void
{ {
$expected = 'myProperty'; $expected = 'myProperty';
@@ -98,7 +98,7 @@ class PropertyWriteTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getType * @covers ::getType
*/ */
public function testHasType() public function testHasType(): void
{ {
$expected = new String_(); $expected = new String_();
@@ -112,7 +112,7 @@ class PropertyWriteTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -127,7 +127,7 @@ class PropertyWriteTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\String_ * @uses \phpDocumentor\Reflection\Types\String_
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new PropertyWrite('myProperty', new String_(), new Description('Description')); $fixture = new PropertyWrite('myProperty', new String_(), new Description('Description'));
@@ -141,7 +141,7 @@ class PropertyWriteTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$typeResolver = new TypeResolver(); $typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
@@ -170,7 +170,7 @@ class PropertyWriteTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfEmptyBodyIsGiven() public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
PropertyWrite::create('', new TypeResolver(), $descriptionFactory); PropertyWrite::create('', new TypeResolver(), $descriptionFactory);
@@ -180,7 +180,7 @@ class PropertyWriteTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfResolverIsNull() public function testFactoryMethodFailsIfResolverIsNull(): void
{ {
PropertyWrite::create('body'); PropertyWrite::create('body');
} }
@@ -190,7 +190,7 @@ class PropertyWriteTest extends TestCase
* @uses \phpDocumentor\Reflection\TypeResolver * @uses \phpDocumentor\Reflection\TypeResolver
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
PropertyWrite::create('body', new TypeResolver()); PropertyWrite::create('body', new TypeResolver());
} }
+11 -11
View File
@@ -30,7 +30,7 @@ class ReturnTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -40,7 +40,7 @@ class ReturnTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Return_(new String_(), new Description('Description')); $fixture = new Return_(new String_(), new Description('Description'));
@@ -55,7 +55,7 @@ class ReturnTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Return_(new String_(), new Description('Description')); $fixture = new Return_(new String_(), new Description('Description'));
@@ -67,7 +67,7 @@ class ReturnTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Return_(new String_(), new Description('Description')); $fixture = new Return_(new String_(), new Description('Description'));
@@ -81,7 +81,7 @@ class ReturnTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getType * @covers ::getType
*/ */
public function testHasType() public function testHasType(): void
{ {
$expected = new String_(); $expected = new String_();
@@ -95,7 +95,7 @@ class ReturnTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -109,7 +109,7 @@ class ReturnTest extends TestCase
* @covers ::__toString * @covers ::__toString
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Return_(new String_(), new Description('Description')); $fixture = new Return_(new String_(), new Description('Description'));
@@ -125,7 +125,7 @@ class ReturnTest extends TestCase
* @uses \phpDocumentor\Reflection\Types\String_ * @uses \phpDocumentor\Reflection\Types\String_
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver(); $resolver = new TypeResolver();
@@ -146,7 +146,7 @@ class ReturnTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfBodyIsNotEmpty() public function testFactoryMethodFailsIfBodyIsNotEmpty(): void
{ {
$this->assertNull(Return_::create('')); $this->assertNull(Return_::create(''));
} }
@@ -155,7 +155,7 @@ class ReturnTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfResolverIsNull() public function testFactoryMethodFailsIfResolverIsNull(): void
{ {
Return_::create('body'); Return_::create('body');
} }
@@ -164,7 +164,7 @@ class ReturnTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
Return_::create('body', new TypeResolver()); Return_::create('body', new TypeResolver());
} }
+12 -12
View File
@@ -32,7 +32,7 @@ class SeeTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -44,7 +44,7 @@ class SeeTest extends TestCase
* @uses \phpDocumentor\Reflection\Fqsen * @uses \phpDocumentor\Reflection\Fqsen
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new See(new FqsenRef(new Fqsen('\DateTime')), new Description('Description')); $fixture = new See(new FqsenRef(new Fqsen('\DateTime')), new Description('Description'));
@@ -60,7 +60,7 @@ class SeeTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new See(new FqsenRef(new Fqsen('\DateTime')), new Description('Description')); $fixture = new See(new FqsenRef(new Fqsen('\DateTime')), new Description('Description'));
@@ -74,7 +74,7 @@ class SeeTest extends TestCase
* @uses \phpDocumentor\Reflection\Fqsen * @uses \phpDocumentor\Reflection\Fqsen
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new See(new FqsenRef(new Fqsen('\DateTime')), new Description('Description')); $fixture = new See(new FqsenRef(new Fqsen('\DateTime')), new Description('Description'));
@@ -90,7 +90,7 @@ class SeeTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getReference * @covers ::getReference
*/ */
public function testHasReferenceToFqsen() public function testHasReferenceToFqsen(): void
{ {
$expected = new FqsenRef(new Fqsen('\DateTime')); $expected = new FqsenRef(new Fqsen('\DateTime'));
@@ -106,7 +106,7 @@ class SeeTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen * @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen
* @uses \phpDocumentor\Reflection\Fqsen * @uses \phpDocumentor\Reflection\Fqsen
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -122,7 +122,7 @@ class SeeTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen * @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen
* @uses \phpDocumentor\Reflection\Fqsen * @uses \phpDocumentor\Reflection\Fqsen
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new See(new FqsenRef(new Fqsen('\DateTime::format()')), new Description('Description')); $fixture = new See(new FqsenRef(new Fqsen('\DateTime::format()')), new Description('Description'));
@@ -139,7 +139,7 @@ class SeeTest extends TestCase
* @uses \phpDocumentor\Reflection\Fqsen * @uses \phpDocumentor\Reflection\Fqsen
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = m::mock(FqsenResolver::class); $resolver = m::mock(FqsenResolver::class);
@@ -169,7 +169,7 @@ class SeeTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Url * @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Url
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethodWithUrl() public function testFactoryMethodWithUrl(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = m::mock(FqsenResolver::class); $resolver = m::mock(FqsenResolver::class);
@@ -194,7 +194,7 @@ class SeeTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfBodyIsNotEmpty() public function testFactoryMethodFailsIfBodyIsNotEmpty(): void
{ {
$this->assertNull(See::create('')); $this->assertNull(See::create(''));
} }
@@ -203,7 +203,7 @@ class SeeTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfResolverIsNull() public function testFactoryMethodFailsIfResolverIsNull(): void
{ {
See::create('body'); See::create('body');
} }
@@ -212,7 +212,7 @@ class SeeTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
See::create('body', new FqsenResolver()); See::create('body', new FqsenResolver());
} }
+10 -10
View File
@@ -29,7 +29,7 @@ class SinceTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -39,7 +39,7 @@ class SinceTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Since('1.0', new Description('Description')); $fixture = new Since('1.0', new Description('Description'));
@@ -54,7 +54,7 @@ class SinceTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Since('1.0', new Description('Description')); $fixture = new Since('1.0', new Description('Description'));
@@ -66,7 +66,7 @@ class SinceTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Since('1.0', new Description('Description')); $fixture = new Since('1.0', new Description('Description'));
@@ -80,7 +80,7 @@ class SinceTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getVersion * @covers ::getVersion
*/ */
public function testHasVersionNumber() public function testHasVersionNumber(): void
{ {
$expected = '1.0'; $expected = '1.0';
@@ -94,7 +94,7 @@ class SinceTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -108,7 +108,7 @@ class SinceTest extends TestCase
* @covers ::__toString * @covers ::__toString
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Since('1.0', new Description('Description')); $fixture = new Since('1.0', new Description('Description'));
@@ -122,7 +122,7 @@ class SinceTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context(''); $context = new Context('');
@@ -146,7 +146,7 @@ class SinceTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethodCreatesEmptySinceTag() public function testFactoryMethodCreatesEmptySinceTag(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$descriptionFactory->shouldReceive('create')->never(); $descriptionFactory->shouldReceive('create')->never();
@@ -161,7 +161,7 @@ class SinceTest extends TestCase
/** /**
* @covers ::create * @covers ::create
*/ */
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex() public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex(): void
{ {
$this->assertNull(Since::create('dkhf<')); $this->assertNull(Since::create('dkhf<'));
} }
+13 -13
View File
@@ -28,7 +28,7 @@ class SourceTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -38,7 +38,7 @@ class SourceTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Source(1, null, new Description('Description')); $fixture = new Source(1, null, new Description('Description'));
@@ -53,7 +53,7 @@ class SourceTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Source(1, 10, new Description('Description')); $fixture = new Source(1, 10, new Description('Description'));
$this->assertSame('@source 1 10 Description', $fixture->render()); $this->assertSame('@source 1 10 Description', $fixture->render());
@@ -69,7 +69,7 @@ class SourceTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Source::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\Source::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Source(1); $fixture = new Source(1);
@@ -83,7 +83,7 @@ class SourceTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getStartingLine * @covers ::getStartingLine
*/ */
public function testHasStartingLine() public function testHasStartingLine(): void
{ {
$expected = 1; $expected = 1;
@@ -96,7 +96,7 @@ class SourceTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getLineCount * @covers ::getLineCount
*/ */
public function testHasLineCount() public function testHasLineCount(): void
{ {
$expected = 2; $expected = 2;
@@ -110,7 +110,7 @@ class SourceTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -125,7 +125,7 @@ class SourceTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\String_ * @uses \phpDocumentor\Reflection\Types\String_
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Source(1, 10, new Description('Description')); $fixture = new Source(1, 10, new Description('Description'));
@@ -139,7 +139,7 @@ class SourceTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context(''); $context = new Context('');
@@ -162,7 +162,7 @@ class SourceTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfEmptyBodyIsGiven() public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
Source::create('', $descriptionFactory); Source::create('', $descriptionFactory);
@@ -173,7 +173,7 @@ class SourceTest extends TestCase
* @uses \phpDocumentor\Reflection\TypeResolver * @uses \phpDocumentor\Reflection\TypeResolver
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
Source::create('1'); Source::create('1');
} }
@@ -182,7 +182,7 @@ class SourceTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testExceptionIsThrownIfStartingLineIsNotInteger() public function testExceptionIsThrownIfStartingLineIsNotInteger(): void
{ {
new Source('blabla'); new Source('blabla');
} }
@@ -191,7 +191,7 @@ class SourceTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testExceptionIsThrownIfLineCountIsNotIntegerOrNull() public function testExceptionIsThrownIfLineCountIsNotIntegerOrNull(): void
{ {
new Source('1', []); new Source('1', []);
} }
+11 -11
View File
@@ -30,7 +30,7 @@ class ThrowsTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -40,7 +40,7 @@ class ThrowsTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Throws(new String_(), new Description('Description')); $fixture = new Throws(new String_(), new Description('Description'));
@@ -55,7 +55,7 @@ class ThrowsTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Throws(new String_(), new Description('Description')); $fixture = new Throws(new String_(), new Description('Description'));
@@ -67,7 +67,7 @@ class ThrowsTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Throws(new String_(), new Description('Description')); $fixture = new Throws(new String_(), new Description('Description'));
@@ -81,7 +81,7 @@ class ThrowsTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getType * @covers ::getType
*/ */
public function testHasType() public function testHasType(): void
{ {
$expected = new String_(); $expected = new String_();
@@ -95,7 +95,7 @@ class ThrowsTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -109,7 +109,7 @@ class ThrowsTest extends TestCase
* @covers ::__toString * @covers ::__toString
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Throws(new String_(), new Description('Description')); $fixture = new Throws(new String_(), new Description('Description'));
@@ -125,7 +125,7 @@ class ThrowsTest extends TestCase
* @uses \phpDocumentor\Reflection\Types\String_ * @uses \phpDocumentor\Reflection\Types\String_
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver(); $resolver = new TypeResolver();
@@ -146,7 +146,7 @@ class ThrowsTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfBodyIsNotEmpty() public function testFactoryMethodFailsIfBodyIsNotEmpty(): void
{ {
$this->assertNull(Throws::create('')); $this->assertNull(Throws::create(''));
} }
@@ -155,7 +155,7 @@ class ThrowsTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfResolverIsNull() public function testFactoryMethodFailsIfResolverIsNull(): void
{ {
Throws::create('body'); Throws::create('body');
} }
@@ -164,7 +164,7 @@ class ThrowsTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
Throws::create('body', new TypeResolver()); Throws::create('body', new TypeResolver());
} }
+11 -11
View File
@@ -30,7 +30,7 @@ class UsesTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -40,7 +40,7 @@ class UsesTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Uses(new Fqsen('\DateTime'), new Description('Description')); $fixture = new Uses(new Fqsen('\DateTime'), new Description('Description'));
@@ -55,7 +55,7 @@ class UsesTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Uses(new Fqsen('\DateTime'), new Description('Description')); $fixture = new Uses(new Fqsen('\DateTime'), new Description('Description'));
@@ -67,7 +67,7 @@ class UsesTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Uses(new Fqsen('\DateTime'), new Description('Description')); $fixture = new Uses(new Fqsen('\DateTime'), new Description('Description'));
@@ -81,7 +81,7 @@ class UsesTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getReference * @covers ::getReference
*/ */
public function testHasReferenceToFqsen() public function testHasReferenceToFqsen(): void
{ {
$expected = new Fqsen('\DateTime'); $expected = new Fqsen('\DateTime');
@@ -95,7 +95,7 @@ class UsesTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -109,7 +109,7 @@ class UsesTest extends TestCase
* @covers ::__toString * @covers ::__toString
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Uses(new Fqsen('\DateTime'), new Description('Description')); $fixture = new Uses(new Fqsen('\DateTime'), new Description('Description'));
@@ -125,7 +125,7 @@ class UsesTest extends TestCase
* @uses \phpDocumentor\Reflection\Fqsen * @uses \phpDocumentor\Reflection\Fqsen
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = m::mock(FqsenResolver::class); $resolver = m::mock(FqsenResolver::class);
@@ -149,7 +149,7 @@ class UsesTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfBodyIsNotEmpty() public function testFactoryMethodFailsIfBodyIsNotEmpty(): void
{ {
$this->assertNull(Uses::create('')); $this->assertNull(Uses::create(''));
} }
@@ -158,7 +158,7 @@ class UsesTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfResolverIsNull() public function testFactoryMethodFailsIfResolverIsNull(): void
{ {
Uses::create('body'); Uses::create('body');
} }
@@ -167,7 +167,7 @@ class UsesTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
Uses::create('body', new FqsenResolver()); Uses::create('body', new FqsenResolver());
} }
+13 -13
View File
@@ -30,7 +30,7 @@ class VarTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -40,7 +40,7 @@ class VarTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Var_('myVariable', null, new Description('Description')); $fixture = new Var_('myVariable', null, new Description('Description'));
@@ -51,7 +51,7 @@ class VarTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfVariableNameIsOmmitedIfEmpty() public function testIfVariableNameIsOmmitedIfEmpty(): void
{ {
$fixture = new Var_('', null, null); $fixture = new Var_('', null, null);
@@ -66,7 +66,7 @@ class VarTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Var_('myVariable', new String_(), new Description('Description')); $fixture = new Var_('myVariable', new String_(), new Description('Description'));
$this->assertSame('@var string $myVariable Description', $fixture->render()); $this->assertSame('@var string $myVariable Description', $fixture->render());
@@ -82,7 +82,7 @@ class VarTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__construct * @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Var_('myVariable'); $fixture = new Var_('myVariable');
@@ -96,7 +96,7 @@ class VarTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getVariableName * @covers ::getVariableName
*/ */
public function testHasVariableName() public function testHasVariableName(): void
{ {
$expected = 'myVariable'; $expected = 'myVariable';
@@ -109,7 +109,7 @@ class VarTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getType * @covers ::getType
*/ */
public function testHasType() public function testHasType(): void
{ {
$expected = new String_(); $expected = new String_();
@@ -123,7 +123,7 @@ class VarTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -138,7 +138,7 @@ class VarTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\String_ * @uses \phpDocumentor\Reflection\Types\String_
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Var_('myVariable', new String_(), new Description('Description')); $fixture = new Var_('myVariable', new String_(), new Description('Description'));
@@ -152,7 +152,7 @@ class VarTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$typeResolver = new TypeResolver(); $typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
@@ -176,7 +176,7 @@ class VarTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfEmptyBodyIsGiven() public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
Var_::create('', new TypeResolver(), $descriptionFactory); Var_::create('', new TypeResolver(), $descriptionFactory);
@@ -186,7 +186,7 @@ class VarTest extends TestCase
* @covers ::create * @covers ::create
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfResolverIsNull() public function testFactoryMethodFailsIfResolverIsNull(): void
{ {
Var_::create('body'); Var_::create('body');
} }
@@ -196,7 +196,7 @@ class VarTest extends TestCase
* @uses \phpDocumentor\Reflection\TypeResolver * @uses \phpDocumentor\Reflection\TypeResolver
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{ {
Var_::create('body', new TypeResolver()); Var_::create('body', new TypeResolver());
} }
+10 -10
View File
@@ -28,7 +28,7 @@ class VersionTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -38,7 +38,7 @@ class VersionTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfCorrectTagNameIsReturned() public function testIfCorrectTagNameIsReturned(): void
{ {
$fixture = new Version('1.0', new Description('Description')); $fixture = new Version('1.0', new Description('Description'));
@@ -53,7 +53,7 @@ class VersionTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/ */
public function testIfTagCanBeRenderedUsingDefaultFormatter() public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{ {
$fixture = new Version('1.0', new Description('Description')); $fixture = new Version('1.0', new Description('Description'));
@@ -65,7 +65,7 @@ class VersionTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/ */
public function testIfTagCanBeRenderedUsingSpecificFormatter() public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{ {
$fixture = new Version('1.0', new Description('Description')); $fixture = new Version('1.0', new Description('Description'));
@@ -79,7 +79,7 @@ class VersionTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @covers ::getVersion * @covers ::getVersion
*/ */
public function testHasVersionNumber() public function testHasVersionNumber(): void
{ {
$expected = '1.0'; $expected = '1.0';
@@ -93,7 +93,7 @@ class VersionTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testHasDescription() public function testHasDescription(): void
{ {
$expected = new Description('Description'); $expected = new Description('Description');
@@ -107,7 +107,7 @@ class VersionTest extends TestCase
* @covers ::__toString * @covers ::__toString
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testStringRepresentationIsReturned() public function testStringRepresentationIsReturned(): void
{ {
$fixture = new Version('1.0', new Description('Description')); $fixture = new Version('1.0', new Description('Description'));
@@ -121,7 +121,7 @@ class VersionTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethod() public function testFactoryMethod(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context(''); $context = new Context('');
@@ -145,7 +145,7 @@ class VersionTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testFactoryMethodCreatesEmptyVersionTag() public function testFactoryMethodCreatesEmptyVersionTag(): void
{ {
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
$descriptionFactory->shouldReceive('create')->never(); $descriptionFactory->shouldReceive('create')->never();
@@ -160,7 +160,7 @@ class VersionTest extends TestCase
/** /**
* @covers ::create * @covers ::create
*/ */
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex() public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex(): void
{ {
$this->assertNull(Version::create('dkhf<')); $this->assertNull(Version::create('dkhf<'));
} }
+10 -10
View File
@@ -33,7 +33,7 @@ class DocBlockFactoryTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -44,7 +44,7 @@ class DocBlockFactoryTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\StandardTagFactory * @uses \phpDocumentor\Reflection\DocBlock\StandardTagFactory
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
*/ */
public function testCreateFactoryUsingFactoryMethod() public function testCreateFactoryUsingFactoryMethod(): void
{ {
$fixture = DocBlockFactory::createInstance(); $fixture = DocBlockFactory::createInstance();
@@ -56,7 +56,7 @@ class DocBlockFactoryTest extends TestCase
* @covers ::create * @covers ::create
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testCreateDocBlockFromReflection() public function testCreateDocBlockFromReflection(): void
{ {
$fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class)); $fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class));
@@ -78,7 +78,7 @@ class DocBlockFactoryTest extends TestCase
* @covers ::create * @covers ::create
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testCreateDocBlockFromStringWithDocComment() public function testCreateDocBlockFromStringWithDocComment(): void
{ {
$fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class)); $fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class));
@@ -97,7 +97,7 @@ class DocBlockFactoryTest extends TestCase
* @covers ::__construct * @covers ::__construct
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testCreateDocBlockFromStringWithoutDocComment() public function testCreateDocBlockFromStringWithoutDocComment(): void
{ {
$fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class)); $fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class));
@@ -118,7 +118,7 @@ class DocBlockFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
* @dataProvider provideSummaryAndDescriptions * @dataProvider provideSummaryAndDescriptions
*/ */
public function testSummaryAndDescriptionAreSeparated($given, $summary, $description) public function testSummaryAndDescriptionAreSeparated($given, $summary, $description): void
{ {
$tagFactory = m::mock(TagFactory::class); $tagFactory = m::mock(TagFactory::class);
$fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory); $fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory);
@@ -135,7 +135,7 @@ class DocBlockFactoryTest extends TestCase
* @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory * @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testDescriptionsRetainFormatting() public function testDescriptionsRetainFormatting(): void
{ {
$tagFactory = m::mock(TagFactory::class); $tagFactory = m::mock(TagFactory::class);
$fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory); $fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory);
@@ -168,7 +168,7 @@ DESCRIPTION;
* @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory * @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testTagsAreInterpretedUsingFactory() public function testTagsAreInterpretedUsingFactory(): void
{ {
$tagString = <<<TAG $tagString = <<<TAG
@author Mike van Riel <me@mikevanriel.com> This is with @author Mike van Riel <me@mikevanriel.com> This is with
@@ -255,7 +255,7 @@ DOCBLOCK
* @uses phpDocumentor\Reflection\Types\Context * @uses phpDocumentor\Reflection\Types\Context
* @uses phpDocumentor\Reflection\DocBlock\Tags\Param * @uses phpDocumentor\Reflection\DocBlock\Tags\Param
*/ */
public function testTagsWithContextNamespace() public function testTagsWithContextNamespace(): void
{ {
$tagFactoryMock = m::mock(TagFactory::class); $tagFactoryMock = m::mock(TagFactory::class);
$fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), $tagFactoryMock); $fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), $tagFactoryMock);
@@ -274,7 +274,7 @@ DOCBLOCK
* @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory * @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory
* @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testTagsAreFilteredForNullValues() public function testTagsAreFilteredForNullValues(): void
{ {
$tagString = <<<TAG $tagString = <<<TAG
@author Mike van Riel <me@mikevanriel.com> This is with @author Mike van Riel <me@mikevanriel.com> This is with
+12 -12
View File
@@ -28,7 +28,7 @@ class DocBlockTest extends TestCase
/** /**
* Call Mockery::close after each test. * Call Mockery::close after each test.
*/ */
public function tearDown() public function tearDown(): void
{ {
m::close(); m::close();
} }
@@ -39,7 +39,7 @@ class DocBlockTest extends TestCase
* *
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testDocBlockCanHaveASummary() public function testDocBlockCanHaveASummary(): void
{ {
$summary = 'This is a summary'; $summary = 'This is a summary';
@@ -54,7 +54,7 @@ class DocBlockTest extends TestCase
* *
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testDocBlockCanHaveADescription() public function testDocBlockCanHaveADescription(): void
{ {
$description = new DocBlock\Description(''); $description = new DocBlock\Description('');
@@ -70,7 +70,7 @@ class DocBlockTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tag * @uses \phpDocumentor\Reflection\DocBlock\Tag
*/ */
public function testDocBlockCanHaveTags() public function testDocBlockCanHaveTags(): void
{ {
$tags = [ $tags = [
m::mock(DocBlock\Tag::class) m::mock(DocBlock\Tag::class)
@@ -90,7 +90,7 @@ class DocBlockTest extends TestCase
* *
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testDocBlockAllowsOnlyTags() public function testDocBlockAllowsOnlyTags(): void
{ {
$tags = [ $tags = [
null null
@@ -107,7 +107,7 @@ class DocBlockTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tag * @uses \phpDocumentor\Reflection\DocBlock\Tag
*/ */
public function testFindTagsInDocBlockByName() public function testFindTagsInDocBlockByName(): void
{ {
$tag1 = m::mock(DocBlock\Tag::class); $tag1 = m::mock(DocBlock\Tag::class);
$tag2 = m::mock(DocBlock\Tag::class); $tag2 = m::mock(DocBlock\Tag::class);
@@ -132,7 +132,7 @@ class DocBlockTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tag * @uses \phpDocumentor\Reflection\DocBlock\Tag
*/ */
public function testCheckIfThereAreTagsWithAGivenName() public function testCheckIfThereAreTagsWithAGivenName(): void
{ {
$tag1 = m::mock(DocBlock\Tag::class); $tag1 = m::mock(DocBlock\Tag::class);
$tag2 = m::mock(DocBlock\Tag::class); $tag2 = m::mock(DocBlock\Tag::class);
@@ -156,7 +156,7 @@ class DocBlockTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context * @uses \phpDocumentor\Reflection\Types\Context
*/ */
public function testDocBlockKnowsInWhichNamespaceItIsAndWhichAliasesThereAre() public function testDocBlockKnowsInWhichNamespaceItIsAndWhichAliasesThereAre(): void
{ {
$context = new Context(''); $context = new Context('');
@@ -172,7 +172,7 @@ class DocBlockTest extends TestCase
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Location * @uses \phpDocumentor\Reflection\Location
*/ */
public function testDocBlockKnowsAtWhichLineItIs() public function testDocBlockKnowsAtWhichLineItIs(): void
{ {
$location = new Location(10); $location = new Location(10);
@@ -187,7 +187,7 @@ class DocBlockTest extends TestCase
* *
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testDocBlockKnowsIfItIsTheStartOfADocBlockTemplate() public function testDocBlockKnowsIfItIsTheStartOfADocBlockTemplate(): void
{ {
$fixture = new DocBlock('', null, [], null, null, true); $fixture = new DocBlock('', null, [], null, null, true);
@@ -200,7 +200,7 @@ class DocBlockTest extends TestCase
* *
* @uses \phpDocumentor\Reflection\DocBlock\Description * @uses \phpDocumentor\Reflection\DocBlock\Description
*/ */
public function testDocBlockKnowsIfItIsTheEndOfADocBlockTemplate() public function testDocBlockKnowsIfItIsTheEndOfADocBlockTemplate(): void
{ {
$fixture = new DocBlock('', null, [], null, null, false, true); $fixture = new DocBlock('', null, [], null, null, false, true);
@@ -213,7 +213,7 @@ class DocBlockTest extends TestCase
* *
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated * @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated
*/ */
public function testRemoveTag() public function testRemoveTag(): void
{ {
$someTag = new Deprecated(); $someTag = new Deprecated();
$anotherTag = new Deprecated(); $anotherTag = new Deprecated();