Colors moved to template files, and namespace cleanups
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user