Apply new code style

This commit is contained in:
Jaapio
2019-09-20 10:54:12 +02:00
parent 8fcadfe5f8
commit aee984014b
71 changed files with 1661 additions and 1286 deletions
+50 -50
View File
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
/**
* This file is part of phpDocumentor.
@@ -6,8 +8,6 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2010-2018 Mike van Riel<[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
@@ -19,27 +19,28 @@ use phpDocumentor\Reflection\Types\Context;
use PHPUnit\Framework\TestCase;
/**
* @uses \Webmozart\Assert\Assert
*
* @coversDefaultClass phpDocumentor\Reflection\DocBlock
* @covers ::<private>
* @uses \Webmozart\Assert\Assert
*/
class DocBlockTest extends TestCase
{
/**
* Call Mockery::close after each test.
*/
public function tearDown(): void
public function tearDown() : void
{
m::close();
}
/**
* @uses \phpDocumentor\Reflection\DocBlock\Description
*
* @covers ::__construct
* @covers ::getSummary
*
* @uses \phpDocumentor\Reflection\DocBlock\Description
*/
public function testDocBlockCanHaveASummary(): void
public function testDocBlockCanHaveASummary() : void
{
$summary = 'This is a summary';
@@ -49,12 +50,12 @@ class DocBlockTest extends TestCase
}
/**
* @uses \phpDocumentor\Reflection\DocBlock\Description
*
* @covers ::__construct
* @covers ::getSummary
*
* @uses \phpDocumentor\Reflection\DocBlock\Description
*/
public function testDocBlockCanHaveEllipsisInSummary(): void
public function testDocBlockCanHaveEllipsisInSummary() : void
{
$summary = 'This is a short (...) description.';
@@ -64,12 +65,12 @@ class DocBlockTest extends TestCase
}
/**
* @uses \phpDocumentor\Reflection\DocBlock\Description
*
* @covers ::__construct
* @covers ::getDescription
*
* @uses \phpDocumentor\Reflection\DocBlock\Description
*/
public function testDocBlockCanHaveADescription(): void
public function testDocBlockCanHaveADescription() : void
{
$description = new DocBlock\Description('');
@@ -79,13 +80,13 @@ class DocBlockTest extends TestCase
}
/**
* @covers ::__construct
* @covers ::getTags
*
* @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tag
*
* @covers ::__construct
* @covers ::getTags
*/
public function testDocBlockCanHaveTags(): void
public function testDocBlockCanHaveTags() : void
{
$tags = [
m::mock(DocBlock\Tag::class),
@@ -97,29 +98,28 @@ class DocBlockTest extends TestCase
}
/**
* @covers ::__construct
* @covers ::getTags
* @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tag
*
* @covers ::__construct
* @covers ::getTags
*/
public function testDocBlockAllowsOnlyTags(): void
public function testDocBlockAllowsOnlyTags() : void
{
$this->expectException('InvalidArgumentException');
$tags = [
null,
];
$tags = [null];
$fixture = new DocBlock('', null, $tags);
}
/**
* @covers ::__construct
* @covers ::getTagsByName
*
* @uses \phpDocumentor\Reflection\DocBlock::getTags
* @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tag
*
* @covers ::__construct
* @covers ::getTagsByName
*/
public function testFindTagsInDocBlockByName(): void
public function testFindTagsInDocBlockByName() : void
{
$tag1 = m::mock(DocBlock\Tag::class);
$tag2 = m::mock(DocBlock\Tag::class);
@@ -137,14 +137,14 @@ class DocBlockTest extends TestCase
}
/**
* @covers ::__construct
* @covers ::hasTag
*
* @uses \phpDocumentor\Reflection\DocBlock::getTags
* @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tag
*
* @covers ::__construct
* @covers ::hasTag
*/
public function testCheckIfThereAreTagsWithAGivenName(): void
public function testCheckIfThereAreTagsWithAGivenName() : void
{
$tag1 = m::mock(DocBlock\Tag::class);
$tag2 = m::mock(DocBlock\Tag::class);
@@ -162,13 +162,13 @@ class DocBlockTest extends TestCase
}
/**
* @covers ::__construct
* @covers ::getContext
*
* @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Types\Context
*
* @covers ::__construct
* @covers ::getContext
*/
public function testDocBlockKnowsInWhichNamespaceItIsAndWhichAliasesThereAre(): void
public function testDocBlockKnowsInWhichNamespaceItIsAndWhichAliasesThereAre() : void
{
$context = new Context('');
@@ -178,13 +178,13 @@ class DocBlockTest extends TestCase
}
/**
* @covers ::__construct
* @covers ::getLocation
*
* @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\Location
*
* @covers ::__construct
* @covers ::getLocation
*/
public function testDocBlockKnowsAtWhichLineItIs(): void
public function testDocBlockKnowsAtWhichLineItIs() : void
{
$location = new Location(10);
@@ -194,12 +194,12 @@ class DocBlockTest extends TestCase
}
/**
* @uses \phpDocumentor\Reflection\DocBlock\Description
*
* @covers ::__construct
* @covers ::isTemplateStart
*
* @uses \phpDocumentor\Reflection\DocBlock\Description
*/
public function testDocBlockKnowsIfItIsTheStartOfADocBlockTemplate(): void
public function testDocBlockKnowsIfItIsTheStartOfADocBlockTemplate() : void
{
$fixture = new DocBlock('', null, [], null, null, true);
@@ -207,12 +207,12 @@ class DocBlockTest extends TestCase
}
/**
* @uses \phpDocumentor\Reflection\DocBlock\Description
*
* @covers ::__construct
* @covers ::isTemplateEnd
*
* @uses \phpDocumentor\Reflection\DocBlock\Description
*/
public function testDocBlockKnowsIfItIsTheEndOfADocBlockTemplate(): void
public function testDocBlockKnowsIfItIsTheEndOfADocBlockTemplate() : void
{
$fixture = new DocBlock('', null, [], null, null, false, true);
@@ -220,14 +220,14 @@ class DocBlockTest extends TestCase
}
/**
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated
*
* @covers ::__construct
* @covers ::removeTag
*
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated
*/
public function testRemoveTag(): void
public function testRemoveTag() : void
{
$someTag = new Deprecated();
$someTag = new Deprecated();
$anotherTag = new Deprecated();
$fixture = new DocBlock('', null, [$someTag]);