This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
41
{
42
if (!$stream->isReadable()) {
43
throw new Exception\InvalidArgumentException('Stream not readable');
44
}
45
46
if (!in_array($endian, [Endian::ENDIAN_BIG, Endian::ENDIAN_LITTLE])) {
47
throw new Exception\InvalidArgumentException('Invalid endian');
48
}
49
50
$this->stream = $stream;
51
$this->endian = $endian;
52
}
53
54
/**
55
* Get stream
56
*
57
* @return StreamInterface
58
*/
59
public function getStream()
60
{
61
return $this->stream;
62
}
63
64
/**
65
* Get endian
66
*
67
* @return int
68
*/
69
public function getEndian()
70
{
71
return $this->endian;
72
}
73
74
/**
75
* Read string data from the stream
76
*
77
* @throws Exception\IOException An exception will be thrown for invalid stream resources or when the data could
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.