Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Element.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/**
* phpDocumentor
*
Expand Down
2 changes: 2 additions & 0 deletions src/File.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/**
* This file is part of phpDocumentor.
*
Expand Down
16 changes: 6 additions & 10 deletions src/Fqsen.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/**
* phpDocumentor
*
Expand Down Expand Up @@ -31,11 +33,9 @@ final class Fqsen
/**
* Initializes the object.
*
* @param string $fqsen
*
* @throws \InvalidArgumentException when $fqsen is not matching the format.
* @throws InvalidArgumentException when $fqsen is not matching the format.
*/
public function __construct($fqsen)
public function __construct(string $fqsen)
{
$matches = [];
$result = preg_match(
Expand All @@ -62,20 +62,16 @@ public function __construct($fqsen)

/**
* converts this class to string.
*
* @return string
*/
public function __toString()
public function __toString(): string
{
return $this->fqsen;
}

/**
* Returns the name of the element without path.
*
* @return string
*/
public function getName()
public function getName(): string
{
return $this->name;
}
Expand Down
15 changes: 5 additions & 10 deletions src/Location.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/**
* This file is part of phpDocumentor.
*
Expand All @@ -25,32 +27,25 @@ final class Location

/**
* Initializes the location for an element using its line number in the file and optionally the column number.
*
* @param int $lineNumber
* @param int $columnNumber
*/
public function __construct($lineNumber, $columnNumber = 0)
public function __construct(int $lineNumber, int $columnNumber = 0)
{
$this->lineNumber = $lineNumber;
$this->columnNumber = $columnNumber;
}

/**
* Returns the line number that is covered by this location.
*
* @return integer
*/
public function getLineNumber()
public function getLineNumber(): int
{
return $this->lineNumber;
}

/**
* Returns the column number (character position on a line) for this location object.
*
* @return integer
*/
public function getColumnNumber()
public function getColumnNumber(): int
{
return $this->columnNumber;
}
Expand Down
4 changes: 3 additions & 1 deletion src/Project.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/**
* phpDocumentor
*
Expand All @@ -21,5 +23,5 @@ interface Project
*
* @return string
*/
public function getName();
public function getName(): string;
}
4 changes: 3 additions & 1 deletion src/ProjectFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/**
* phpDocumentor
*
Expand All @@ -24,5 +26,5 @@ interface ProjectFactory
* @param File[] $files
* @return Project
*/
public function create($name, array $files);
public function create($name, array $files): Project;
}