Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
fixed travis, added further function return annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
k00ni committed Jun 27, 2018
1 parent 275264d commit 2e7b59e
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sudo: true
before_install:
- travis_retry composer install --dev --no-interaction
# Install coveralls.phar
- wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.1.1/coveralls.phar
- wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.1.0/coveralls.phar
- chmod +x coveralls.phar
- php coveralls.phar --version

Expand Down
18 changes: 9 additions & 9 deletions AbstractBlankNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ abstract class AbstractBlankNode implements BlankNode
*
* @since 0.1
*/
public function equals(Node $toCompare)
public function equals(Node $toCompare): bool
{
if ($toCompare instanceof BlankNode) {
return $this->getBlankId() === $toCompare->getBlankId();
Expand All @@ -51,7 +51,7 @@ public function equals(Node $toCompare)
*
* @since 0.1
*/
public function matches(Node $toMatch)
public function matches(Node $toMatch): bool
{
return $this->equals($toMatch);
}
Expand All @@ -65,7 +65,7 @@ public function matches(Node $toMatch)
*
* @since 0.1
*/
public function isConcrete()
public function isConcrete(): bool
{
return true;
}
Expand All @@ -79,7 +79,7 @@ public function isConcrete()
*
* @since 0.1
*/
public function isLiteral()
public function isLiteral(): bool
{
return false;
}
Expand All @@ -93,7 +93,7 @@ public function isLiteral()
*
* @since 0.1
*/
public function isNamed()
public function isNamed(): bool
{
return false;
}
Expand All @@ -107,7 +107,7 @@ public function isNamed()
*
* @since 0.1
*/
public function isBlank()
public function isBlank(): bool
{
return true;
}
Expand All @@ -121,7 +121,7 @@ public function isBlank()
*
* @since 0.1
*/
public function isPattern()
public function isPattern(): bool
{
return false;
}
Expand All @@ -135,7 +135,7 @@ public function isPattern()
*
* @since 0.1
*/
public function toNQuads()
public function toNQuads(): string
{
return '_:'.$this->getBlankId();
}
Expand All @@ -150,7 +150,7 @@ public function toNQuads()
*
* @since 0.1
*/
public function __toString()
public function __toString(): string
{
return $this->toNQuads();
}
Expand Down
20 changes: 10 additions & 10 deletions AbstractLiteral.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract class AbstractLiteral implements Literal
*
* @since 0.1
*/
public function __toString()
public function __toString(): string
{
return (string) $this->getValue();
}
Expand All @@ -44,7 +44,7 @@ public function __toString()
*
* @since 0.1
*/
public function equals(Node $toCompare)
public function equals(Node $toCompare): bool
{
// Only compare, if given instance is a literal
if ($toCompare->isLiteral() && $this->getDatatype()->equals($toCompare->getDatatype())) {
Expand All @@ -68,7 +68,7 @@ public function equals(Node $toCompare)
*
* @since 0.1
*/
public function matches(Node $toMatch)
public function matches(Node $toMatch): bool
{
return $this->equals($toMatch);
}
Expand All @@ -82,7 +82,7 @@ public function matches(Node $toMatch)
*
* @since 0.1
*/
public function isBlank()
public function isBlank(): bool
{
return false;
}
Expand All @@ -96,7 +96,7 @@ public function isBlank()
*
* @since 0.1
*/
public function isConcrete()
public function isConcrete(): bool
{
return true;
}
Expand All @@ -110,7 +110,7 @@ public function isConcrete()
*
* @since 0.1
*/
public function isLiteral()
public function isLiteral(): bool
{
return true;
}
Expand All @@ -124,7 +124,7 @@ public function isLiteral()
*
* @since 0.1
*/
public function isNamed()
public function isNamed(): bool
{
return false;
}
Expand All @@ -138,7 +138,7 @@ public function isNamed()
*
* @since 0.1
*/
public function isPattern()
public function isPattern(): bool
{
return false;
}
Expand All @@ -152,7 +152,7 @@ public function isPattern()
*
* @since 0.1
*/
public function toNQuads()
public function toNQuads(): string
{
$string = '"'.$this->encodeStringLitralForNQuads($this->getValue()).'"';

Expand All @@ -170,7 +170,7 @@ public function toNQuads()
*
* @return string encoded string for n-quads
*/
protected function encodeStringLitralForNQuads($s)
protected function encodeStringLitralForNQuads($s): string
{
$s = str_replace('\\', '\\\\', $s);
$s = str_replace("\t", '\t', $s);
Expand Down
18 changes: 9 additions & 9 deletions AbstractNamedNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract class AbstractNamedNode implements NamedNode
*
* @since 0.1
*/
public function __toString()
public function __toString(): string
{
return $this->getUri();
}
Expand All @@ -45,7 +45,7 @@ public function __toString()
*
* @since 0.1
*/
public function equals(Node $toCompare)
public function equals(Node $toCompare): bool
{
// It only compares URIs, everything else will be quit with false.
if ($toCompare->isNamed()) {
Expand All @@ -67,7 +67,7 @@ public function equals(Node $toCompare)
*
* @since 0.1
*/
public function matches(Node $toMatch)
public function matches(Node $toMatch): bool
{
return $this->equals($toMatch);
}
Expand All @@ -81,7 +81,7 @@ public function matches(Node $toMatch)
*
* @since 0.1
*/
public function isConcrete()
public function isConcrete(): bool
{
return true;
}
Expand All @@ -95,7 +95,7 @@ public function isConcrete()
*
* @since 0.1
*/
public function isLiteral()
public function isLiteral(): bool
{
return false;
}
Expand All @@ -109,7 +109,7 @@ public function isLiteral()
*
* @since 0.1
*/
public function isNamed()
public function isNamed(): bool
{
return true;
}
Expand All @@ -123,7 +123,7 @@ public function isNamed()
*
* @since 0.1
*/
public function isBlank()
public function isBlank(): bool
{
return false;
}
Expand All @@ -137,7 +137,7 @@ public function isBlank()
*
* @since 0.1
*/
public function isPattern()
public function isPattern(): bool
{
return false;
}
Expand All @@ -151,7 +151,7 @@ public function isPattern()
*
* @since 0.1
*/
public function toNQuads()
public function toNQuads(): string
{
return '<'.$this->getUri().'>';
}
Expand Down
18 changes: 9 additions & 9 deletions AnyPatternImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AnyPatternImpl implements AnyPattern
*
* @return bool true, if this instance is a blank node, false otherwise
*/
public function isBlank()
public function isBlank(): bool
{
return false;
}
Expand All @@ -35,7 +35,7 @@ public function isBlank()
*
* @return bool true, if this instance is concrete, false otherwise
*/
public function isConcrete()
public function isConcrete(): bool
{
return false;
}
Expand All @@ -45,7 +45,7 @@ public function isConcrete()
*
* @return bool true, if it is a literal, false otherwise
*/
public function isLiteral()
public function isLiteral(): bool
{
return false;
}
Expand All @@ -55,7 +55,7 @@ public function isLiteral()
*
* @return bool true, if it is a named node, false otherwise
*/
public function isNamed()
public function isNamed(): bool
{
return false;
}
Expand All @@ -65,7 +65,7 @@ public function isNamed()
*
* @return bool true, if this instance is a pattern, false otherwise
*/
public function isPattern()
public function isPattern(): bool
{
return true;
}
Expand All @@ -77,7 +77,7 @@ public function isPattern()
*
* @return bool true, if both instances are semantically equal, false otherwise
*/
public function equals(Node $toCompare)
public function equals(Node $toCompare): bool
{
// Only compare, if given instance is an AnyPattern too
return $toCompare instanceof AnyPatternImpl;
Expand All @@ -90,7 +90,7 @@ public function equals(Node $toCompare)
*
* @return bool always true
*/
public function matches(Node $toMatch)
public function matches(Node $toMatch): bool
{
return true;
}
Expand All @@ -101,7 +101,7 @@ public function matches(Node $toMatch)
*
* @return string a human readable string representation of the node
*/
public function __toString()
public function __toString(): string
{
return 'ANY';
}
Expand All @@ -113,7 +113,7 @@ public function __toString()
*
* @throws \Exception if no n-quads representation is available
*/
public function toNQuads()
public function toNQuads(): string
{
throw new \Exception('The AnyPattern is not valid in NQuads');
}
Expand Down
2 changes: 1 addition & 1 deletion BlankNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ interface BlankNode extends Node
*
* @since 0.1
*/
public function getBlankId();
public function getBlankId(): string;
}
2 changes: 1 addition & 1 deletion BlankNodeImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct($blankId)
}
}

public function getBlankId()
public function getBlankId(): string
{
return $this->blankId;
}
Expand Down
Loading

0 comments on commit 2e7b59e

Please sign in to comment.