Skip to content

Commit

Permalink
Add return types to internal & magic methods when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Aug 22, 2019
1 parent d07dae5 commit 9da61f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Tests/VarExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function provideExport()

class MySerializable implements \Serializable
{
public function serialize()
public function serialize(): string
{
return '123';
}
Expand All @@ -227,7 +227,7 @@ class MyWakeup
public $baz;
public $def = 234;

public function __sleep()
public function __sleep(): array
{
return ['sub', 'baz'];
}
Expand Down Expand Up @@ -305,7 +305,7 @@ public function setFlags($flags)

class GoodNight
{
public function __sleep()
public function __sleep(): array
{
$this->good = 'night';

Expand Down Expand Up @@ -395,7 +395,7 @@ public function unserialize($str)

class Php74Serializable implements \Serializable
{
public function __serialize()
public function __serialize(): array
{
return [$this->foo = new \stdClass()];
}
Expand All @@ -405,7 +405,7 @@ public function __unserialize(array $data)
list($this->foo) = $data;
}

public function __sleep()
public function __sleep(): array
{
throw new \BadMethodCallException();
}
Expand All @@ -415,7 +415,7 @@ public function __wakeup()
throw new \BadMethodCallException();
}

public function serialize()
public function serialize(): string
{
throw new \BadMethodCallException();
}
Expand Down

0 comments on commit 9da61f8

Please sign in to comment.