Skip to content

Commit f1d67f9

Browse files
committed
#2255 - Fix signature in method of Iterator classes and interfaces
1 parent 4070b12 commit f1d67f9

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

stub/arrayiterator.zep

+12-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ class ArrayIterator implements \Iterator
55
protected position = 0;
66
protected test;
77

8-
public function __construct() {
8+
public function __construct()
9+
{
910
let this->test = [
1011
"one",
1112
"two",
@@ -14,23 +15,28 @@ class ArrayIterator implements \Iterator
1415
let this->position = 0;
1516
}
1617

17-
public function rewind() {
18+
public function rewind() -> void
19+
{
1820
let this->position = 0;
1921
}
2022

21-
public function current() {
23+
public function current()
24+
{
2225
return this->test[this->position];
2326
}
2427

25-
public function key() {
28+
public function key()
29+
{
2630
return this->position;
2731
}
2832

29-
public function next() {
33+
public function next() -> void
34+
{
3035
let this->position++;
3136
}
3237

33-
public function valid() {
38+
public function valid()
39+
{
3440
return isset this->test[this->position];
3541
}
3642
}

stub/internalinterfaces.zep

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ namespace Stub;
33

44
class InternalInterfaces implements \Countable
55
{
6-
public function count()
6+
public function count() -> int
77
{
8-
8+
return 0;
99
}
1010
}

stub/oo/oonativeimplements.zep

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ class OoNativeImplements implements
3030
{
3131
}
3232

33-
public function next()
33+
public function next() -> void
3434
{
3535
}
3636

37-
public function rewind()
37+
public function rewind() -> void
3838
{
3939
}
4040

@@ -44,7 +44,7 @@ class OoNativeImplements implements
4444

4545
/* OuterIterator */
4646

47-
public function getInnerIterator()
47+
public function getInnerIterator() -> <\Iterator>|null
4848
{
4949
}
5050

@@ -59,7 +59,7 @@ class OoNativeImplements implements
5959

6060
/* SeekableIterator */
6161

62-
public function seek (position)
62+
public function seek(int position) -> void
6363
{
6464
}
6565

stub/usetest.zep

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ class UseTest implements Countable
1616
return new StandardClass();
1717
}
1818

19-
public function count()
19+
public function count() -> int
2020
{
21-
21+
return 0;
2222
}
2323

2424
public function testUseClass1()

0 commit comments

Comments
 (0)