15 lines
347 B
PHP
15 lines
347 B
PHP
|
<?php
|
||
|
namespace nulib\os;
|
||
|
|
||
|
/**
|
||
|
* Class EOFException: indiquer que plus aucune donnée n'est disponible sur un
|
||
|
* flux
|
||
|
*/
|
||
|
class EOFException extends IOException {
|
||
|
static final function ensure_not_eof($data, bool $throw=true, $eof=false) {
|
||
|
if ($data !== $eof) return $data;
|
||
|
elseif (!$throw) return null;
|
||
|
else throw new self();
|
||
|
}
|
||
|
}
|