2019-05-30 16:30:41 +02:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Progress;
|
|
|
|
|
2019-07-05 22:24:00 +02:00
|
|
|
use function error_reporting;
|
2019-06-26 22:52:29 +02:00
|
|
|
use function fwrite;
|
2021-06-08 04:55:21 +02:00
|
|
|
|
|
|
|
use const E_ERROR;
|
2019-06-26 22:52:29 +02:00
|
|
|
use const PHP_OS;
|
2019-07-05 22:24:00 +02:00
|
|
|
use const STDERR;
|
2019-06-26 22:52:29 +02:00
|
|
|
|
2019-05-30 16:30:41 +02:00
|
|
|
abstract class Progress
|
|
|
|
{
|
|
|
|
public function setErrorReporting(): void
|
|
|
|
{
|
|
|
|
error_reporting(E_ERROR);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function debug(string $message): void
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function startScanningFiles(): void
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function startAnalyzingFiles(): void
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-06-02 15:59:45 +02:00
|
|
|
public function startAlteringFiles(): void
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function alterFileDone(string $file_name): void
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-05-30 16:30:41 +02:00
|
|
|
public function start(int $number_of_tasks): void
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-06-03 17:20:42 +02:00
|
|
|
public function taskDone(int $level): void
|
2019-05-30 16:30:41 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function finish(): void
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-08-04 16:37:36 +02:00
|
|
|
public function write(string $message): void
|
2019-05-30 16:30:41 +02:00
|
|
|
{
|
|
|
|
fwrite(STDERR, $message);
|
|
|
|
}
|
2019-05-31 00:37:01 +02:00
|
|
|
|
|
|
|
protected static function doesTerminalSupportUtf8() : bool
|
|
|
|
{
|
|
|
|
if (\strtoupper(\substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
|
if (!\function_exists('sapi_windows_cp_is_utf8') || !\sapi_windows_cp_is_utf8()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2019-05-30 16:30:41 +02:00
|
|
|
}
|