*/
public function read (int $bytes = 0) {
// Some sanity checks
- if (is_null($this->getFileObject())) {
+ if ($bytes < 0) {
+ // Cannot be below zero
+ throw new InvalidArgumentException(sprintf('bytes=%d is not valid', $bytes));
+ } elseif (is_null($this->getFileObject())) {
// Pointer not initialized
throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
} elseif (!is_object($this->getFileObject())) {
* @return void
* @throws UnsupportedOperationException If this method is called
*/
- public function analyzeFile () {
+ public function analyzeFileStructure () {
throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
}