Skip to content

Commit

Permalink
#2255 - Fix signature in method of Iterator classes and interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Sep 11, 2021
1 parent 4070b12 commit f1d67f9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
18 changes: 12 additions & 6 deletions stub/arrayiterator.zep
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class ArrayIterator implements \Iterator
protected position = 0;
protected test;

public function __construct() {
public function __construct()
{
let this->test = [
"one",
"two",
Expand All @@ -14,23 +15,28 @@ class ArrayIterator implements \Iterator
let this->position = 0;
}

public function rewind() {
public function rewind() -> void
{
let this->position = 0;
}

public function current() {
public function current()
{
return this->test[this->position];
}

public function key() {
public function key()
{
return this->position;
}

public function next() {
public function next() -> void
{
let this->position++;
}

public function valid() {
public function valid()
{
return isset this->test[this->position];
}
}
4 changes: 2 additions & 2 deletions stub/internalinterfaces.zep
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ namespace Stub;

class InternalInterfaces implements \Countable
{
public function count()
public function count() -> int
{

return 0;
}
}
8 changes: 4 additions & 4 deletions stub/oo/oonativeimplements.zep
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class OoNativeImplements implements
{
}

public function next()
public function next() -> void
{
}

public function rewind()
public function rewind() -> void
{
}

Expand All @@ -44,7 +44,7 @@ class OoNativeImplements implements

/* OuterIterator */

public function getInnerIterator()
public function getInnerIterator() -> <\Iterator>|null
{
}

Expand All @@ -59,7 +59,7 @@ class OoNativeImplements implements

/* SeekableIterator */

public function seek (position)
public function seek(int position) -> void
{
}

Expand Down
4 changes: 2 additions & 2 deletions stub/usetest.zep
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class UseTest implements Countable
return new StandardClass();
}

public function count()
public function count() -> int
{

return 0;
}

public function testUseClass1()
Expand Down

0 comments on commit f1d67f9

Please sign in to comment.