Colors moved to template files, and namespace cleanups

This commit is contained in:
2023-05-18 16:59:14 -04:00
parent 0580cb5d30
commit 60a7ebb231
7 changed files with 99 additions and 73 deletions

View File

@ -1,14 +1,18 @@
<?php
namespace ProVM\Common\Implement;
use Exception;
use ProVM\Common\Define\Log;
use ProVM\Logview\Log as LogContent;
use ProVM\Common\Define\Parser as Definition;
use function Safe\fopen;
abstract class Parser implements \ProVM\Common\Define\Parser
abstract class Parser implements Definition
{
public function total(string $filename): int
{
try {
$fh = \Safe\fopen($filename, 'r');
$fh = fopen($filename, 'r');
$cnt = 0;
while(!feof($fh)) {
$line = fgets($fh);
@ -16,12 +20,12 @@ abstract class Parser implements \ProVM\Common\Define\Parser
}
fclose($fh);
return $cnt;
} catch (\Exception $e) {
} catch (Exception $e) {
return 0;
}
}
public function parse(string $content): Log
{
return new \ProVM\Logview\Log($content);
return new LogContent($content);
}
}