Skip to content

Commit

Permalink
CS: various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Aug 8, 2021
1 parent 73d8596 commit 18cb8b5
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ interface Element
/**
* Returns the Fqsen of the element.
*/
public function getFqsen() : Fqsen;
public function getFqsen(): Fqsen;

/**
* Returns the name of the element.
*/
public function getName() : string;
public function getName(): string;
}
6 changes: 3 additions & 3 deletions src/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ interface File
/**
* Returns the content of the file as a string.
*/
public function getContents() : string;
public function getContents(): string;

/**
* Returns md5 hash of the file.
*/
public function md5() : string;
public function md5(): string;

/**
* Returns an relative path to the file.
*/
public function path() : string;
public function path(): string;
}
5 changes: 3 additions & 2 deletions src/Fqsen.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace phpDocumentor\Reflection;

use InvalidArgumentException;

use function end;
use function explode;
use function preg_match;
Expand Down Expand Up @@ -73,15 +74,15 @@ public function __construct(string $fqsen)
/**
* converts this class to string.
*/
public function __toString() : string
public function __toString(): string
{
return $this->fqsen;
}

/**
* Returns the name of the element without path.
*/
public function getName() : string
public function getName(): string
{
return $this->name;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ public function __construct(int $lineNumber, int $columnNumber = 0)
/**
* Returns the line number that is covered by this location.
*/
public function getLineNumber() : int
public function getLineNumber(): int
{
return $this->lineNumber;
}

/**
* Returns the column number (character position on a line) for this location object.
*/
public function getColumnNumber() : int
public function getColumnNumber(): int
{
return $this->columnNumber;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ interface Project
/**
* Returns the name of the project.
*/
public function getName() : string;
public function getName(): string;
}
2 changes: 1 addition & 1 deletion src/ProjectFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ interface ProjectFactory
*
* @param File[] $files
*/
public function create(string $name, array $files) : Project;
public function create(string $name, array $files): Project;
}
10 changes: 5 additions & 5 deletions tests/unit/FqsenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FqsenTest extends TestCase
* @covers ::getName
* @dataProvider validFqsenProvider
*/
public function testValidFormats(string $fqsen, string $name) : void
public function testValidFormats(string $fqsen, string $name): void
{
$instance = new Fqsen($fqsen);
$this->assertEquals($name, $instance->getName());
Expand All @@ -37,7 +37,7 @@ public function testValidFormats(string $fqsen, string $name) : void
*
* @return array<array<string>>
*/
public function validFqsenProvider() : array
public function validFqsenProvider(): array
{
return [
['\\', ''],
Expand All @@ -59,7 +59,7 @@ public function validFqsenProvider() : array
* @covers ::__construct
* @dataProvider invalidFqsenProvider
*/
public function testInValidFormats(string $fqsen) : void
public function testInValidFormats(string $fqsen): void
{
$this->expectException(InvalidArgumentException::class);
new Fqsen($fqsen);
Expand All @@ -70,7 +70,7 @@ public function testInValidFormats(string $fqsen) : void
*
* @return array<array<string>>
*/
public function invalidFqsenProvider() : array
public function invalidFqsenProvider(): array
{
return [
['\My\*'],
Expand All @@ -84,7 +84,7 @@ public function invalidFqsenProvider() : array
* @covers ::__construct
* @covers ::__toString
*/
public function testToString() : void
public function testToString(): void
{
$className = new Fqsen('\\phpDocumentor\\Application');

Expand Down

0 comments on commit 18cb8b5

Please sign in to comment.