CS: no whitespace before return type colon

This commit is contained in:
jrfnl
2021-08-08 19:41:03 +02:00
parent 2a1aba8089
commit a607236134
71 changed files with 522 additions and 522 deletions
+10 -10
View File
@@ -29,7 +29,7 @@ class DescriptionFactoryTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -41,7 +41,7 @@ class DescriptionFactoryTest extends TestCase
* @covers ::create
* @dataProvider provideSimpleExampleDescriptions
*/
public function testDescriptionCanParseASimpleString(string $contents) : void
public function testDescriptionCanParseASimpleString(string $contents): void
{
$tagFactory = m::mock(TagFactory::class);
$tagFactory->shouldReceive('create')->never();
@@ -59,7 +59,7 @@ class DescriptionFactoryTest extends TestCase
* @covers ::create
* @dataProvider provideEscapeSequences
*/
public function testEscapeSequences(string $contents, string $expected) : void
public function testEscapeSequences(string $contents, string $expected): void
{
$tagFactory = m::mock(TagFactory::class);
$tagFactory->shouldReceive('create')->never();
@@ -80,7 +80,7 @@ class DescriptionFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testDescriptionCanParseAStringWithInlineTag() : void
public function testDescriptionCanParseAStringWithInlineTag(): void
{
$contents = 'This is text for a {@link http://phpdoc.org/ description} that uses an inline tag.';
$context = new Context('');
@@ -106,7 +106,7 @@ class DescriptionFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testDescriptionCanParseAStringStartingWithInlineTag() : void
public function testDescriptionCanParseAStringStartingWithInlineTag(): void
{
$contents = '{@link http://phpdoc.org/ This} is text for a description that starts with an inline tag.';
$context = new Context('');
@@ -132,7 +132,7 @@ class DescriptionFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testDescriptionCanParseAStringContainingMultipleTags() : void
public function testDescriptionCanParseAStringContainingMultipleTags(): void
{
$contents = 'This description has a {@link http://phpdoc.org/ This} another {@link http://phpdoc.org/ This2}';
$context = new Context('');
@@ -159,7 +159,7 @@ class DescriptionFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testIfSuperfluousStartingSpacesAreRemoved() : void
public function testIfSuperfluousStartingSpacesAreRemoved(): void
{
$factory = new DescriptionFactory(m::mock(TagFactory::class));
$descriptionText = <<<DESCRIPTION
@@ -204,7 +204,7 @@ DESCRIPTION;
* @covers ::__construct
* @covers ::create
*/
public function testDescriptionWithBrokenInlineTags() : void
public function testDescriptionWithBrokenInlineTags(): void
{
$contents = 'This {@see $name} is a broken use case, but used in real life.';
$context = new Context('');
@@ -225,7 +225,7 @@ DESCRIPTION;
*
* @return string[][]
*/
public function provideSimpleExampleDescriptions() : array
public function provideSimpleExampleDescriptions(): array
{
return [
['This is text for a description.'],
@@ -238,7 +238,7 @@ DESCRIPTION;
/**
* @return string[][]
*/
public function provideEscapeSequences() : array
public function provideEscapeSequences(): array
{
return [
['This is text for a description with a {@}.', 'This is text for a description with a @.'],
+6 -6
View File
@@ -26,7 +26,7 @@ class DescriptionTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -39,7 +39,7 @@ class DescriptionTest extends TestCase
* @covers ::__construct
* @covers ::render
*/
public function testDescriptionCanRenderUsingABodyWithPlaceholdersAndTags() : void
public function testDescriptionCanRenderUsingABodyWithPlaceholdersAndTags(): void
{
$body = 'This is a %1$s body.';
$expected = 'This is a {@internal significant} body.';
@@ -65,7 +65,7 @@ class DescriptionTest extends TestCase
* @covers ::render
* @covers ::__toString
*/
public function testDescriptionCanBeCastToString() : void
public function testDescriptionCanBeCastToString(): void
{
$body = 'This is a %1$s body.';
$expected = 'This is a {@internal significant} body.';
@@ -82,7 +82,7 @@ class DescriptionTest extends TestCase
*
* @covers ::getTags
*/
public function testDescriptionTagsGetter() : void
public function testDescriptionTagsGetter(): void
{
$body = '@JoinTable(name="table", joinColumns=%1$s, inverseJoinColumns=%2$s)';
@@ -107,7 +107,7 @@ class DescriptionTest extends TestCase
/**
* @covers ::getBodyTemplate
*/
public function testDescriptionBodyTemplateGetter() : void
public function testDescriptionBodyTemplateGetter(): void
{
$body = 'See https://github.com/phpDocumentor/ReflectionDocBlock/pull/171 for more information';
@@ -125,7 +125,7 @@ class DescriptionTest extends TestCase
* @covers ::render
* @covers ::__toString
*/
public function testDescriptionMultipleTagsCanBeCastToString() : void
public function testDescriptionMultipleTagsCanBeCastToString(): void
{
$body = '@JoinTable(name="table", joinColumns=%1$s, inverseJoinColumns=%2$s)';
+3 -3
View File
@@ -20,12 +20,12 @@ class ExampleFinderTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
public function setUp() : void
public function setUp(): void
{
$this->fixture = new ExampleFinder();
}
@@ -37,7 +37,7 @@ class ExampleFinderTest extends TestCase
* @covers ::find
* @covers ::getSourceDirectory
*/
public function testFileNotFound() : void
public function testFileNotFound(): void
{
$example = new Example('./example.php', false, 1, 0, 'Test');
$this->assertSame('** File not found : ./example.php **', $this->fixture->find($example));
+6 -6
View File
@@ -26,7 +26,7 @@ class SerializerTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -41,7 +41,7 @@ class SerializerTest extends TestCase
* @covers ::__construct
* @covers ::getDocComment
*/
public function testReconstructsADocCommentFromADocBlock() : void
public function testReconstructsADocCommentFromADocBlock(): void
{
$expected = <<<'DOCCOMMENT'
/**
@@ -76,7 +76,7 @@ DOCCOMMENT;
* @covers ::__construct
* @covers ::getDocComment
*/
public function testAddPrefixToDocBlock() : void
public function testAddPrefixToDocBlock(): void
{
$expected = <<<'DOCCOMMENT'
aa/**
@@ -111,7 +111,7 @@ DOCCOMMENT;
* @covers ::__construct
* @covers ::getDocComment
*/
public function testAddPrefixToDocBlockExceptFirstLine() : void
public function testAddPrefixToDocBlockExceptFirstLine(): void
{
$expected = <<<'DOCCOMMENT'
/**
@@ -146,7 +146,7 @@ DOCCOMMENT;
* @covers ::__construct
* @covers ::getDocComment
*/
public function testWordwrapsAroundTheGivenAmountOfCharacters() : void
public function testWordwrapsAroundTheGivenAmountOfCharacters(): void
{
$expected = <<<'DOCCOMMENT'
/**
@@ -181,7 +181,7 @@ DOCCOMMENT;
* @covers ::__construct
* @covers ::getDocComment
*/
public function testNoExtraSpacesAfterTagRemoval() : void
public function testNoExtraSpacesAfterTagRemoval(): void
{
$expected = <<<'DOCCOMMENT'
/**
+24 -24
View File
@@ -40,7 +40,7 @@ class StandardTagFactoryTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -54,7 +54,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testCreatingAGenericTag() : void
public function testCreatingAGenericTag(): void
{
$expectedTagName = 'unknown-tag';
$expectedDescriptionText = 'This is a description';
@@ -87,7 +87,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testCreatingAGenericTagWithDescriptionText() : void
public function testCreatingAGenericTagWithDescriptionText(): void
{
$expectedTagName = 'unknown-tag';
$expectedDescriptionText = ' foo Bar 123 ';
@@ -110,7 +110,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testCreatingASpecificTag() : void
public function testCreatingASpecificTag(): void
{
$context = new Context('');
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class));
@@ -131,7 +131,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testAnEmptyContextIsCreatedIfNoneIsProvided() : void
public function testAnEmptyContextIsCreatedIfNoneIsProvided(): void
{
$fqsen = '\Tag';
$resolver = m::mock(FqsenResolver::class)
@@ -159,7 +159,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testPassingYourOwnSetOfTagHandlers() : void
public function testPassingYourOwnSetOfTagHandlers(): void
{
$context = new Context('');
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class), ['user' => Author::class]);
@@ -178,7 +178,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testPassingYourOwnSetOfTagHandlersWithGermanChars() : void
public function testPassingYourOwnSetOfTagHandlersWithGermanChars(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -206,7 +206,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testPassingYourOwnSetOfTagHandlersWithoutComment() : void
public function testPassingYourOwnSetOfTagHandlersWithoutComment(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -233,7 +233,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testPassingYourOwnSetOfTagHandlersWithEmptyComment() : void
public function testPassingYourOwnSetOfTagHandlersWithEmptyComment(): void
{
$this->expectException('InvalidArgumentException');
$this->expectExceptionMessage(
@@ -260,7 +260,7 @@ class StandardTagFactoryTest extends TestCase
*
* @covers ::create
*/
public function testExceptionIsThrownIfProvidedTagIsNotWellformed() : void
public function testExceptionIsThrownIfProvidedTagIsNotWellformed(): void
{
$this->expectException('InvalidArgumentException');
$this->expectExceptionMessage(
@@ -276,7 +276,7 @@ class StandardTagFactoryTest extends TestCase
* @covers ::__construct
* @covers ::addParameter
*/
public function testAddParameterToServiceLocator() : void
public function testAddParameterToServiceLocator(): void
{
$resolver = m::mock(FqsenResolver::class);
$tagFactory = new StandardTagFactory($resolver);
@@ -294,7 +294,7 @@ class StandardTagFactoryTest extends TestCase
*
* @covers ::addService
*/
public function testAddServiceToServiceLocator() : void
public function testAddServiceToServiceLocator(): void
{
$service = new PassthroughFormatter();
@@ -313,7 +313,7 @@ class StandardTagFactoryTest extends TestCase
*
* @covers ::addService
*/
public function testInjectConcreteServiceForInterfaceToServiceLocator() : void
public function testInjectConcreteServiceForInterfaceToServiceLocator(): void
{
$interfaceName = Formatter::class;
$service = new PassthroughFormatter();
@@ -336,7 +336,7 @@ class StandardTagFactoryTest extends TestCase
*
* @covers ::registerTagHandler
*/
public function testRegisteringAHandlerForANewTag() : void
public function testRegisteringAHandlerForANewTag(): void
{
$resolver = m::mock(FqsenResolver::class);
$tagFactory = new StandardTagFactory($resolver);
@@ -354,7 +354,7 @@ class StandardTagFactoryTest extends TestCase
*
* @covers ::registerTagHandler
*/
public function testHandlerRegistrationFailsIfProvidedTagNameIsNamespaceButNotFullyQualified() : void
public function testHandlerRegistrationFailsIfProvidedTagNameIsNamespaceButNotFullyQualified(): void
{
$this->expectException('InvalidArgumentException');
$resolver = m::mock(FqsenResolver::class);
@@ -369,7 +369,7 @@ class StandardTagFactoryTest extends TestCase
*
* @covers ::registerTagHandler
*/
public function testHandlerRegistrationFailsIfProvidedHandlerIsEmpty() : void
public function testHandlerRegistrationFailsIfProvidedHandlerIsEmpty(): void
{
$this->expectException('InvalidArgumentException');
$resolver = m::mock(FqsenResolver::class);
@@ -383,7 +383,7 @@ class StandardTagFactoryTest extends TestCase
*
* @covers ::registerTagHandler
*/
public function testHandlerRegistrationFailsIfProvidedHandlerIsNotAnExistingClassName() : void
public function testHandlerRegistrationFailsIfProvidedHandlerIsNotAnExistingClassName(): void
{
$this->expectException('InvalidArgumentException');
$resolver = m::mock(FqsenResolver::class);
@@ -397,7 +397,7 @@ class StandardTagFactoryTest extends TestCase
*
* @covers ::registerTagHandler
*/
public function testHandlerRegistrationFailsIfProvidedHandlerDoesNotImplementTheTagInterface() : void
public function testHandlerRegistrationFailsIfProvidedHandlerDoesNotImplementTheTagInterface(): void
{
$this->expectException('InvalidArgumentException');
$resolver = m::mock(FqsenResolver::class);
@@ -414,7 +414,7 @@ class StandardTagFactoryTest extends TestCase
*
* @covers ::create
*/
public function testReturnTagIsMappedCorrectly() : void
public function testReturnTagIsMappedCorrectly(): void
{
$context = new Context('');
@@ -437,7 +437,7 @@ class StandardTagFactoryTest extends TestCase
$this->assertSame('return', $tag->getName());
}
public function testInvalidTagIsReturnedOnFailure() : void
public function testInvalidTagIsReturnedOnFailure(): void
{
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class));
@@ -449,7 +449,7 @@ class StandardTagFactoryTest extends TestCase
/**
* @dataProvider validTagProvider
*/
public function testValidFormattedTags(string $input, string $tagName, string $render) : void
public function testValidFormattedTags(string $input, string $tagName, string $render): void
{
$fqsenResolver = m::mock(FqsenResolver::class);
$tagFactory = new StandardTagFactory($fqsenResolver);
@@ -465,7 +465,7 @@ class StandardTagFactoryTest extends TestCase
*
* @phpstan-return array<string, array<int, string>>
*/
public function validTagProvider() : array
public function validTagProvider(): array
{
//rendered result is adding a space, because the tags are not rendered properly.
return [
@@ -515,7 +515,7 @@ class StandardTagFactoryTest extends TestCase
/**
* @dataProvider invalidTagProvider
*/
public function testInValidFormattedTags(string $input) : void
public function testInValidFormattedTags(string $input): void
{
$this->expectException(InvalidArgumentException::class);
$fqsenResolver = m::mock(FqsenResolver::class);
@@ -529,7 +529,7 @@ class StandardTagFactoryTest extends TestCase
*
* @phpstan-return list<array<int, string>>
*/
public function invalidTagProvider() : array
public function invalidTagProvider(): array
{
return [
['@tag[invalid]'],
+13 -13
View File
@@ -25,7 +25,7 @@ class AuthorTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -35,7 +35,7 @@ class AuthorTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Author('Mike van Riel', '[email protected]');
@@ -50,7 +50,7 @@ class AuthorTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Author('Mike van Riel', '[email protected]');
@@ -62,7 +62,7 @@ class AuthorTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Author('Mike van Riel', '[email protected]');
@@ -76,7 +76,7 @@ class AuthorTest extends TestCase
* @covers ::__construct
* @covers ::getAuthorName
*/
public function testHasTheAuthorName() : void
public function testHasTheAuthorName(): void
{
$expected = 'Mike van Riel';
@@ -89,7 +89,7 @@ class AuthorTest extends TestCase
* @covers ::__construct
* @covers ::getEmail
*/
public function testHasTheAuthorMailAddress() : void
public function testHasTheAuthorMailAddress(): void
{
$expected = '[email protected]';
@@ -101,7 +101,7 @@ class AuthorTest extends TestCase
/**
* @covers ::__construct
*/
public function testInitializationFailsIfEmailIsNotValid() : void
public function testInitializationFailsIfEmailIsNotValid(): void
{
$this->expectException('InvalidArgumentException');
new Author('Mike van Riel', 'mike');
@@ -111,7 +111,7 @@ class AuthorTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Author('Mike van Riel', '[email protected]');
@@ -128,7 +128,7 @@ class AuthorTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutName() : void
public function testStringRepresentationIsReturnedWithoutName(): void
{
$fixture = new Author('', '[email protected]');
@@ -139,7 +139,7 @@ class AuthorTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationWithEmtpyEmail() : void
public function testStringRepresentationWithEmtpyEmail(): void
{
$fixture = new Author('Mike van Riel', '');
@@ -152,7 +152,7 @@ class AuthorTest extends TestCase
* @covers ::create
* @dataProvider authorTagProvider
*/
public function testFactoryMethod(string $input, string $output, string $name, string $email) : void
public function testFactoryMethod(string $input, string $output, string $name, string $email): void
{
$fixture = Author::create($input);
@@ -162,7 +162,7 @@ class AuthorTest extends TestCase
}
/** @return mixed[][] */
public function authorTagProvider() : array
public function authorTagProvider(): array
{
return [
[
@@ -191,7 +191,7 @@ class AuthorTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodReturnsNullIfItCouldNotReadBody() : void
public function testFactoryMethodReturnsNullIfItCouldNotReadBody(): void
{
$this->assertNull(Author::create('dfgr<'));
}
+12 -12
View File
@@ -31,7 +31,7 @@ class CoversTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -42,7 +42,7 @@ class CoversTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Covers(new Fqsen('\DateTime'), new Description('Description'));
@@ -58,7 +58,7 @@ class CoversTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Covers(new Fqsen('\DateTime'), new Description('Description'));
@@ -71,7 +71,7 @@ class CoversTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Covers(new Fqsen('\DateTime'), new Description('Description'));
@@ -85,7 +85,7 @@ class CoversTest extends TestCase
* @covers ::__construct
* @covers ::getReference
*/
public function testHasReferenceToFqsen() : void
public function testHasReferenceToFqsen(): void
{
$expected = new Fqsen('\DateTime');
@@ -100,7 +100,7 @@ class CoversTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -115,7 +115,7 @@ class CoversTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Covers(new Fqsen('\DateTime'), new Description('Description'));
@@ -132,7 +132,7 @@ class CoversTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = m::mock(FqsenResolver::class);
@@ -156,7 +156,7 @@ class CoversTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Covers(new Fqsen('\\'));
@@ -185,7 +185,7 @@ class CoversTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithSpaceBeforeClass() : void
public function testFactoryMethodWithSpaceBeforeClass(): void
{
$fqsenResolver = new FqsenResolver();
$tagFactory = new StandardTagFactory($fqsenResolver);
@@ -208,7 +208,7 @@ class CoversTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithDescription() : void
public function testStringRepresentationIsReturnedWithDescription(): void
{
$fixture = new Covers(new Fqsen('\DateTime'), new Description('My Description'));
@@ -218,7 +218,7 @@ class CoversTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfBodyIsNotEmpty() : void
public function testFactoryMethodFailsIfBodyIsNotEmpty(): void
{
$this->expectException('InvalidArgumentException');
$this->assertNull(Covers::create(''));
+11 -11
View File
@@ -28,7 +28,7 @@ class DeprecatedTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -39,7 +39,7 @@ class DeprecatedTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Deprecated('1.0', new Description('Description'));
@@ -55,7 +55,7 @@ class DeprecatedTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Deprecated('1.0', new Description('Description'));
@@ -68,7 +68,7 @@ class DeprecatedTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Deprecated('1.0', new Description('Description'));
@@ -82,7 +82,7 @@ class DeprecatedTest extends TestCase
* @covers ::__construct
* @covers ::getVersion
*/
public function testHasVersionNumber() : void
public function testHasVersionNumber(): void
{
$expected = '1.0';
@@ -97,7 +97,7 @@ class DeprecatedTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -112,7 +112,7 @@ class DeprecatedTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Deprecated('1.0', new Description('Description'));
@@ -131,7 +131,7 @@ class DeprecatedTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Deprecated(null, new Description(''));
@@ -158,7 +158,7 @@ class DeprecatedTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context('');
@@ -183,7 +183,7 @@ class DeprecatedTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodCreatesEmptyDeprecatedTag() : void
public function testFactoryMethodCreatesEmptyDeprecatedTag(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$descriptionFactory->shouldReceive('create')->never();
@@ -200,7 +200,7 @@ class DeprecatedTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex() : void
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex(): void
{
$this->assertEquals(new Deprecated(), Deprecated::create('dkhf<'));
}
+11 -11
View File
@@ -20,7 +20,7 @@ class ExampleTest extends TestCase
* @covers ::__construct
* @covers ::getContent
*/
public function testExampleWithoutContent() : void
public function testExampleWithoutContent(): void
{
$tag = Example::create('"example1.php"');
$this->assertEquals('"example1.php"', $tag->getContent());
@@ -36,7 +36,7 @@ class ExampleTest extends TestCase
* @covers ::getFilePath
* @covers ::getDescription
*/
public function testWithDescription() : void
public function testWithDescription(): void
{
$tag = Example::create('"example1.php" some text');
$this->assertEquals('example1.php', $tag->getFilePath());
@@ -51,7 +51,7 @@ class ExampleTest extends TestCase
* @covers ::getFilePath
* @covers ::getStartingLine
*/
public function testStartlineIsParsed() : void
public function testStartlineIsParsed(): void
{
$tag = Example::create('"example1.php" 10');
$this->assertEquals('example1.php', $tag->getFilePath());
@@ -67,7 +67,7 @@ class ExampleTest extends TestCase
* @covers ::getStartingLine
* @covers ::getDescription
*/
public function testAllowOmitingLineCount() : void
public function testAllowOmitingLineCount(): void
{
$tag = Example::create('"example1.php" 10 some text');
$this->assertEquals('example1.php', $tag->getFilePath());
@@ -84,7 +84,7 @@ class ExampleTest extends TestCase
* @covers ::getStartingLine
* @covers ::getLineCount
*/
public function testLengthIsParsed() : void
public function testLengthIsParsed(): void
{
$tag = Example::create('"example1.php" 10 5');
$this->assertEquals('example1.php', $tag->getFilePath());
@@ -96,7 +96,7 @@ class ExampleTest extends TestCase
* @covers ::create
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$tag = Example::create('"example1.php" 10 5 test text');
@@ -131,7 +131,7 @@ class ExampleTest extends TestCase
* @covers ::create
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$tag = Example::create('');
@@ -157,7 +157,7 @@ class ExampleTest extends TestCase
int $lineCount,
?string $description,
string $content
) : void {
): void {
$tag = Example::create($input);
$this->assertSame($filePath, $tag->getFilePath());
$this->assertSame($startLine, $tag->getStartingLine());
@@ -167,7 +167,7 @@ class ExampleTest extends TestCase
}
/** @return mixed[][] */
public function tagContentProvider() : array
public function tagContentProvider(): array
{
return [
[
@@ -231,7 +231,7 @@ class ExampleTest extends TestCase
int $startLine,
int $lineCount,
string $description
) : void {
): void {
$this->expectException(InvalidArgumentException::class);
new Example(
@@ -244,7 +244,7 @@ class ExampleTest extends TestCase
}
/** @return mixed[][] */
public function invalidExampleProvider() : array
public function invalidExampleProvider(): array
{
return [
'invalid start' => [
@@ -29,7 +29,7 @@ class AlignFormatterTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -45,7 +45,7 @@ class AlignFormatterTest extends TestCase
* @covers ::format
* @covers \phpDocumentor\Reflection\DocBlock\Tags\Formatter\AlignFormatter::__construct
*/
public function testFormatterCallsToStringAndReturnsAStandardRepresentation() : void
public function testFormatterCallsToStringAndReturnsAStandardRepresentation(): void
{
$tags = [
new Param('foobar', new String_()),
@@ -26,7 +26,7 @@ class PassthroughFormatterTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -38,7 +38,7 @@ class PassthroughFormatterTest extends TestCase
*
* @covers ::format
*/
public function testFormatterCallsToStringAndReturnsAStandardRepresentation() : void
public function testFormatterCallsToStringAndReturnsAStandardRepresentation(): void
{
$expected = '@unknown-tag This is a description';
@@ -57,7 +57,7 @@ class PassthroughFormatterTest extends TestCase
*
* @covers ::format
*/
public function testFormatterToStringWithoutDescription() : void
public function testFormatterToStringWithoutDescription(): void
{
$expected = '@unknown-tag';
$fixture = new PassthroughFormatter();
+10 -10
View File
@@ -28,7 +28,7 @@ class GenericTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -39,7 +39,7 @@ class GenericTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Generic('generic', new Description('Description'));
@@ -55,7 +55,7 @@ class GenericTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Generic('generic', new Description('Description'));
@@ -68,7 +68,7 @@ class GenericTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Generic('generic', new Description('Description'));
@@ -84,7 +84,7 @@ class GenericTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -100,7 +100,7 @@ class GenericTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Generic('generic', new Description('Description'));
@@ -114,7 +114,7 @@ class GenericTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Generic('generic');
@@ -135,7 +135,7 @@ class GenericTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context('');
@@ -155,7 +155,7 @@ class GenericTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfNameIsNotEmpty() : void
public function testFactoryMethodFailsIfNameIsNotEmpty(): void
{
$this->expectException('InvalidArgumentException');
Generic::create('', '');
@@ -165,7 +165,7 @@ class GenericTest extends TestCase
* @covers ::create
* @covers ::__construct
*/
public function testFactoryMethodFailsIfNameContainsIllegalCharacters() : void
public function testFactoryMethodFailsIfNameContainsIllegalCharacters(): void
{
$this->expectException('InvalidArgumentException');
Generic::create('', 'name/myname');
+8 -8
View File
@@ -22,7 +22,7 @@ use function unserialize;
*/
final class InvalidTagTest extends TestCase
{
public function testCreationWithoutError() : void
public function testCreationWithoutError(): void
{
$tag = InvalidTag::create('Body', 'name');
@@ -35,7 +35,7 @@ final class InvalidTagTest extends TestCase
* @covers ::withError
* @covers ::__toString
*/
public function testCreationWithError() : void
public function testCreationWithError(): void
{
$exception = new Exception();
$tag = InvalidTag::create('Body', 'name')->withError($exception);
@@ -46,7 +46,7 @@ final class InvalidTagTest extends TestCase
self::assertSame($exception, $tag->getException());
}
public function testCreationWithErrorContainingClosure() : void
public function testCreationWithErrorContainingClosure(): void
{
try {
$this->throwExceptionFromClosureWithClosureArgument();
@@ -67,16 +67,16 @@ final class InvalidTagTest extends TestCase
}
}
private function throwExceptionFromClosureWithClosureArgument() : void
private function throwExceptionFromClosureWithClosureArgument(): void
{
$function = static function () : void {
$function = static function (): void {
throw new InvalidArgumentException();
};
$function($function);
}
public function testCreationWithErrorContainingResource() : void
public function testCreationWithErrorContainingResource(): void
{
try {
$this->throwExceptionWithResourceArgument();
@@ -99,9 +99,9 @@ final class InvalidTagTest extends TestCase
}
}
private function throwExceptionWithResourceArgument() : void
private function throwExceptionWithResourceArgument(): void
{
$function = static function () : void {
$function = static function (): void {
throw new InvalidArgumentException();
};
+12 -12
View File
@@ -30,7 +30,7 @@ class LinkTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -41,7 +41,7 @@ class LinkTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Link('http://this.is.my/link', new Description('Description'));
@@ -57,7 +57,7 @@ class LinkTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Link('http://this.is.my/link', new Description('Description'));
@@ -70,7 +70,7 @@ class LinkTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Link('http://this.is.my/link', new Description('Description'));
@@ -84,7 +84,7 @@ class LinkTest extends TestCase
* @covers ::__construct
* @covers ::getLink
*/
public function testHasLinkUrl() : void
public function testHasLinkUrl(): void
{
$expected = 'http://this.is.my/link';
@@ -99,7 +99,7 @@ class LinkTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -114,7 +114,7 @@ class LinkTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Link('http://this.is.my/link', new Description('Description'));
@@ -127,7 +127,7 @@ class LinkTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Link('http://this.is.my/link');
@@ -148,7 +148,7 @@ class LinkTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context('');
@@ -175,7 +175,7 @@ class LinkTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithoutSpaceBeforeUrl() : void
public function testFactoryMethodWithoutSpaceBeforeUrl(): void
{
$fqsenResolver = new FqsenResolver();
$tagFactory = new StandardTagFactory($fqsenResolver);
@@ -202,7 +202,7 @@ class LinkTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithSpaceBeforeUrl() : void
public function testFactoryMethodWithSpaceBeforeUrl(): void
{
$fqsenResolver = new FqsenResolver();
$tagFactory = new StandardTagFactory($fqsenResolver);
@@ -227,7 +227,7 @@ class LinkTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodCreatesEmptyLinkTag() : void
public function testFactoryMethodCreatesEmptyLinkTag(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$descriptionFactory->shouldReceive('create')->never();
+30 -30
View File
@@ -38,7 +38,7 @@ class MethodTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -48,7 +48,7 @@ class MethodTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Method('myMethod');
@@ -65,7 +65,7 @@ class MethodTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$arguments = [
['name' => 'argument1', 'type' => new String_()],
@@ -92,7 +92,7 @@ class MethodTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Method('myMethod');
@@ -106,7 +106,7 @@ class MethodTest extends TestCase
* @covers ::__construct
* @covers ::getMethodName
*/
public function testHasMethodName() : void
public function testHasMethodName(): void
{
$expected = 'myMethod';
@@ -119,7 +119,7 @@ class MethodTest extends TestCase
* @covers ::__construct
* @covers ::getArguments
*/
public function testHasArguments() : void
public function testHasArguments(): void
{
$arguments = [
['name' => 'argument1', 'type' => new String_()],
@@ -134,7 +134,7 @@ class MethodTest extends TestCase
* @covers ::__construct
* @covers ::getArguments
*/
public function testArgumentsMayBePassedAsString() : void
public function testArgumentsMayBePassedAsString(): void
{
$arguments = ['argument1'];
$expected = [
@@ -150,7 +150,7 @@ class MethodTest extends TestCase
* @covers ::__construct
* @covers ::getArguments
*/
public function testArgumentTypeCanBeInferredAsMixed() : void
public function testArgumentTypeCanBeInferredAsMixed(): void
{
$arguments = [['name' => 'argument1']];
$expected = [
@@ -169,7 +169,7 @@ class MethodTest extends TestCase
*
* @covers ::create
*/
public function testRestArgumentIsParsedAsRegularArg() : void
public function testRestArgumentIsParsedAsRegularArg(): void
{
$expected = [
['name' => 'arg1', 'type' => new Mixed_()],
@@ -197,7 +197,7 @@ class MethodTest extends TestCase
* @covers ::__construct
* @covers ::getReturnType
*/
public function testHasReturnType() : void
public function testHasReturnType(): void
{
$expected = new String_();
@@ -210,7 +210,7 @@ class MethodTest extends TestCase
* @covers ::__construct
* @covers ::getReturnType
*/
public function testReturnTypeCanBeInferredAsVoid() : void
public function testReturnTypeCanBeInferredAsVoid(): void
{
$fixture = new Method('myMethod', []);
@@ -221,7 +221,7 @@ class MethodTest extends TestCase
* @covers ::__construct
* @covers ::isStatic
*/
public function testMethodCanBeStatic() : void
public function testMethodCanBeStatic(): void
{
$expected = false;
$fixture = new Method('myMethod', [], null, $expected);
@@ -238,7 +238,7 @@ class MethodTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -254,7 +254,7 @@ class MethodTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$arguments = [
['name' => 'argument1', 'type' => new String_()],
@@ -275,7 +275,7 @@ class MethodTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Method('myMethod', [], null, false, new Description(''));
@@ -308,7 +308,7 @@ class MethodTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -349,7 +349,7 @@ class MethodTest extends TestCase
*
* @covers ::create
*/
public function testReturnTypeThis() : void
public function testReturnTypeThis(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -380,7 +380,7 @@ class MethodTest extends TestCase
*
* @covers ::create
*/
public function testReturnTypeNoneWithLongMethodName() : void
public function testReturnTypeNoneWithLongMethodName(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -406,7 +406,7 @@ class MethodTest extends TestCase
/**
* @return string[][]
*/
public function collectionReturnTypesProvider() : array
public function collectionReturnTypesProvider(): array
{
return [
['int[]', Array_::class, Integer::class, Compound::class],
@@ -434,7 +434,7 @@ class MethodTest extends TestCase
string $expectedType,
?string $expectedValueType = null,
?string $expectedKeyType = null
) : void {
): void {
$resolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class);
$descriptionFactory->shouldReceive('create')
@@ -456,7 +456,7 @@ class MethodTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfBodyIsEmpty() : void
public function testFactoryMethodFailsIfBodyIsEmpty(): void
{
$this->expectException('InvalidArgumentException');
Method::create('');
@@ -465,7 +465,7 @@ class MethodTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodReturnsNullIfBodyIsIncorrect() : void
public function testFactoryMethodReturnsNullIfBodyIsIncorrect(): void
{
$this->expectException('InvalidArgumentException');
$this->assertNull(Method::create('body('));
@@ -474,7 +474,7 @@ class MethodTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfResolverIsNull() : void
public function testFactoryMethodFailsIfResolverIsNull(): void
{
$this->expectException('InvalidArgumentException');
Method::create('body');
@@ -483,7 +483,7 @@ class MethodTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
Method::create('body', new TypeResolver());
@@ -492,7 +492,7 @@ class MethodTest extends TestCase
/**
* @covers ::__construct
*/
public function testCreationFailsIfBodyIsEmpty() : void
public function testCreationFailsIfBodyIsEmpty(): void
{
$this->expectException('InvalidArgumentException');
new Method('');
@@ -501,7 +501,7 @@ class MethodTest extends TestCase
/**
* @covers ::__construct
*/
public function testCreationFailsIfArgumentRecordContainsInvalidEntry() : void
public function testCreationFailsIfArgumentRecordContainsInvalidEntry(): void
{
$this->expectException('InvalidArgumentException');
new Method('body', [['name' => 'myName', 'unknown' => 'nah']]);
@@ -517,7 +517,7 @@ class MethodTest extends TestCase
*
* @covers ::create
*/
public function testCreateMethodParenthesisMissing() : void
public function testCreateMethodParenthesisMissing(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -554,7 +554,7 @@ class MethodTest extends TestCase
*
* @covers ::create
*/
public function testCreateMethodEmptyArguments() : void
public function testCreateMethodEmptyArguments(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -591,7 +591,7 @@ class MethodTest extends TestCase
*
* @covers ::create
*/
public function testCreateWithoutReturnType() : void
public function testCreateWithoutReturnType(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -629,7 +629,7 @@ class MethodTest extends TestCase
*
* @covers ::create
*/
public function testCreateWithMixedReturnTypes() : void
public function testCreateWithMixedReturnTypes(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
+20 -20
View File
@@ -33,7 +33,7 @@ class ParamTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -44,7 +44,7 @@ class ParamTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Param('myParameter', null, false, new Description('Description'));
@@ -61,7 +61,7 @@ class ParamTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Param('myParameter', new String_(), true, new Description('Description'));
$this->assertSame('@param string ...$myParameter Description', $fixture->render());
@@ -81,7 +81,7 @@ class ParamTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Param('myParameter');
@@ -95,7 +95,7 @@ class ParamTest extends TestCase
* @covers ::__construct
* @covers ::getVariableName
*/
public function testHasVariableName() : void
public function testHasVariableName(): void
{
$expected = 'myParameter';
@@ -108,7 +108,7 @@ class ParamTest extends TestCase
* @covers ::__construct
* @covers ::getType
*/
public function testHasType() : void
public function testHasType(): void
{
$expected = new String_();
@@ -121,7 +121,7 @@ class ParamTest extends TestCase
* @covers ::__construct
* @covers ::isVariadic
*/
public function testIfParameterIsVariadic() : void
public function testIfParameterIsVariadic(): void
{
$fixture = new Param('myParameter', new String_(), false);
$this->assertFalse($fixture->isVariadic());
@@ -136,7 +136,7 @@ class ParamTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -153,7 +153,7 @@ class ParamTest extends TestCase
* @covers ::isVariadic
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Param('myParameter', new String_(), true, new Description('Description'));
@@ -168,7 +168,7 @@ class ParamTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -195,7 +195,7 @@ class ParamTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithVariadic() : void
public function testFactoryMethodWithVariadic(): void
{
$typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -222,7 +222,7 @@ class ParamTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithReference() : void
public function testFactoryMethodWithReference(): void
{
$typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -249,7 +249,7 @@ class ParamTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithVariadicReference() : void
public function testFactoryMethodWithVariadicReference(): void
{
$typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -281,7 +281,7 @@ class ParamTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithReferenceWithoutType() : void
public function testFactoryMethodWithReferenceWithoutType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -312,7 +312,7 @@ class ParamTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithVariadicReferenceWithoutType() : void
public function testFactoryMethodWithVariadicReferenceWithoutType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -343,7 +343,7 @@ class ParamTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithoutType() : void
public function testFactoryMethodWithoutType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -374,7 +374,7 @@ class ParamTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithType() : void
public function testFactoryMethodWithType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -402,7 +402,7 @@ class ParamTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfEmptyBodyIsGiven() : void
public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{
$this->expectException('InvalidArgumentException');
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -412,7 +412,7 @@ class ParamTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfResolverIsNull() : void
public function testFactoryMethodFailsIfResolverIsNull(): void
{
$this->expectException('InvalidArgumentException');
Param::create('body');
@@ -423,7 +423,7 @@ class ParamTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
Param::create('body', new TypeResolver());
+14 -14
View File
@@ -33,7 +33,7 @@ class PropertyReadTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -44,7 +44,7 @@ class PropertyReadTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new PropertyRead('myProperty', null, new Description('Description'));
@@ -60,7 +60,7 @@ class PropertyReadTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new PropertyRead('myProperty', new String_(), new Description('Description'));
$this->assertSame('@property-read string $myProperty Description', $fixture->render());
@@ -77,7 +77,7 @@ class PropertyReadTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new PropertyRead('myProperty');
@@ -91,7 +91,7 @@ class PropertyReadTest extends TestCase
* @covers ::__construct
* @covers ::getVariableName
*/
public function testHasVariableName() : void
public function testHasVariableName(): void
{
$expected = 'myProperty';
@@ -104,7 +104,7 @@ class PropertyReadTest extends TestCase
* @covers ::__construct
* @covers ::getType
*/
public function testHasType() : void
public function testHasType(): void
{
$expected = new String_();
@@ -119,7 +119,7 @@ class PropertyReadTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -135,7 +135,7 @@ class PropertyReadTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new PropertyRead('myProperty', new String_(), new Description('Description'));
@@ -150,7 +150,7 @@ class PropertyReadTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -180,7 +180,7 @@ class PropertyReadTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithoutType() : void
public function testFactoryMethodWithoutType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -209,7 +209,7 @@ class PropertyReadTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithType() : void
public function testFactoryMethodWithType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -237,7 +237,7 @@ class PropertyReadTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfEmptyBodyIsGiven() : void
public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{
$this->expectException('InvalidArgumentException');
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -247,7 +247,7 @@ class PropertyReadTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfResolverIsNull() : void
public function testFactoryMethodFailsIfResolverIsNull(): void
{
$this->expectException('InvalidArgumentException');
PropertyRead::create('body');
@@ -258,7 +258,7 @@ class PropertyReadTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
PropertyRead::create('body', new TypeResolver());
+14 -14
View File
@@ -33,7 +33,7 @@ class PropertyTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -44,7 +44,7 @@ class PropertyTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Property('myProperty', null, new Description('Description'));
@@ -60,7 +60,7 @@ class PropertyTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Property('myProperty', new String_(), new Description('Description'));
$this->assertSame('@property string $myProperty Description', $fixture->render());
@@ -77,7 +77,7 @@ class PropertyTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Property('myProperty');
@@ -91,7 +91,7 @@ class PropertyTest extends TestCase
* @covers ::__construct
* @covers ::getVariableName
*/
public function testHasVariableName() : void
public function testHasVariableName(): void
{
$expected = 'myProperty';
@@ -104,7 +104,7 @@ class PropertyTest extends TestCase
* @covers ::__construct
* @covers ::getType
*/
public function testHasType() : void
public function testHasType(): void
{
$expected = new String_();
@@ -119,7 +119,7 @@ class PropertyTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -135,7 +135,7 @@ class PropertyTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Property('myProperty', new String_(), new Description('Description'));
@@ -150,7 +150,7 @@ class PropertyTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -175,7 +175,7 @@ class PropertyTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithoutType() : void
public function testFactoryMethodWithoutType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -204,7 +204,7 @@ class PropertyTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithType() : void
public function testFactoryMethodWithType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -232,7 +232,7 @@ class PropertyTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfEmptyBodyIsGiven() : void
public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{
$this->expectException('InvalidArgumentException');
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -242,7 +242,7 @@ class PropertyTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfResolverIsNull() : void
public function testFactoryMethodFailsIfResolverIsNull(): void
{
$this->expectException('InvalidArgumentException');
Property::create('body');
@@ -253,7 +253,7 @@ class PropertyTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
Property::create('body', new TypeResolver());
+14 -14
View File
@@ -33,7 +33,7 @@ class PropertyWriteTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -44,7 +44,7 @@ class PropertyWriteTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new PropertyWrite('myProperty', null, new Description('Description'));
@@ -60,7 +60,7 @@ class PropertyWriteTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new PropertyWrite('myProperty', new String_(), new Description('Description'));
$this->assertSame('@property-write string $myProperty Description', $fixture->render());
@@ -77,7 +77,7 @@ class PropertyWriteTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new PropertyWrite('myProperty');
@@ -91,7 +91,7 @@ class PropertyWriteTest extends TestCase
* @covers ::__construct
* @covers ::getVariableName
*/
public function testHasVariableName() : void
public function testHasVariableName(): void
{
$expected = 'myProperty';
@@ -104,7 +104,7 @@ class PropertyWriteTest extends TestCase
* @covers ::__construct
* @covers ::getType
*/
public function testHasType() : void
public function testHasType(): void
{
$expected = new String_();
@@ -119,7 +119,7 @@ class PropertyWriteTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -135,7 +135,7 @@ class PropertyWriteTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new PropertyWrite('myProperty', new String_(), new Description('Description'));
@@ -150,7 +150,7 @@ class PropertyWriteTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -180,7 +180,7 @@ class PropertyWriteTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithoutType() : void
public function testFactoryMethodWithoutType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -209,7 +209,7 @@ class PropertyWriteTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithType() : void
public function testFactoryMethodWithType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -237,7 +237,7 @@ class PropertyWriteTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfEmptyBodyIsGiven() : void
public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{
$this->expectException('InvalidArgumentException');
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -247,7 +247,7 @@ class PropertyWriteTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfResolverIsNull() : void
public function testFactoryMethodFailsIfResolverIsNull(): void
{
$this->expectException('InvalidArgumentException');
PropertyWrite::create('body');
@@ -258,7 +258,7 @@ class PropertyWriteTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
PropertyWrite::create('body', new TypeResolver());
+15 -15
View File
@@ -31,7 +31,7 @@ class ReturnTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -42,7 +42,7 @@ class ReturnTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Return_(new String_(), new Description('Description'));
@@ -58,7 +58,7 @@ class ReturnTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Return_(new String_(), new Description('Description'));
@@ -71,7 +71,7 @@ class ReturnTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Return_(new String_(), new Description('Description'));
@@ -85,7 +85,7 @@ class ReturnTest extends TestCase
* @covers ::__construct
* @covers ::getType
*/
public function testHasType() : void
public function testHasType(): void
{
$expected = new String_();
@@ -100,7 +100,7 @@ class ReturnTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -115,7 +115,7 @@ class ReturnTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Return_(new String_(), new Description('Description'));
@@ -128,7 +128,7 @@ class ReturnTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Return_(new String_());
@@ -151,7 +151,7 @@ class ReturnTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -187,7 +187,7 @@ class ReturnTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithGenericWithSpace() : void
public function testFactoryMethodWithGenericWithSpace(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -216,7 +216,7 @@ class ReturnTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithGenericWithSpaceAndAddedEmojisToVerifyMultiByteBehaviour() : void
public function testFactoryMethodWithGenericWithSpaceAndAddedEmojisToVerifyMultiByteBehaviour(): void
{
$this->markTestSkipped('A bug in the TypeResolver breaks this test');
$this->expectException(InvalidArgumentException::class);
@@ -244,7 +244,7 @@ class ReturnTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithEmojisToVerifyMultiByteBehaviour() : void
public function testFactoryMethodWithEmojisToVerifyMultiByteBehaviour(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -265,7 +265,7 @@ class ReturnTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfBodyIsNotEmpty() : void
public function testFactoryMethodFailsIfBodyIsNotEmpty(): void
{
$this->expectException('InvalidArgumentException');
$this->assertNull(Return_::create(''));
@@ -274,7 +274,7 @@ class ReturnTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfResolverIsNull() : void
public function testFactoryMethodFailsIfResolverIsNull(): void
{
$this->expectException('InvalidArgumentException');
Return_::create('body');
@@ -283,7 +283,7 @@ class ReturnTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
Return_::create('body', new TypeResolver());
+15 -15
View File
@@ -34,7 +34,7 @@ class SeeTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -47,7 +47,7 @@ class SeeTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new See(new FqsenRef(new Fqsen('\DateTime')), new Description('Description'));
@@ -64,7 +64,7 @@ class SeeTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new See(new FqsenRef(new Fqsen('\DateTime')), new Description('Description'));
@@ -79,7 +79,7 @@ class SeeTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new See(new FqsenRef(new Fqsen('\DateTime')), new Description('Description'));
@@ -96,7 +96,7 @@ class SeeTest extends TestCase
* @covers ::__construct
* @covers ::getReference
*/
public function testHasReferenceToFqsen() : void
public function testHasReferenceToFqsen(): void
{
$expected = new FqsenRef(new Fqsen('\DateTime'));
@@ -113,7 +113,7 @@ class SeeTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -130,7 +130,7 @@ class SeeTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new See(new FqsenRef(new Fqsen('\DateTime::format()')), new Description('Description'));
@@ -145,7 +145,7 @@ class SeeTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new See(new FqsenRef(new Fqsen('\DateTime::format()')));
@@ -169,7 +169,7 @@ class SeeTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = m::mock(FqsenResolver::class);
@@ -201,7 +201,7 @@ class SeeTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithNonClassFQSEN() : void
public function testFactoryMethodWithNonClassFQSEN(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = m::mock(FqsenResolver::class);
@@ -232,7 +232,7 @@ class SeeTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithUrl() : void
public function testFactoryMethodWithUrl(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = m::mock(FqsenResolver::class);
@@ -263,7 +263,7 @@ class SeeTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithoutUrl() : void
public function testFactoryMethodWithoutUrl(): void
{
$fqsenResolver = new FqsenResolver();
$tagFactory = new StandardTagFactory($fqsenResolver);
@@ -286,7 +286,7 @@ class SeeTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfBodyIsNotEmpty() : void
public function testFactoryMethodFailsIfBodyIsNotEmpty(): void
{
$this->expectException('InvalidArgumentException');
$this->assertNull(See::create(''));
@@ -295,7 +295,7 @@ class SeeTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfResolverIsNull() : void
public function testFactoryMethodFailsIfResolverIsNull(): void
{
$this->expectException('InvalidArgumentException');
See::create('body');
@@ -304,7 +304,7 @@ class SeeTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
See::create('body', new FqsenResolver());
+11 -11
View File
@@ -28,7 +28,7 @@ class SinceTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -39,7 +39,7 @@ class SinceTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Since('1.0', new Description('Description'));
@@ -55,7 +55,7 @@ class SinceTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Since('1.0', new Description('Description'));
@@ -68,7 +68,7 @@ class SinceTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Since('1.0', new Description('Description'));
@@ -82,7 +82,7 @@ class SinceTest extends TestCase
* @covers ::__construct
* @covers ::getVersion
*/
public function testHasVersionNumber() : void
public function testHasVersionNumber(): void
{
$expected = '1.0';
@@ -97,7 +97,7 @@ class SinceTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -112,7 +112,7 @@ class SinceTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Since('1.0', new Description('Description'));
@@ -125,7 +125,7 @@ class SinceTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Since('1.0');
@@ -146,7 +146,7 @@ class SinceTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context('');
@@ -171,7 +171,7 @@ class SinceTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodCreatesEmptySinceTag() : void
public function testFactoryMethodCreatesEmptySinceTag(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$descriptionFactory->shouldReceive('create')->never();
@@ -186,7 +186,7 @@ class SinceTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex() : void
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex(): void
{
$this->assertNull(Since::create('dkhf<'));
}
+14 -14
View File
@@ -28,7 +28,7 @@ class SourceTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -39,7 +39,7 @@ class SourceTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Source(1, null, new Description('Description'));
@@ -55,7 +55,7 @@ class SourceTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Source(1, 10, new Description('Description'));
$this->assertSame('@source 1 10 Description', $fixture->render());
@@ -72,7 +72,7 @@ class SourceTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Source(1);
@@ -86,7 +86,7 @@ class SourceTest extends TestCase
* @covers ::__construct
* @covers ::getStartingLine
*/
public function testHasStartingLine() : void
public function testHasStartingLine(): void
{
$expected = 1;
@@ -99,7 +99,7 @@ class SourceTest extends TestCase
* @covers ::__construct
* @covers ::getLineCount
*/
public function testHasLineCount() : void
public function testHasLineCount(): void
{
$expected = 2;
@@ -114,7 +114,7 @@ class SourceTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -130,7 +130,7 @@ class SourceTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Source(1, 10, new Description('Description'));
@@ -144,7 +144,7 @@ class SourceTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Source(1);
@@ -171,7 +171,7 @@ class SourceTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context('');
@@ -194,7 +194,7 @@ class SourceTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfEmptyBodyIsGiven() : void
public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{
$this->expectException('InvalidArgumentException');
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -206,7 +206,7 @@ class SourceTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
Source::create('1');
@@ -215,7 +215,7 @@ class SourceTest extends TestCase
/**
* @covers ::__construct
*/
public function testExceptionIsThrownIfStartingLineIsNotInteger() : void
public function testExceptionIsThrownIfStartingLineIsNotInteger(): void
{
$this->expectException('InvalidArgumentException');
new Source('blabla');
@@ -224,7 +224,7 @@ class SourceTest extends TestCase
/**
* @covers ::__construct
*/
public function testExceptionIsThrownIfLineCountIsNotIntegerOrNull() : void
public function testExceptionIsThrownIfLineCountIsNotIntegerOrNull(): void
{
$this->expectException('InvalidArgumentException');
new Source('1', []);
+15 -15
View File
@@ -31,7 +31,7 @@ class ThrowsTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -42,7 +42,7 @@ class ThrowsTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Throws(new String_(), new Description('Description'));
@@ -58,7 +58,7 @@ class ThrowsTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Throws(new String_(), new Description('Description'));
@@ -71,7 +71,7 @@ class ThrowsTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Throws(new String_(), new Description('Description'));
@@ -85,7 +85,7 @@ class ThrowsTest extends TestCase
* @covers ::__construct
* @covers ::getType
*/
public function testHasType() : void
public function testHasType(): void
{
$expected = new String_();
@@ -100,7 +100,7 @@ class ThrowsTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -115,7 +115,7 @@ class ThrowsTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Throws(new String_(), new Description('Description'));
@@ -134,7 +134,7 @@ class ThrowsTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Throws(new String_());
@@ -157,7 +157,7 @@ class ThrowsTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -193,7 +193,7 @@ class ThrowsTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithGenericWithSpace() : void
public function testFactoryMethodWithGenericWithSpace(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -222,7 +222,7 @@ class ThrowsTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithGenericWithSpaceAndAddedEmojisToVerifyMultiByteBehaviour() : void
public function testFactoryMethodWithGenericWithSpaceAndAddedEmojisToVerifyMultiByteBehaviour(): void
{
$this->markTestSkipped('A bug in the TypeResolver breaks this test');
$this->expectException(InvalidArgumentException::class);
@@ -250,7 +250,7 @@ class ThrowsTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithEmojisToVerifyMultiByteBehaviour() : void
public function testFactoryMethodWithEmojisToVerifyMultiByteBehaviour(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = new TypeResolver();
@@ -271,7 +271,7 @@ class ThrowsTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfBodyIsNotEmpty() : void
public function testFactoryMethodFailsIfBodyIsNotEmpty(): void
{
$this->expectException('InvalidArgumentException');
$this->assertNull(Throws::create(''));
@@ -280,7 +280,7 @@ class ThrowsTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfResolverIsNull() : void
public function testFactoryMethodFailsIfResolverIsNull(): void
{
$this->expectException('InvalidArgumentException');
Throws::create('body');
@@ -289,7 +289,7 @@ class ThrowsTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
Throws::create('body', new TypeResolver());
+14 -14
View File
@@ -31,7 +31,7 @@ class UsesTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -42,7 +42,7 @@ class UsesTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Uses(new Fqsen('\DateTime'), new Description('Description'));
@@ -58,7 +58,7 @@ class UsesTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Uses(new Fqsen('\DateTime'), new Description('Description'));
@@ -71,7 +71,7 @@ class UsesTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Uses(new Fqsen('\DateTime'), new Description('Description'));
@@ -85,7 +85,7 @@ class UsesTest extends TestCase
* @covers ::__construct
* @covers ::getReference
*/
public function testHasReferenceToFqsen() : void
public function testHasReferenceToFqsen(): void
{
$expected = new Fqsen('\DateTime');
@@ -100,7 +100,7 @@ class UsesTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -115,7 +115,7 @@ class UsesTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Uses(new Fqsen('\DateTime'), new Description('Description'));
@@ -128,7 +128,7 @@ class UsesTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Uses(new Fqsen('\\'));
@@ -157,7 +157,7 @@ class UsesTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$resolver = m::mock(FqsenResolver::class);
@@ -187,7 +187,7 @@ class UsesTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithoutSpaceBeforeClass() : void
public function testFactoryMethodWithoutSpaceBeforeClass(): void
{
$fqsenResolver = new FqsenResolver();
$tagFactory = new StandardTagFactory($fqsenResolver);
@@ -217,7 +217,7 @@ class UsesTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithSpaceBeforeClass() : void
public function testFactoryMethodWithSpaceBeforeClass(): void
{
$fqsenResolver = new FqsenResolver();
$tagFactory = new StandardTagFactory($fqsenResolver);
@@ -240,7 +240,7 @@ class UsesTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfBodyIsNotEmpty() : void
public function testFactoryMethodFailsIfBodyIsNotEmpty(): void
{
$this->expectException('InvalidArgumentException');
$this->assertNull(Uses::create(''));
@@ -249,7 +249,7 @@ class UsesTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfResolverIsNull() : void
public function testFactoryMethodFailsIfResolverIsNull(): void
{
$this->expectException('InvalidArgumentException');
Uses::create('body');
@@ -258,7 +258,7 @@ class UsesTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
Uses::create('body', new FqsenResolver());
+17 -17
View File
@@ -33,7 +33,7 @@ class VarTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -44,7 +44,7 @@ class VarTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Var_('myVariable', null, new Description('Description'));
@@ -56,7 +56,7 @@ class VarTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfVariableNameIsOmmitedIfEmpty() : void
public function testIfVariableNameIsOmmitedIfEmpty(): void
{
$fixture = new Var_('', null, null);
@@ -72,7 +72,7 @@ class VarTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Var_('myVariable', new String_(), new Description('Description'));
$this->assertSame('@var string $myVariable Description', $fixture->render());
@@ -89,7 +89,7 @@ class VarTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Var_('myVariable');
@@ -103,7 +103,7 @@ class VarTest extends TestCase
* @covers ::__construct
* @covers ::getVariableName
*/
public function testHasVariableName() : void
public function testHasVariableName(): void
{
$expected = 'myVariable';
@@ -116,7 +116,7 @@ class VarTest extends TestCase
* @covers ::__construct
* @covers ::getType
*/
public function testHasType() : void
public function testHasType(): void
{
$expected = new String_();
@@ -131,7 +131,7 @@ class VarTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -147,7 +147,7 @@ class VarTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Var_('myVariable', new String_(), new Description('Description'));
@@ -161,7 +161,7 @@ class VarTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Var_('myVariable');
@@ -188,7 +188,7 @@ class VarTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$typeResolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -213,7 +213,7 @@ class VarTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithoutType() : void
public function testFactoryMethodWithoutType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -242,7 +242,7 @@ class VarTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithType() : void
public function testFactoryMethodWithType(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -271,7 +271,7 @@ class VarTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodWithTypeWithoutComment() : void
public function testFactoryMethodWithTypeWithoutComment(): void
{
$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();
@@ -299,7 +299,7 @@ class VarTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfEmptyBodyIsGiven() : void
public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void
{
$this->expectException('InvalidArgumentException');
$descriptionFactory = m::mock(DescriptionFactory::class);
@@ -309,7 +309,7 @@ class VarTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodFailsIfResolverIsNull() : void
public function testFactoryMethodFailsIfResolverIsNull(): void
{
$this->expectException('InvalidArgumentException');
Var_::create('body');
@@ -320,7 +320,7 @@ class VarTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void
public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void
{
$this->expectException('InvalidArgumentException');
Var_::create('body', new TypeResolver());
+11 -11
View File
@@ -28,7 +28,7 @@ class VersionTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -39,7 +39,7 @@ class VersionTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfCorrectTagNameIsReturned() : void
public function testIfCorrectTagNameIsReturned(): void
{
$fixture = new Version('1.0', new Description('Description'));
@@ -55,7 +55,7 @@ class VersionTest extends TestCase
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
*/
public function testIfTagCanBeRenderedUsingDefaultFormatter() : void
public function testIfTagCanBeRenderedUsingDefaultFormatter(): void
{
$fixture = new Version('1.0', new Description('Description'));
@@ -68,7 +68,7 @@ class VersionTest extends TestCase
*
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
*/
public function testIfTagCanBeRenderedUsingSpecificFormatter() : void
public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
{
$fixture = new Version('1.0', new Description('Description'));
@@ -82,7 +82,7 @@ class VersionTest extends TestCase
* @covers ::__construct
* @covers ::getVersion
*/
public function testHasVersionNumber() : void
public function testHasVersionNumber(): void
{
$expected = '1.0';
@@ -97,7 +97,7 @@ class VersionTest extends TestCase
* @covers ::__construct
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
*/
public function testHasDescription() : void
public function testHasDescription(): void
{
$expected = new Description('Description');
@@ -112,7 +112,7 @@ class VersionTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturned() : void
public function testStringRepresentationIsReturned(): void
{
$fixture = new Version('1.0', new Description('Description'));
@@ -125,7 +125,7 @@ class VersionTest extends TestCase
* @covers ::__construct
* @covers ::__toString
*/
public function testStringRepresentationIsReturnedWithoutDescription() : void
public function testStringRepresentationIsReturnedWithoutDescription(): void
{
$fixture = new Version('1.0');
@@ -146,7 +146,7 @@ class VersionTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethod() : void
public function testFactoryMethod(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$context = new Context('');
@@ -171,7 +171,7 @@ class VersionTest extends TestCase
*
* @covers ::create
*/
public function testFactoryMethodCreatesEmptyVersionTag() : void
public function testFactoryMethodCreatesEmptyVersionTag(): void
{
$descriptionFactory = m::mock(DescriptionFactory::class);
$descriptionFactory->shouldReceive('create')->never();
@@ -186,7 +186,7 @@ class VersionTest extends TestCase
/**
* @covers ::create
*/
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex() : void
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex(): void
{
$this->assertNull(Version::create('dkhf<'));
}
+10 -10
View File
@@ -35,7 +35,7 @@ class DocBlockFactoryTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -47,7 +47,7 @@ class DocBlockFactoryTest extends TestCase
* @covers ::__construct
* @covers ::createInstance
*/
public function testCreateFactoryUsingFactoryMethod() : void
public function testCreateFactoryUsingFactoryMethod(): void
{
$fixture = DocBlockFactory::createInstance();
@@ -60,7 +60,7 @@ class DocBlockFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testCreateDocBlockFromReflection() : void
public function testCreateDocBlockFromReflection(): void
{
$fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class));
@@ -83,7 +83,7 @@ class DocBlockFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testCreateDocBlockFromStringWithDocComment() : void
public function testCreateDocBlockFromStringWithDocComment(): void
{
$fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class));
@@ -103,7 +103,7 @@ class DocBlockFactoryTest extends TestCase
* @covers ::create
* @covers ::__construct
*/
public function testCreateDocBlockFromStringWithoutDocComment() : void
public function testCreateDocBlockFromStringWithoutDocComment(): void
{
$fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class));
@@ -126,7 +126,7 @@ class DocBlockFactoryTest extends TestCase
*
* @dataProvider provideSummaryAndDescriptions
*/
public function testSummaryAndDescriptionAreSeparated(string $given, string $summary, string $description) : void
public function testSummaryAndDescriptionAreSeparated(string $given, string $summary, string $description): void
{
$tagFactory = m::mock(TagFactory::class);
$fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory);
@@ -144,7 +144,7 @@ class DocBlockFactoryTest extends TestCase
* @covers ::__construct
* @covers ::create
*/
public function testDescriptionsRetainFormatting() : void
public function testDescriptionsRetainFormatting(): void
{
$tagFactory = m::mock(TagFactory::class);
$fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory);
@@ -178,7 +178,7 @@ DESCRIPTION;
* @covers ::__construct
* @covers ::create
*/
public function testTagsAreInterpretedUsingFactory() : void
public function testTagsAreInterpretedUsingFactory(): void
{
$tagString = <<<TAG
@author Mike van Riel <[email protected]> This is with
@@ -208,7 +208,7 @@ DOCBLOCK;
/**
* @return string[]
*/
public function provideSummaryAndDescriptions() : array
public function provideSummaryAndDescriptions(): array
{
return [
['This is a DocBlock', 'This is a DocBlock', ''],
@@ -268,7 +268,7 @@ DOCBLOCK
* @covers ::__construct
* @covers ::create
*/
public function testTagsWithContextNamespace() : void
public function testTagsWithContextNamespace(): void
{
$tagFactoryMock = m::mock(TagFactory::class);
$fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), $tagFactoryMock);
+15 -15
View File
@@ -30,7 +30,7 @@ class DocBlockTest extends TestCase
/**
* Call Mockery::close after each test.
*/
public function tearDown() : void
public function tearDown(): void
{
m::close();
}
@@ -41,7 +41,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::getSummary
*/
public function testDocBlockCanHaveASummary() : void
public function testDocBlockCanHaveASummary(): void
{
$summary = 'This is a summary';
@@ -56,7 +56,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::getSummary
*/
public function testDocBlockCanHaveEllipsisInSummary() : void
public function testDocBlockCanHaveEllipsisInSummary(): void
{
$summary = 'This is a short (...) description.';
@@ -71,7 +71,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::getDescription
*/
public function testDocBlockCanHaveADescription() : void
public function testDocBlockCanHaveADescription(): void
{
$description = new DocBlock\Description('');
@@ -87,7 +87,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::getTags
*/
public function testDocBlockCanHaveTags() : void
public function testDocBlockCanHaveTags(): void
{
$tags = [
m::mock(DocBlock\Tag::class),
@@ -105,7 +105,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::getTags
*/
public function testDocBlockAllowsOnlyTags() : void
public function testDocBlockAllowsOnlyTags(): void
{
$this->expectException('InvalidArgumentException');
$tags = [null];
@@ -120,7 +120,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::getTagsByName
*/
public function testFindTagsInDocBlockByName() : void
public function testFindTagsInDocBlockByName(): void
{
$tag1 = m::mock(DocBlock\Tag::class);
$tag2 = m::mock(DocBlock\Tag::class);
@@ -147,7 +147,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::getTagsWithTypeByName
*/
public function testFindTagsWithTypeInDocBlockByName() : void
public function testFindTagsWithTypeInDocBlockByName(): void
{
$tag1 = new DocBlock\Tags\Var_('foo', new String_());
$tag2 = new DocBlock\Tags\Var_('bar', new String_());
@@ -169,7 +169,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::hasTag
*/
public function testCheckIfThereAreTagsWithAGivenName() : void
public function testCheckIfThereAreTagsWithAGivenName(): void
{
$tag1 = m::mock(DocBlock\Tag::class);
$tag2 = m::mock(DocBlock\Tag::class);
@@ -193,7 +193,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::getContext
*/
public function testDocBlockKnowsInWhichNamespaceItIsAndWhichAliasesThereAre() : void
public function testDocBlockKnowsInWhichNamespaceItIsAndWhichAliasesThereAre(): void
{
$context = new Context('');
@@ -209,7 +209,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::getLocation
*/
public function testDocBlockKnowsAtWhichLineItIs() : void
public function testDocBlockKnowsAtWhichLineItIs(): void
{
$location = new Location(10);
@@ -225,7 +225,7 @@ class DocBlockTest extends TestCase
* @covers ::isTemplateStart
* @covers ::isTemplateEnd
*/
public function testDocBlockIsNotATemplateByDefault() : void
public function testDocBlockIsNotATemplateByDefault(): void
{
$fixture = new DocBlock('', null, [], null, null);
@@ -239,7 +239,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::isTemplateStart
*/
public function testDocBlockKnowsIfItIsTheStartOfADocBlockTemplate() : void
public function testDocBlockKnowsIfItIsTheStartOfADocBlockTemplate(): void
{
$fixture = new DocBlock('', null, [], null, null, true);
@@ -252,7 +252,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::isTemplateEnd
*/
public function testDocBlockKnowsIfItIsTheEndOfADocBlockTemplate() : void
public function testDocBlockKnowsIfItIsTheEndOfADocBlockTemplate(): void
{
$fixture = new DocBlock('', null, [], null, null, false, true);
@@ -265,7 +265,7 @@ class DocBlockTest extends TestCase
* @covers ::__construct
* @covers ::removeTag
*/
public function testRemoveTag() : void
public function testRemoveTag(): void
{
$someTag = new Deprecated();
$anotherTag = new Deprecated();
+2 -2
View File
@@ -22,7 +22,7 @@ final class PcreExceptionTest extends TestCase
* @covers ::createFromPhpError
* @dataProvider errorCodeProvider
*/
public function testErrorConversion(int $errorCode, string $message) : void
public function testErrorConversion(int $errorCode, string $message): void
{
$this->assertSame($message, PcreException::createFromPhpError($errorCode)->getMessage());
}
@@ -30,7 +30,7 @@ final class PcreExceptionTest extends TestCase
/**
* @return array<int, (string|int)[]>
*/
public function errorCodeProvider() : array
public function errorCodeProvider(): array
{
return [
[
+4 -4
View File
@@ -14,7 +14,7 @@ final class PregSplitTest extends TestCase
/** @var callable|null */
private $errorHandler = null;
protected function tearDown() : void
protected function tearDown(): void
{
if ($this->errorHandler === null) {
return;
@@ -26,7 +26,7 @@ final class PregSplitTest extends TestCase
/**
* @covers \phpDocumentor\Reflection\Utils::pregSplit
*/
public function testSimplePregSplit() : void
public function testSimplePregSplit(): void
{
$result = Utils::pregSplit('/\s/', 'word split');
@@ -36,10 +36,10 @@ final class PregSplitTest extends TestCase
/**
* @covers \phpDocumentor\Reflection\Utils::pregSplit
*/
public function testPregSplitThrowsOnError() : void
public function testPregSplitThrowsOnError(): void
{
//We need to disable the error handler for phpunit... because we expect some errors here
$this->errorHandler = set_error_handler(static function () : void {
$this->errorHandler = set_error_handler(static function (): void {
}, E_WARNING);
$this->expectException(PcreException::class);