PHPStan: Fix level 6 errors

This commit is contained in:
Jakub Vrana
2025-03-26 21:06:01 +01:00
parent c96894ecd4
commit d3b53d9d9c
14 changed files with 114 additions and 51 deletions

View File

@@ -2,18 +2,23 @@
namespace Adminer;
class TmpFile {
private $handler;
public $size; ///< @visibility protected(set)
/** @var resource */ private $handler;
/** @var int @visibility protected(set) */ public $size;
function __construct() {
$this->handler = tmpfile();
}
/**
* @param string
* @return void
*/
function write($contents) {
$this->size += strlen($contents);
fwrite($this->handler, $contents);
}
/** @return void */
function send() {
fseek($this->handler, 0);
fpassthru($this->handler);