1 | <?php |
||
44 | class StringBuffer implements FileBufferInterface |
||
45 | { |
||
46 | /** |
||
47 | * The buffer contents |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $buffer; |
||
52 | |||
53 | /** |
||
54 | * The buffer length |
||
55 | * |
||
56 | * @var integer |
||
57 | */ |
||
58 | protected $length; |
||
59 | |||
60 | /** |
||
61 | * The current pointer position |
||
62 | * |
||
63 | * @var integer |
||
64 | */ |
||
65 | protected $position; |
||
66 | |||
67 | /** |
||
68 | * The object info if available |
||
69 | * |
||
70 | * @var array |
||
71 | */ |
||
72 | protected $objectInfo; |
||
73 | |||
74 | /** |
||
75 | * The read/write mode |
||
76 | * |
||
77 | * @var string |
||
78 | */ |
||
79 | protected $mode; |
||
80 | |||
81 | /** |
||
82 | * Creates a new file buffer with the given contents |
||
83 | * |
||
84 | * @param string $buffer The buffer content |
||
85 | * @param array $objectInfo The object info |
||
86 | * @param string $mode The file mode |
||
87 | */ |
||
88 | public function __construct($buffer, array $objectInfo = array(), $mode = 'r+') |
||
96 | |||
97 | /** |
||
98 | * Returns the complete contents of the buffer |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | public function getBuffer() |
||
106 | |||
107 | /** |
||
108 | * Returns true if the pointer is at the end of the buffer |
||
109 | * |
||
110 | * @return boolean |
||
111 | */ |
||
112 | public function isEof() |
||
116 | |||
117 | /** |
||
118 | * Reads $count bytes from the buffer |
||
119 | * |
||
120 | * @param integer $count The number of bytes to read |
||
121 | * @return string|null |
||
122 | */ |
||
123 | public function read($count) |
||
132 | |||
133 | /** |
||
134 | * Writes the given date into the buffer at the current pointer position |
||
135 | * |
||
136 | * @param string $data The data to write |
||
137 | * @return integer The number of bytes written |
||
138 | */ |
||
139 | public function write($data) |
||
149 | |||
150 | /** |
||
151 | * Returns the current pointer position |
||
152 | * |
||
153 | * @return integer |
||
154 | */ |
||
155 | public function getPosition() |
||
159 | |||
160 | /** |
||
161 | * Returns the current length |
||
162 | * |
||
163 | * @return integer |
||
164 | */ |
||
165 | public function getLength() |
||
169 | |||
170 | /** |
||
171 | * Sets the pointer position |
||
172 | * |
||
173 | * @param integer $position The position in bytes |
||
174 | * @param integer $whence The reference from where to measure $position (SEEK_SET, SEEK_CUR or SEEK_END) |
||
175 | * @return boolean True if the position could be set |
||
176 | */ |
||
177 | public function setPosition($position, $whence) |
||
204 | |||
205 | /** |
||
206 | * Returns the stat information for the buffer |
||
207 | * |
||
208 | * @return array |
||
209 | */ |
||
210 | public function getStat() |
||
228 | |||
229 | /** |
||
230 | * Flushes the buffer to the storage media |
||
231 | * |
||
232 | * @return boolean |
||
233 | */ |
||
234 | public function flush() |
||
239 | |||
240 | /** |
||
241 | * Closes the buffer |
||
242 | */ |
||
243 | public function close() |
||
250 | } |
||
251 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..