-
-
Notifications
You must be signed in to change notification settings - Fork 385
Closed
Description
Please refer to stackoverflow.com post:
I've got a class defined as follows:
class User implements UserInterface, \Serializable
{
...
/**
* Serialize user object and return as a string.
*
* @return string
*/
public function serialize()
{
return serialize(array(
'id' => $this->id,
'username' => $this->username
));
}
/**
* Deserialize from the given $data string.
*
* @param string $data
*
* @return mixed|void
*/
public function unserialize($data)
{
$data = unserialize($data);
$this->id = $data['id'];
$this->username = $data['username'];
return $this;
}
...
}When I run my unit tests, they pass 100%, but when looking at my code coverage report, I see the following:
Basically the line where I have @return mixed|void is marked as uncovered code, and it's affecting the code coverage statistics.
The only way to make the error go away, is by either removing either UserInterface, or \Serializable from the implements clause, so this seems to be a problem where a class implements multiple interfaces. When I do this, my class is covered 100%, but with the defect, it is marked as 89.06% covered?
I am using
- PHP Version 5.3.8
- XDebug version v2.2.0-dev
- PHPUnit 3.6.11 by Sebastian Bergmann.
Rikj000
Metadata
Metadata
Assignees
Labels
No labels
