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

Commit 2e7b59e

Browse files
committed
fixed travis, added further function return annotations
1 parent 275264d commit 2e7b59e

12 files changed

+59
-59
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sudo: true
3131
before_install:
3232
- travis_retry composer install --dev --no-interaction
3333
# Install coveralls.phar
34-
- wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.1.1/coveralls.phar
34+
- wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.1.0/coveralls.phar
3535
- chmod +x coveralls.phar
3636
- php coveralls.phar --version
3737

AbstractBlankNode.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ abstract class AbstractBlankNode implements BlankNode
3030
*
3131
* @since 0.1
3232
*/
33-
public function equals(Node $toCompare)
33+
public function equals(Node $toCompare): bool
3434
{
3535
if ($toCompare instanceof BlankNode) {
3636
return $this->getBlankId() === $toCompare->getBlankId();
@@ -51,7 +51,7 @@ public function equals(Node $toCompare)
5151
*
5252
* @since 0.1
5353
*/
54-
public function matches(Node $toMatch)
54+
public function matches(Node $toMatch): bool
5555
{
5656
return $this->equals($toMatch);
5757
}
@@ -65,7 +65,7 @@ public function matches(Node $toMatch)
6565
*
6666
* @since 0.1
6767
*/
68-
public function isConcrete()
68+
public function isConcrete(): bool
6969
{
7070
return true;
7171
}
@@ -79,7 +79,7 @@ public function isConcrete()
7979
*
8080
* @since 0.1
8181
*/
82-
public function isLiteral()
82+
public function isLiteral(): bool
8383
{
8484
return false;
8585
}
@@ -93,7 +93,7 @@ public function isLiteral()
9393
*
9494
* @since 0.1
9595
*/
96-
public function isNamed()
96+
public function isNamed(): bool
9797
{
9898
return false;
9999
}
@@ -107,7 +107,7 @@ public function isNamed()
107107
*
108108
* @since 0.1
109109
*/
110-
public function isBlank()
110+
public function isBlank(): bool
111111
{
112112
return true;
113113
}
@@ -121,7 +121,7 @@ public function isBlank()
121121
*
122122
* @since 0.1
123123
*/
124-
public function isPattern()
124+
public function isPattern(): bool
125125
{
126126
return false;
127127
}
@@ -135,7 +135,7 @@ public function isPattern()
135135
*
136136
* @since 0.1
137137
*/
138-
public function toNQuads()
138+
public function toNQuads(): string
139139
{
140140
return '_:'.$this->getBlankId();
141141
}
@@ -150,7 +150,7 @@ public function toNQuads()
150150
*
151151
* @since 0.1
152152
*/
153-
public function __toString()
153+
public function __toString(): string
154154
{
155155
return $this->toNQuads();
156156
}

AbstractLiteral.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ abstract class AbstractLiteral implements Literal
2828
*
2929
* @since 0.1
3030
*/
31-
public function __toString()
31+
public function __toString(): string
3232
{
3333
return (string) $this->getValue();
3434
}
@@ -44,7 +44,7 @@ public function __toString()
4444
*
4545
* @since 0.1
4646
*/
47-
public function equals(Node $toCompare)
47+
public function equals(Node $toCompare): bool
4848
{
4949
// Only compare, if given instance is a literal
5050
if ($toCompare->isLiteral() && $this->getDatatype()->equals($toCompare->getDatatype())) {
@@ -68,7 +68,7 @@ public function equals(Node $toCompare)
6868
*
6969
* @since 0.1
7070
*/
71-
public function matches(Node $toMatch)
71+
public function matches(Node $toMatch): bool
7272
{
7373
return $this->equals($toMatch);
7474
}
@@ -82,7 +82,7 @@ public function matches(Node $toMatch)
8282
*
8383
* @since 0.1
8484
*/
85-
public function isBlank()
85+
public function isBlank(): bool
8686
{
8787
return false;
8888
}
@@ -96,7 +96,7 @@ public function isBlank()
9696
*
9797
* @since 0.1
9898
*/
99-
public function isConcrete()
99+
public function isConcrete(): bool
100100
{
101101
return true;
102102
}
@@ -110,7 +110,7 @@ public function isConcrete()
110110
*
111111
* @since 0.1
112112
*/
113-
public function isLiteral()
113+
public function isLiteral(): bool
114114
{
115115
return true;
116116
}
@@ -124,7 +124,7 @@ public function isLiteral()
124124
*
125125
* @since 0.1
126126
*/
127-
public function isNamed()
127+
public function isNamed(): bool
128128
{
129129
return false;
130130
}
@@ -138,7 +138,7 @@ public function isNamed()
138138
*
139139
* @since 0.1
140140
*/
141-
public function isPattern()
141+
public function isPattern(): bool
142142
{
143143
return false;
144144
}
@@ -152,7 +152,7 @@ public function isPattern()
152152
*
153153
* @since 0.1
154154
*/
155-
public function toNQuads()
155+
public function toNQuads(): string
156156
{
157157
$string = '"'.$this->encodeStringLitralForNQuads($this->getValue()).'"';
158158

@@ -170,7 +170,7 @@ public function toNQuads()
170170
*
171171
* @return string encoded string for n-quads
172172
*/
173-
protected function encodeStringLitralForNQuads($s)
173+
protected function encodeStringLitralForNQuads($s): string
174174
{
175175
$s = str_replace('\\', '\\\\', $s);
176176
$s = str_replace("\t", '\t', $s);

AbstractNamedNode.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abstract class AbstractNamedNode implements NamedNode
2929
*
3030
* @since 0.1
3131
*/
32-
public function __toString()
32+
public function __toString(): string
3333
{
3434
return $this->getUri();
3535
}
@@ -45,7 +45,7 @@ public function __toString()
4545
*
4646
* @since 0.1
4747
*/
48-
public function equals(Node $toCompare)
48+
public function equals(Node $toCompare): bool
4949
{
5050
// It only compares URIs, everything else will be quit with false.
5151
if ($toCompare->isNamed()) {
@@ -67,7 +67,7 @@ public function equals(Node $toCompare)
6767
*
6868
* @since 0.1
6969
*/
70-
public function matches(Node $toMatch)
70+
public function matches(Node $toMatch): bool
7171
{
7272
return $this->equals($toMatch);
7373
}
@@ -81,7 +81,7 @@ public function matches(Node $toMatch)
8181
*
8282
* @since 0.1
8383
*/
84-
public function isConcrete()
84+
public function isConcrete(): bool
8585
{
8686
return true;
8787
}
@@ -95,7 +95,7 @@ public function isConcrete()
9595
*
9696
* @since 0.1
9797
*/
98-
public function isLiteral()
98+
public function isLiteral(): bool
9999
{
100100
return false;
101101
}
@@ -109,7 +109,7 @@ public function isLiteral()
109109
*
110110
* @since 0.1
111111
*/
112-
public function isNamed()
112+
public function isNamed(): bool
113113
{
114114
return true;
115115
}
@@ -123,7 +123,7 @@ public function isNamed()
123123
*
124124
* @since 0.1
125125
*/
126-
public function isBlank()
126+
public function isBlank(): bool
127127
{
128128
return false;
129129
}
@@ -137,7 +137,7 @@ public function isBlank()
137137
*
138138
* @since 0.1
139139
*/
140-
public function isPattern()
140+
public function isPattern(): bool
141141
{
142142
return false;
143143
}
@@ -151,7 +151,7 @@ public function isPattern()
151151
*
152152
* @since 0.1
153153
*/
154-
public function toNQuads()
154+
public function toNQuads(): string
155155
{
156156
return '<'.$this->getUri().'>';
157157
}

AnyPatternImpl.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AnyPatternImpl implements AnyPattern
2525
*
2626
* @return bool true, if this instance is a blank node, false otherwise
2727
*/
28-
public function isBlank()
28+
public function isBlank(): bool
2929
{
3030
return false;
3131
}
@@ -35,7 +35,7 @@ public function isBlank()
3535
*
3636
* @return bool true, if this instance is concrete, false otherwise
3737
*/
38-
public function isConcrete()
38+
public function isConcrete(): bool
3939
{
4040
return false;
4141
}
@@ -45,7 +45,7 @@ public function isConcrete()
4545
*
4646
* @return bool true, if it is a literal, false otherwise
4747
*/
48-
public function isLiteral()
48+
public function isLiteral(): bool
4949
{
5050
return false;
5151
}
@@ -55,7 +55,7 @@ public function isLiteral()
5555
*
5656
* @return bool true, if it is a named node, false otherwise
5757
*/
58-
public function isNamed()
58+
public function isNamed(): bool
5959
{
6060
return false;
6161
}
@@ -65,7 +65,7 @@ public function isNamed()
6565
*
6666
* @return bool true, if this instance is a pattern, false otherwise
6767
*/
68-
public function isPattern()
68+
public function isPattern(): bool
6969
{
7070
return true;
7171
}
@@ -77,7 +77,7 @@ public function isPattern()
7777
*
7878
* @return bool true, if both instances are semantically equal, false otherwise
7979
*/
80-
public function equals(Node $toCompare)
80+
public function equals(Node $toCompare): bool
8181
{
8282
// Only compare, if given instance is an AnyPattern too
8383
return $toCompare instanceof AnyPatternImpl;
@@ -90,7 +90,7 @@ public function equals(Node $toCompare)
9090
*
9191
* @return bool always true
9292
*/
93-
public function matches(Node $toMatch)
93+
public function matches(Node $toMatch): bool
9494
{
9595
return true;
9696
}
@@ -101,7 +101,7 @@ public function matches(Node $toMatch)
101101
*
102102
* @return string a human readable string representation of the node
103103
*/
104-
public function __toString()
104+
public function __toString(): string
105105
{
106106
return 'ANY';
107107
}
@@ -113,7 +113,7 @@ public function __toString()
113113
*
114114
* @throws \Exception if no n-quads representation is available
115115
*/
116-
public function toNQuads()
116+
public function toNQuads(): string
117117
{
118118
throw new \Exception('The AnyPattern is not valid in NQuads');
119119
}

BlankNode.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ interface BlankNode extends Node
3131
*
3232
* @since 0.1
3333
*/
34-
public function getBlankId();
34+
public function getBlankId(): string;
3535
}

BlankNodeImpl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct($blankId)
2828
}
2929
}
3030

31-
public function getBlankId()
31+
public function getBlankId(): string
3232
{
3333
return $this->blankId;
3434
}

0 commit comments

Comments
 (0)